Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fixes UI freezes when multiple Flutter VC shared one engine#18816

Merged
gaaclarke merged 3 commits into
flutter-team-archive:masterfrom
zhongwuzw:fix_shared_engine_freezes
Jun 10, 2020
Merged

Fixes UI freezes when multiple Flutter VC shared one engine#18816
gaaclarke merged 3 commits into
flutter-team-archive:masterfrom
zhongwuzw:fix_shared_engine_freezes

Conversation

@zhongwuzw

Copy link
Copy Markdown
Contributor

Description

Assume we have two Tabs, A、B, both share the same engine, when we switch Tab from A to B, A's viewDidDisappear is called after B's viewWillAppear, so it break the surface creation.

Related Issues

flutter/flutter#39036 (comment)

Tests

Not yet.

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.

  • I read the contributor guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the C++, Objective-C, Java style guides for the engine.
  • I read the tree hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read handling breaking changes.

@fluttergithubbot

Copy link
Copy Markdown
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@auto-assign auto-assign Bot requested a review from cbracken June 4, 2020 07:35
@xster xster requested a review from gaaclarke June 4, 2020 08:47

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xster

xster commented Jun 4, 2020

Copy link
Copy Markdown
Contributor

Thanks for your contribution. Please see https://github.com/flutter/flutter/wiki/Testing-the-engine#objective-c---ios-embedding for how to add a test.

@zhongwuzw

Copy link
Copy Markdown
Contributor Author

@gaaclarke @xster Done.

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated your tests. If you add a negative test you should have a positive test too.

@xster xster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

OCMReject([viewControllerMock surfaceUpdated:[OCMArg any]]);
}

- (void)testViewDidDisappearDoesPauseEngine {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we tweak the names a bit? Sounds like we're testing for 2 different outcomes with the same conditions :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll follow up with a PR so we can land this now.

@gaaclarke gaaclarke merged commit 0e8f89c into flutter-team-archive:master Jun 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

5 participants