-
Notifications
You must be signed in to change notification settings - Fork 29.7k
added new lifecycle state #39945
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
added new lifecycle state #39945
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. While there are exceptions to this rule, if this patch modifies code it is probably not an exception. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
LGTM otherwise |
08b2540 to
2d6a900
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remind myself need to remove local engine once engine change is in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmagman I copy the test from ios_add2app
The test is using XCTestCase to launch the app, and use tap a native button so that it will bring up a flutter view controller. The assertion is in dart side. Is there a way for dart code to notify the engine that the app has crashed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I just saw this. I'm not sure now a dart assert expresses itself in an iOS process... does the app not crash, it just goes white or something?
126cdba to
1308129
Compare
|
ready for review, Added integration test ios_add2app_life_cycle On the Native test side, it will initialize engine and bring up flutterviewcontroller. After that, it will be waiting to receive semantics update with a time out of 30 seconds. If the flutter app does not receive correct life cycle sequence (detached -> inactive -> resumed), it will never rewire the semantics hook. The native app will timeout after 30 seconds and fail the test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this scheme and add ios_add2appTests to ios_add2app.xcscheme's tests. Then the test command becomes:
set -o pipefail && xcodebuild \
-workspace ios_add2app.xcworkspace \
-scheme ios_add2app \
-sdk "iphonesimulator$os_version" \
-destination "OS=$os_version,name=iPhone X" test | $PRETTY(I know you copied this pattern from the add2app tests, I've been meaning to change it there, too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got error 'Scheme ios_add2app is not currently configured for the test action'. do you mean the other way around? deleting ios_add2app and only keep iod_add2appTests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to override the getter, you can remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set with the property setters, not the backing instance variables here so the KVO notifications get posted correctly.
self.mainViewController = ...
self.navigationController = ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readonly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this wrapper method necessary? Can -showFullScreenCold grab what it needs from the AppDelegate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm not familiar with the message channel patterns, is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the relative paths.
#import "AppDelegate.h"
#import "FullScreenViewController.h"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you seeing memory bloat here? I would imagine the pool drains between tests but I don't know.
dev/integration_tests/ios_add2app_life_cycle/ios_add2app/MainViewController.m
Outdated
Show resolved
Hide resolved
|
@jmagman addressed all comments, ready for review |
Codecov Report
@@ Coverage Diff @@
## master #39945 +/- ##
==========================================
- Coverage 62.21% 58.7% -3.52%
==========================================
Files 199 194 -5
Lines 19234 18977 -257
==========================================
- Hits 11966 11140 -826
- Misses 7268 7837 +569
Continue to review full report at Codecov.
|
dev/integration_tests/ios_add2app_life_cycle/ios_add2app/AppDelegate.m
Outdated
Show resolved
Hide resolved
dev/integration_tests/ios_add2app_life_cycle/ios_add2app/MainViewController.h
Outdated
Show resolved
Hide resolved
dev/integration_tests/ios_add2app_life_cycle/ios_add2app/MainViewController.m
Outdated
Show resolved
Hide resolved
dev/integration_tests/ios_add2app_life_cycle/ios_add2appTests/IntegrationTests.m
Outdated
Show resolved
Hide resolved
dev/integration_tests/ios_add2app_life_cycle/ios_add2app/AppDelegate.m
Outdated
Show resolved
Hide resolved
dev/integration_tests/ios_add2app_life_cycle/ios_add2app/MainViewController.m
Outdated
Show resolved
Hide resolved
|
@jmagman All comments addressed, thanks! |
jmagman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for all the updates! LGTM with nit.
dev/integration_tests/ios_add2app_life_cycle/ios_add2appTests/IntegrationTests.m
Outdated
Show resolved
Hide resolved
|
(PR triage): @chunhtai what's the status of this one? |
|
@goderbauer |
c726b45 to
c58e45d
Compare
14b3649 to
ac9874a
Compare
|
You're going to land this one soon to match flutter/engine#13642 right? |
yes, I am waiting for luci build to finish before i can tag the sha |
|
understood. Thanks |
5c125d4 to
e1ff1b1
Compare
e1ff1b1 to
5fdfd15
Compare
|
\o/ |


Description
This pr is the framework counter part of flutter/engine#11913
Related Issues
#39832
Tests
I added the following tests:
Replace this with a list of the tests that you added as part of this PR. A change in behaviour with no test covering it
will likely get reverted accidentally sooner or later. PRs must include tests for all changed/updated/fixed behaviors. See Test Coverage.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?