◆ testCreate
◆ testDidBecomeActive
- (void) testDidBecomeActive |
|
|
|
|
implementation |
Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.
72 {
74 [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationDidBecomeActiveNotification];
75
77 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
79 [[NSNotificationCenter defaultCenter]
80 postNotificationName:UIApplicationDidBecomeActiveNotification
81 object:nil];
82 [self waitForExpectations:@[ expectation ] timeout:5.0];
83 OCMVerify([plugin applicationDidBecomeActive:[UIApplication sharedApplication]]);
84}
void addDelegate:(NSObject< FlutterApplicationLifeCycleDelegate > *delegate)
◆ testDidEnterBackground
- (void) testDidEnterBackground |
|
|
|
|
implementation |
Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.
30 {
31 XCTNSNotificationExpectation*
expectation = [[XCTNSNotificationExpectation alloc]
32 initWithName:UIApplicationDidEnterBackgroundNotification];
34 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
36 [[NSNotificationCenter defaultCenter]
37 postNotificationName:UIApplicationDidEnterBackgroundNotification
38 object:nil];
39
40 [self waitForExpectations:@[ expectation ] timeout:5.0];
41 OCMVerify([plugin applicationDidEnterBackground:[UIApplication sharedApplication]]);
42}
◆ testReleasesPluginOnDealloc
- (void) testReleasesPluginOnDealloc |
|
|
|
|
implementation |
Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.
99 {
100 __weak id<FlutterApplicationLifeCycleDelegate> weakPlugin;
102 @autoreleasepool {
104 weakPlugin = fakePlugin;
107 weakDelegate = delegate;
108 }
109 XCTAssertNil(weakPlugin);
110 XCTAssertNil(weakDelegate);
111}
◆ testWillEnterForeground
- (void) testWillEnterForeground |
|
|
|
|
implementation |
Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.
44 {
45 XCTNSNotificationExpectation*
expectation = [[XCTNSNotificationExpectation alloc]
46 initWithName:UIApplicationWillEnterForegroundNotification];
47
49 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
51 [[NSNotificationCenter defaultCenter]
52 postNotificationName:UIApplicationWillEnterForegroundNotification
53 object:nil];
54 [self waitForExpectations:@[ expectation ] timeout:5.0];
55 OCMVerify([plugin applicationWillEnterForeground:[UIApplication sharedApplication]]);
56}
◆ testWillResignActive
- (void) testWillResignActive |
|
|
|
|
implementation |
Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.
58 {
60 [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationWillResignActiveNotification];
61
63 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
65 [[NSNotificationCenter defaultCenter]
66 postNotificationName:UIApplicationWillResignActiveNotification
67 object:nil];
68 [self waitForExpectations:@[ expectation ] timeout:5.0];
69 OCMVerify([plugin applicationWillResignActive:[UIApplication sharedApplication]]);
70}
◆ testWillTerminate
- (void) testWillTerminate |
|
|
|
|
implementation |
Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.
86 {
88 [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationWillTerminateNotification];
89
91 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
93 [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationWillTerminateNotification
94 object:nil];
95 [self waitForExpectations:@[ expectation ] timeout:5.0];
96 OCMVerify([plugin applicationWillTerminate:[UIApplication sharedApplication]]);
97}
The documentation for this class was generated from the following file: