Skip to content

Commit

Permalink
[CP] Fix not being able to hide iOS status bar via setEnabledSystemUI…
Browse files Browse the repository at this point in the history
…Mode (#48403)

Original PR: flutter/engine#48271

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
  • Loading branch information
LinXunFeng authored and DenisovAV committed May 5, 2024
1 parent b4b9979 commit e831320
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@ - (void)testStatusBarHiddenUpdate {
OCMStub([mockApplication sharedApplication]).andReturn(mockApplication);

// Enabling system UI overlays to update status bar.
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"test" project:nil];
FlutterEngine* engine = [[[FlutterEngine alloc] initWithName:@"test" project:nil] autorelease];
[engine runWithEntrypoint:nil];
FlutterViewController* flutterViewController =
[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil];
std::unique_ptr<fml::WeakNSObjectFactory<FlutterEngine>> _weakFactory =
std::make_unique<fml::WeakNSObjectFactory<FlutterEngine>>(engine);
[[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease];
std::unique_ptr<fml::WeakPtrFactory<FlutterEngine>> _weakFactory =
std::make_unique<fml::WeakPtrFactory<FlutterEngine>>(engine);

// Update to hidden.
FlutterPlatformPlugin* plugin = [engine platformPlugin];
Expand Down Expand Up @@ -504,12 +504,12 @@ - (void)testStatusBarStyle {
id mockApplication = OCMClassMock([UIApplication class]);
OCMStub([mockApplication sharedApplication]).andReturn(mockApplication);

FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"test" project:nil];
FlutterEngine* engine = [[[FlutterEngine alloc] initWithName:@"test" project:nil] autorelease];
[engine runWithEntrypoint:nil];
FlutterViewController* flutterViewController =
[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil];
std::unique_ptr<fml::WeakNSObjectFactory<FlutterEngine>> _weakFactory =
std::make_unique<fml::WeakNSObjectFactory<FlutterEngine>>(engine);
[[[FlutterViewController alloc] initWithEngine:engine nibName:nil bundle:nil] autorelease];
std::unique_ptr<fml::WeakPtrFactory<FlutterEngine>> _weakFactory =
std::make_unique<fml::WeakPtrFactory<FlutterEngine>>(engine);
XCTAssertFalse(flutterViewController.prefersStatusBarHidden);

FlutterPlatformPlugin* plugin = [engine platformPlugin];
Expand Down

0 comments on commit e831320

Please sign in to comment.