Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | List of all members
FlutterPluginAppLifeCycleDelegateTest Class Reference
Inheritance diagram for FlutterPluginAppLifeCycleDelegateTest:

Instance Methods

(void) - testCreate [implementation]
 
(void) - testDidEnterBackground [implementation]
 
(void) - testWillEnterForeground [implementation]
 
(void) - testWillResignActive [implementation]
 
(void) - testDidBecomeActive [implementation]
 
(void) - testWillTerminate [implementation]
 

Detailed Description

Definition at line 13 of file FlutterPluginAppLifeCycleDelegateTest.mm.

Method Documentation

◆ testCreate

- (void) testCreate
implementation

◆ testDidBecomeActive

- (void) testDidBecomeActive
implementation

Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.

66 {
67 XCTNSNotificationExpectation* expectation =
68 [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationDidBecomeActiveNotification];
69
71 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
72 [delegate addDelegate:plugin];
73 [[NSNotificationCenter defaultCenter]
74 postNotificationName:UIApplicationDidBecomeActiveNotification
75 object:nil];
76 [self waitForExpectations:@[ expectation ] timeout:5.0];
77 OCMVerify([plugin applicationDidBecomeActive:[UIApplication sharedApplication]]);
78}
void addDelegate:(NSObject< FlutterApplicationLifeCycleDelegate > *delegate)

◆ testDidEnterBackground

- (void) testDidEnterBackground
implementation

Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.

24 {
25 XCTNSNotificationExpectation* expectation = [[XCTNSNotificationExpectation alloc]
26 initWithName:UIApplicationDidEnterBackgroundNotification];
28 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
29 [delegate addDelegate:plugin];
30 [[NSNotificationCenter defaultCenter]
31 postNotificationName:UIApplicationDidEnterBackgroundNotification
32 object:nil];
33
34 [self waitForExpectations:@[ expectation ] timeout:5.0];
35 OCMVerify([plugin applicationDidEnterBackground:[UIApplication sharedApplication]]);
36}

◆ testWillEnterForeground

- (void) testWillEnterForeground
implementation

Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.

38 {
39 XCTNSNotificationExpectation* expectation = [[XCTNSNotificationExpectation alloc]
40 initWithName:UIApplicationWillEnterForegroundNotification];
41
43 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
44 [delegate addDelegate:plugin];
45 [[NSNotificationCenter defaultCenter]
46 postNotificationName:UIApplicationWillEnterForegroundNotification
47 object:nil];
48 [self waitForExpectations:@[ expectation ] timeout:5.0];
49 OCMVerify([plugin applicationWillEnterForeground:[UIApplication sharedApplication]]);
50}

◆ testWillResignActive

- (void) testWillResignActive
implementation

Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.

52 {
53 XCTNSNotificationExpectation* expectation =
54 [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationWillResignActiveNotification];
55
57 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
58 [delegate addDelegate:plugin];
59 [[NSNotificationCenter defaultCenter]
60 postNotificationName:UIApplicationWillResignActiveNotification
61 object:nil];
62 [self waitForExpectations:@[ expectation ] timeout:5.0];
63 OCMVerify([plugin applicationWillResignActive:[UIApplication sharedApplication]]);
64}

◆ testWillTerminate

- (void) testWillTerminate
implementation

Definition at line 11 of file FlutterPluginAppLifeCycleDelegateTest.mm.

80 {
81 XCTNSNotificationExpectation* expectation =
82 [[XCTNSNotificationExpectation alloc] initWithName:UIApplicationWillTerminateNotification];
83
85 id plugin = OCMProtocolMock(@protocol(FlutterPlugin));
86 [delegate addDelegate:plugin];
87 [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationWillTerminateNotification
88 object:nil];
89 [self waitForExpectations:@[ expectation ] timeout:5.0];
90 OCMVerify([plugin applicationWillTerminate:[UIApplication sharedApplication]]);
91}

The documentation for this class was generated from the following file: