Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_releases] Flutter stable 2.8.1 Engine Cherrypicks #30355

Merged
merged 5 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gcp_credentials: ENCRYPTED[!48cff44dd32e9cc412d4d381c7fe68d373ca04cf2639f8192d21cb1a9ab5e21129651423a1cf88f3fd7fe2125c1cabd9!]
gcp_credentials: ENCRYPTED[!cc769765170bebc37e0556e2da5915ca64ee37f4ec8c966ec147e2f59578b476c99e457eafce4e2f8b1a4e305f7096b8!]

# LINUX
task:
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS.
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': '3d2629cd0310df74bdf260d828ed3c75f25db889',
'dart_revision': '1278bd5adb6a857580f137e47bc521976222f7b9',

# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_third_party
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: fbed5705076e0a8ed5942eaed257e0bc
Signature: a92ff326020b0e5d29148bd8e830fb6c

UNUSED LICENSES:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ - (void)setupNotificationCenterObservers {
name:UIApplicationWillResignActiveNotification
object:nil];

[center addObserver:self
selector:@selector(applicationWillTerminate:)
name:UIApplicationWillTerminateNotification
object:nil];

[center addObserver:self
selector:@selector(applicationDidEnterBackground:)
name:UIApplicationDidEnterBackgroundNotification
Expand Down Expand Up @@ -790,6 +795,11 @@ - (void)applicationWillResignActive:(NSNotification*)notification {
[self goToApplicationLifecycle:@"AppLifecycleState.inactive"];
}

- (void)applicationWillTerminate:(NSNotification*)notification {
[self goToApplicationLifecycle:@"AppLifecycleState.detached"];
[self.engine destroyContext];
}

- (void)applicationDidEnterBackground:(NSNotification*)notification {
TRACE_EVENT0("flutter", "applicationDidEnterBackground");
[self surfaceUpdated:NO];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ - (void)handlePressEvent:(FlutterUIPressProxy*)press
- (void)scrollEvent:(UIPanGestureRecognizer*)recognizer;
- (void)updateViewportMetrics;
- (void)onUserSettingsChanged:(NSNotification*)notification;
- (void)applicationWillTerminate:(NSNotification*)notification;
- (void)goToApplicationLifecycle:(nonnull NSString*)state;
@end

@interface FlutterViewControllerTest : XCTestCase
Expand Down Expand Up @@ -167,6 +169,20 @@ - (void)testViewDidDisappearDoesntPauseEngineWhenNotTheViewController {
OCMReject([viewControllerMock surfaceUpdated:[OCMArg any]]);
}

- (void)testAppWillTerminateViewDidDestroyTheEngine {
FlutterEngine* mockEngine = OCMPartialMock([[FlutterEngine alloc] init]);
[mockEngine createShell:@"" libraryURI:@"" initialRoute:nil];
FlutterViewController* viewController = [[FlutterViewController alloc] initWithEngine:mockEngine
nibName:nil
bundle:nil];
id viewControllerMock = OCMPartialMock(viewController);
OCMStub([viewControllerMock goToApplicationLifecycle:@"AppLifecycleState.detached"]);
OCMStub([mockEngine destroyContext]);
[viewController applicationWillTerminate:nil];
OCMVerify([viewControllerMock goToApplicationLifecycle:@"AppLifecycleState.detached"]);
OCMVerify([mockEngine destroyContext]);
}

- (void)testViewDidDisappearDoesPauseEngineWhenIsTheViewController {
id lifecycleChannel = OCMClassMock([FlutterBasicMessageChannel class]);
FlutterEnginePartialMock* mockEngine = [[FlutterEnginePartialMock alloc] init];
Expand Down