66#import < XCTest/XCTest.h>
77#include " flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
88#import " flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
9+ #import " flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"
910
1011#include " FlutterBinaryMessenger.h"
1112
@@ -344,67 +345,67 @@ - (void)testPerformOrientationUpdateDoesNotForceOrientationChange {
344345 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAll
345346 currentOrientation: UIInterfaceOrientationPortrait
346347 didChangeOrientation: NO
347- resultingOrientation: 0 ];
348+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
348349
349350 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAll
350351 currentOrientation: UIInterfaceOrientationPortraitUpsideDown
351352 didChangeOrientation: NO
352- resultingOrientation: 0 ];
353+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
353354
354355 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAll
355356 currentOrientation: UIInterfaceOrientationLandscapeLeft
356357 didChangeOrientation: NO
357- resultingOrientation: 0 ];
358+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
358359
359360 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAll
360361 currentOrientation: UIInterfaceOrientationLandscapeRight
361362 didChangeOrientation: NO
362- resultingOrientation: 0 ];
363+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
363364
364365 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAllButUpsideDown
365366 currentOrientation: UIInterfaceOrientationPortrait
366367 didChangeOrientation: NO
367- resultingOrientation: 0 ];
368+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
368369
369370 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAllButUpsideDown
370371 currentOrientation: UIInterfaceOrientationLandscapeLeft
371372 didChangeOrientation: NO
372- resultingOrientation: 0 ];
373+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
373374
374375 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskAllButUpsideDown
375376 currentOrientation: UIInterfaceOrientationLandscapeRight
376377 didChangeOrientation: NO
377- resultingOrientation: 0 ];
378+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
378379
379380 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskPortrait
380381 currentOrientation: UIInterfaceOrientationPortrait
381382 didChangeOrientation: NO
382- resultingOrientation: 0 ];
383+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
383384
384385 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskPortraitUpsideDown
385386 currentOrientation: UIInterfaceOrientationPortraitUpsideDown
386387 didChangeOrientation: NO
387- resultingOrientation: 0 ];
388+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
388389
389390 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskLandscape
390391 currentOrientation: UIInterfaceOrientationLandscapeLeft
391392 didChangeOrientation: NO
392- resultingOrientation: 0 ];
393+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
393394
394395 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskLandscape
395396 currentOrientation: UIInterfaceOrientationLandscapeRight
396397 didChangeOrientation: NO
397- resultingOrientation: 0 ];
398+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
398399
399400 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskLandscapeLeft
400401 currentOrientation: UIInterfaceOrientationLandscapeLeft
401402 didChangeOrientation: NO
402- resultingOrientation: 0 ];
403+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
403404
404405 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskLandscapeRight
405406 currentOrientation: UIInterfaceOrientationLandscapeRight
406407 didChangeOrientation: NO
407- resultingOrientation: 0 ];
408+ resultingOrientation: static_cast <UIInterfaceOrientation>( 0 ) ];
408409}
409410
410411// Perform an orientation update test that fails when the expected outcome
@@ -465,8 +466,6 @@ - (void)testWillDeallocNotification {
465466}
466467
467468- (void )testDoesntLoadViewInInit {
468- XCTestExpectation* expectation =
469- [[XCTestExpectation alloc ] initWithDescription: @" notification called" ];
470469 FlutterDartProject* project = [[FlutterDartProject alloc ] init ];
471470 FlutterEngine* engine = [[FlutterEngine alloc ] initWithName: @" foobar" project: project];
472471 [engine createShell: @" " libraryURI: @" " ];
@@ -476,4 +475,17 @@ - (void)testDoesntLoadViewInInit {
476475 XCTAssertFalse ([realVC isViewLoaded ], @" shouldn't have loaded since it hasn't been shown" );
477476}
478477
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+
479491@end
0 commit comments