131 {
134 id mockEngine = OCMPartialMock(
engine);
135 OCMStub([mockEngine notifyLowMemory]);
136 OCMStub([mockEngine iosPlatformView]).andReturn(
platform_view.get());
137
139 OCMVerify([mockEngine notifyLowMemory]);
140 OCMReject([mockEngine notifyLowMemory]);
141
142 XCTNSNotificationExpectation* memoryExpectation = [[XCTNSNotificationExpectation alloc]
143 initWithName:UIApplicationDidReceiveMemoryWarningNotification];
144 [[NSNotificationCenter defaultCenter]
145 postNotificationName:UIApplicationDidReceiveMemoryWarningNotification
146 object:nil];
147 [self waitForExpectations:@[ memoryExpectation ] timeout:5.0];
148 OCMVerify([mockEngine notifyLowMemory]);
149 OCMReject([mockEngine notifyLowMemory]);
150
151 XCTNSNotificationExpectation* backgroundExpectation = [[XCTNSNotificationExpectation alloc]
152 initWithName:UIApplicationDidEnterBackgroundNotification];
153 [[NSNotificationCenter defaultCenter]
154 postNotificationName:UIApplicationDidEnterBackgroundNotification
155 object:nil];
156 [self waitForExpectations:@[ backgroundExpectation ] timeout:5.0];
157
158 OCMVerify([mockEngine notifyLowMemory]);
159}
void setViewController:(FlutterViewController *viewController)