99 {
102 id mockEngine = OCMPartialMock(
engine);
103 OCMStub([mockEngine notifyLowMemory]);
104 OCMStub([mockEngine iosPlatformView]).andReturn(
platform_view.get());
105
107 OCMVerify([mockEngine notifyLowMemory]);
108 OCMReject([mockEngine notifyLowMemory]);
109
110 XCTNSNotificationExpectation* memoryExpectation = [[XCTNSNotificationExpectation alloc]
111 initWithName:UIApplicationDidReceiveMemoryWarningNotification];
112 [[NSNotificationCenter defaultCenter]
113 postNotificationName:UIApplicationDidReceiveMemoryWarningNotification
114 object:nil];
115 [self waitForExpectations:@[ memoryExpectation ] timeout:5.0];
116 OCMVerify([mockEngine notifyLowMemory]);
117 OCMReject([mockEngine notifyLowMemory]);
118
119 XCTNSNotificationExpectation* backgroundExpectation = [[XCTNSNotificationExpectation alloc]
120 initWithName:UIApplicationDidEnterBackgroundNotification];
121 [[NSNotificationCenter defaultCenter]
122 postNotificationName:UIApplicationDidEnterBackgroundNotification
123 object:nil];
124 [self waitForExpectations:@[ backgroundExpectation ] timeout:5.0];
125
126 OCMVerify([mockEngine notifyLowMemory]);
127}
void setViewController:(FlutterViewController *viewController)