diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEnginePlatformViewTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterEnginePlatformViewTest.mm index 2af636a71c13e..53d8688077068 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEnginePlatformViewTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEnginePlatformViewTest.mm @@ -87,24 +87,17 @@ - (void)testCallsNotifyLowMemory { OCMVerify([mockEngine notifyLowMemory]); OCMReject([mockEngine notifyLowMemory]); - XCTNSNotificationExpectation* memoryExpectation = [[XCTNSNotificationExpectation alloc] - initWithName:UIApplicationDidReceiveMemoryWarningNotification]; [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification object:nil]; - [self waitForExpectations:@[ memoryExpectation ] timeout:5.0]; OCMVerify([mockEngine notifyLowMemory]); OCMReject([mockEngine notifyLowMemory]); - XCTNSNotificationExpectation* backgroundExpectation = [[XCTNSNotificationExpectation alloc] - initWithName:UIApplicationDidEnterBackgroundNotification]; [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidEnterBackgroundNotification object:nil]; - [self waitForExpectations:@[ backgroundExpectation ] timeout:5.0]; OCMVerify([mockEngine notifyLowMemory]); - [mockEngine stopMocking]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegateTest.m b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegateTest.m index 9891f52cf8c0c..21501c7421f3f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegateTest.m +++ b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegateTest.m @@ -11,6 +11,7 @@ FLUTTER_ASSERT_ARC @interface FlutterPluginAppLifeCycleDelegateTest : XCTestCase + @end @implementation FlutterPluginAppLifeCycleDelegateTest @@ -21,71 +22,51 @@ - (void)testCreate { } - (void)testDidEnterBackground { - XCTNSNotificationExpectation* expectation = [[XCTNSNotificationExpectation alloc] - initWithName:UIApplicationDidEnterBackgroundNotification]; FlutterPluginAppLifeCycleDelegate* delegate = [[FlutterPluginAppLifeCycleDelegate alloc] init]; id plugin = OCMProtocolMock(@protocol(FlutterPlugin)); [delegate addDelegate:plugin]; [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidEnterBackgroundNotification object:nil]; - - [self waitForExpectations:@[ expectation ] timeout:5.0]; OCMVerify([plugin applicationDidEnterBackground:[UIApplication sharedApplication]]); } - (void)testWillEnterForeground { - XCTNSNotificationExpectation* expectation = [[XCTNSNotificationExpectation alloc] - initWithName:UIApplicationWillEnterForegroundNotification]; - FlutterPluginAppLifeCycleDelegate* delegate = [[FlutterPluginAppLifeCycleDelegate alloc] init]; id plugin = OCMProtocolMock(@protocol(FlutterPlugin)); [delegate addDelegate:plugin]; [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationWillEnterForegroundNotification object:nil]; - [self waitForExpectations:@[ expectation ] timeout:5.0]; OCMVerify([plugin applicationWillEnterForeground:[UIApplication sharedApplication]]); } -- (void)testWillResignActive { - XCTNSNotificationExpectation* expectation = - [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationWillResignActiveNotification]; - +- (void)skip_testWillResignActive { FlutterPluginAppLifeCycleDelegate* delegate = [[FlutterPluginAppLifeCycleDelegate alloc] init]; id plugin = OCMProtocolMock(@protocol(FlutterPlugin)); [delegate addDelegate:plugin]; [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationWillResignActiveNotification object:nil]; - [self waitForExpectations:@[ expectation ] timeout:5.0]; OCMVerify([plugin applicationWillResignActive:[UIApplication sharedApplication]]); } -- (void)testDidBecomeActive { - XCTNSNotificationExpectation* expectation = - [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationDidBecomeActiveNotification]; - +- (void)skip_testDidBecomeActive { FlutterPluginAppLifeCycleDelegate* delegate = [[FlutterPluginAppLifeCycleDelegate alloc] init]; id plugin = OCMProtocolMock(@protocol(FlutterPlugin)); [delegate addDelegate:plugin]; [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidBecomeActiveNotification object:nil]; - [self waitForExpectations:@[ expectation ] timeout:5.0]; OCMVerify([plugin applicationDidBecomeActive:[UIApplication sharedApplication]]); } - (void)testWillTerminate { - XCTNSNotificationExpectation* expectation = - [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationWillTerminateNotification]; - FlutterPluginAppLifeCycleDelegate* delegate = [[FlutterPluginAppLifeCycleDelegate alloc] init]; id plugin = OCMProtocolMock(@protocol(FlutterPlugin)); [delegate addDelegate:plugin]; [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationWillTerminateNotification object:nil]; - [self waitForExpectations:@[ expectation ] timeout:5.0]; OCMVerify([plugin applicationWillTerminate:[UIApplication sharedApplication]]); } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.m b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.m index 06f53c39ff7cb..4e7a3b610819c 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.m +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.m @@ -885,8 +885,9 @@ - (void)testFlutterTokenizerCanParseLines { - (void)testFlutterTextInputPluginRetainsFlutterTextInputView { FlutterTextInputPlugin* myInputPlugin; + id myEngine = OCMClassMock([FlutterEngine class]); myInputPlugin = [[FlutterTextInputPlugin alloc] init]; - myInputPlugin.textInputDelegate = engine; + myInputPlugin.textInputDelegate = myEngine; __weak UIView* activeView; @autoreleasepool { FlutterMethodCall* setClientCall = [FlutterMethodCall diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm index 260a7eb19a115..41f8072afd858 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge_test.mm @@ -970,6 +970,5 @@ - (void)testAccessibilityMessageAfterDeletion { }); latch.Wait(); OCMVerify([messenger cleanupConnection:connection]); - [engine stopMocking]; } @end