6
6
#import < XCTest/XCTest.h>
7
7
#include " flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
8
8
#import " flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
9
+ #import " flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"
9
10
10
11
#include " FlutterBinaryMessenger.h"
11
12
@@ -344,67 +345,67 @@ - (void)testPerformOrientationUpdateDoesNotForceOrientationChange {
344
345
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAll
345
346
currentOrientation: UIInterfaceOrientationPortrait
346
347
didChangeOrientation: NO
347
- resultingOrientation: 0 ];
348
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
348
349
349
350
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAll
350
351
currentOrientation: UIInterfaceOrientationPortraitUpsideDown
351
352
didChangeOrientation: NO
352
- resultingOrientation: 0 ];
353
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
353
354
354
355
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAll
355
356
currentOrientation: UIInterfaceOrientationLandscapeLeft
356
357
didChangeOrientation: NO
357
- resultingOrientation: 0 ];
358
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
358
359
359
360
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAll
360
361
currentOrientation: UIInterfaceOrientationLandscapeRight
361
362
didChangeOrientation: NO
362
- resultingOrientation: 0 ];
363
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
363
364
364
365
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAllButUpsideDown
365
366
currentOrientation: UIInterfaceOrientationPortrait
366
367
didChangeOrientation: NO
367
- resultingOrientation: 0 ];
368
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
368
369
369
370
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAllButUpsideDown
370
371
currentOrientation: UIInterfaceOrientationLandscapeLeft
371
372
didChangeOrientation: NO
372
- resultingOrientation: 0 ];
373
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
373
374
374
375
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAllButUpsideDown
375
376
currentOrientation: UIInterfaceOrientationLandscapeRight
376
377
didChangeOrientation: NO
377
- resultingOrientation: 0 ];
378
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
378
379
379
380
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskPortrait
380
381
currentOrientation: UIInterfaceOrientationPortrait
381
382
didChangeOrientation: NO
382
- resultingOrientation: 0 ];
383
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
383
384
384
385
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskPortraitUpsideDown
385
386
currentOrientation: UIInterfaceOrientationPortraitUpsideDown
386
387
didChangeOrientation: NO
387
- resultingOrientation: 0 ];
388
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
388
389
389
390
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskLandscape
390
391
currentOrientation: UIInterfaceOrientationLandscapeLeft
391
392
didChangeOrientation: NO
392
- resultingOrientation: 0 ];
393
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
393
394
394
395
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskLandscape
395
396
currentOrientation: UIInterfaceOrientationLandscapeRight
396
397
didChangeOrientation: NO
397
- resultingOrientation: 0 ];
398
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
398
399
399
400
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskLandscapeLeft
400
401
currentOrientation: UIInterfaceOrientationLandscapeLeft
401
402
didChangeOrientation: NO
402
- resultingOrientation: 0 ];
403
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
403
404
404
405
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskLandscapeRight
405
406
currentOrientation: UIInterfaceOrientationLandscapeRight
406
407
didChangeOrientation: NO
407
- resultingOrientation: 0 ];
408
+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
408
409
}
409
410
410
411
// Perform an orientation update test that fails when the expected outcome
@@ -465,8 +466,6 @@ - (void)testWillDeallocNotification {
465
466
}
466
467
467
468
- (void )testDoesntLoadViewInInit {
468
- XCTestExpectation* expectation =
469
- [[XCTestExpectation alloc ] initWithDescription: @" notification called" ];
470
469
FlutterDartProject* project = [[FlutterDartProject alloc ] init ];
471
470
FlutterEngine* engine = [[FlutterEngine alloc ] initWithName: @" foobar" project: project];
472
471
[engine createShell: @" " libraryURI: @" " ];
@@ -476,4 +475,17 @@ - (void)testDoesntLoadViewInInit {
476
475
XCTAssertFalse ([realVC isViewLoaded ], @" shouldn't have loaded since it hasn't been shown" );
477
476
}
478
477
478
+ - (void )testHideOverlay {
479
+ FlutterDartProject* project = [[FlutterDartProject alloc ] init ];
480
+ FlutterEngine* engine = [[FlutterEngine alloc ] initWithName: @" foobar" project: project];
481
+ [engine createShell: @" " libraryURI: @" " ];
482
+ FlutterViewController* realVC = [[FlutterViewController alloc ] initWithEngine: engine
483
+ nibName: nil
484
+ bundle: nil ];
485
+ XCTAssertFalse (realVC.prefersHomeIndicatorAutoHidden , @" " );
486
+ [[NSNotificationCenter defaultCenter ] postNotificationName: FlutterViewControllerHideHomeIndicator
487
+ object: nil ];
488
+ XCTAssertTrue (realVC.prefersHomeIndicatorAutoHidden , @" " );
489
+ }
490
+
479
491
@end
0 commit comments