未验证 提交 1b0dc61e 编写于 作者: G gaaclarke 提交者: GitHub

Stopped mocking the a flutter engine to make sure we delete the (#23013)

FlutterViewController.
上级 7bdaf379
......@@ -101,15 +101,22 @@ typedef enum UIAccessibilityContrast : NSInteger {
}
- (void)testBinaryMessenger {
id engine = OCMClassMock([FlutterEngine class]);
FlutterViewController* vc = [[FlutterViewController alloc] initWithEngine:engine
nibName:nil
bundle:nil];
XCTAssertNotNil(vc);
id messenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger));
OCMStub([engine binaryMessenger]).andReturn(messenger);
XCTAssertEqual(vc.binaryMessenger, messenger);
OCMVerify([engine binaryMessenger]);
__weak FlutterViewController* weakVC;
@autoreleasepool {
id engine = OCMClassMock([FlutterEngine class]);
FlutterViewController* vc = [[FlutterViewController alloc] initWithEngine:engine
nibName:nil
bundle:nil];
XCTAssertNotNil(vc);
weakVC = vc;
id messenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger));
OCMStub([engine binaryMessenger]).andReturn(messenger);
XCTAssertEqual(vc.binaryMessenger, messenger);
OCMVerify([engine binaryMessenger]);
// This had to be added to make sure the view controller is deleted.
[engine stopMocking];
}
XCTAssertNil(weakVC);
}
#pragma mark - Platform Brightness
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册