Flutter Engine
The Flutter Engine
Instance Methods | List of all members
UIViewController_FlutterViewAndSceneIfLoadedTest Class Reference
Inheritance diagram for UIViewController_FlutterViewAndSceneIfLoadedTest:

Instance Methods

(void) - testWindowSceneIfViewLoadedReturnsWindowSceneIfViewLoaded [implementation]
 
(void) - testWindowSceneIfViewLoadedReturnsNilIfViewNotLoaded [implementation]
 
(void) - testScreenIfViewLoadedReturnsMainScreenBeforeIOS13 [implementation]
 
(void) - testScreenIfViewLoadedReturnsScreenIfViewLoadedAfterIOS13 [implementation]
 
(void) - testScreenIfViewLoadedReturnsNilIfViewNotLoadedAfterIOS13 [implementation]
 

Detailed Description

Definition at line 12 of file UIViewController_FlutterScreenAndSceneIfLoadedTest.mm.

Method Documentation

◆ testScreenIfViewLoadedReturnsMainScreenBeforeIOS13

- (void) testScreenIfViewLoadedReturnsMainScreenBeforeIOS13
implementation

Definition at line 10 of file UIViewController_FlutterScreenAndSceneIfLoadedTest.mm.

44 {
45 if (@available(iOS 13.0, *)) {
46 return;
47 }
48
49 UIViewController* viewController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
50 XCTAssertEqual(viewController.flutterScreenIfViewLoaded, UIScreen.mainScreen,
51 @"Must return UIScreen.mainScreen before iOS 13");
52}
FlutterViewController * viewController

◆ testScreenIfViewLoadedReturnsNilIfViewNotLoadedAfterIOS13

- (void) testScreenIfViewLoadedReturnsNilIfViewNotLoadedAfterIOS13
implementation

Definition at line 10 of file UIViewController_FlutterScreenAndSceneIfLoadedTest.mm.

73 {
74 if (@available(iOS 13.0, *)) {
75 UIViewController* viewController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
76 XCTAssertNil(viewController.flutterScreenIfViewLoaded,
77 @"Must return nil screen when view not loaded");
78 }
79}

◆ testScreenIfViewLoadedReturnsScreenIfViewLoadedAfterIOS13

- (void) testScreenIfViewLoadedReturnsScreenIfViewLoadedAfterIOS13
implementation

Definition at line 10 of file UIViewController_FlutterScreenAndSceneIfLoadedTest.mm.

54 {
55 if (@available(iOS 13.0, *)) {
56 UIViewController* viewController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
57
58 NSSet<UIScene*>* scenes = UIApplication.sharedApplication.connectedScenes;
59 XCTAssertEqual(scenes.count, 1UL, @"There must only be 1 scene for test");
60 UIScene* scene = scenes.anyObject;
61 XCTAssert([scene isKindOfClass:[UIWindowScene class]], @"Must be a window scene for test");
62 UIWindowScene* windowScene = (UIWindowScene*)scene;
63 XCTAssert(windowScene.windows.count > 0, @"There must be at least 1 window for test");
64 UIWindow* window = windowScene.windows[0];
65 [window addSubview:viewController.view];
66
67 [viewController loadView];
68 XCTAssertEqual(viewController.flutterScreenIfViewLoaded, windowScene.screen,
69 @"Must return the correct screen when view loaded");
70 }
71}
GLFWwindow * window
Definition: main.cc:45

◆ testWindowSceneIfViewLoadedReturnsNilIfViewNotLoaded

- (void) testWindowSceneIfViewLoadedReturnsNilIfViewNotLoaded
implementation

Definition at line 10 of file UIViewController_FlutterScreenAndSceneIfLoadedTest.mm.

36 {
37 if (@available(iOS 13.0, *)) {
38 UIViewController* viewController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
39 XCTAssertNil(viewController.flutterWindowSceneIfViewLoaded,
40 @"Must return nil window scene when view not loaded");
41 }
42}

◆ testWindowSceneIfViewLoadedReturnsWindowSceneIfViewLoaded

- (void) testWindowSceneIfViewLoadedReturnsWindowSceneIfViewLoaded
implementation

Definition at line 10 of file UIViewController_FlutterScreenAndSceneIfLoadedTest.mm.

17 {
18 if (@available(iOS 13.0, *)) {
19 UIViewController* viewController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
20
21 NSSet<UIScene*>* scenes = UIApplication.sharedApplication.connectedScenes;
22 XCTAssertEqual(scenes.count, 1UL, @"There must only be 1 scene for test");
23 UIScene* scene = scenes.anyObject;
24 XCTAssert([scene isKindOfClass:[UIWindowScene class]], @"Must be a window scene for test");
25 UIWindowScene* windowScene = (UIWindowScene*)scene;
26 XCTAssert(windowScene.windows.count > 0, @"There must be at least 1 window for test");
27 UIWindow* window = windowScene.windows[0];
28 [window addSubview:viewController.view];
29
30 [viewController loadView];
31 XCTAssertEqual(viewController.flutterWindowSceneIfViewLoaded, windowScene,
32 @"Must return the correct window scene when view loaded");
33 }
34}

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