[Mouse] Remove all pointers at the end of tests#102694
Merged
fluttergithubbot merged 2 commits intoflutter:masterfrom May 20, 2022
Merged
[Mouse] Remove all pointers at the end of tests#102694fluttergithubbot merged 2 commits intoflutter:masterfrom
fluttergithubbot merged 2 commits intoflutter:masterfrom
Conversation
gspencergoog
approved these changes
May 4, 2022
Contributor
gspencergoog
left a comment
There was a problem hiding this comment.
This will allow code which adds a pointer as a side effect to pass when it isn't explicitly removed. I don't think we currently have any code that does that, so it's probably OK, but we should be aware that we're trading test coding convenience for this possibility.
@goderbauer what do you think?
Contributor
Author
|
Once added, mouse devices are typically not removed until the end of the app, so "a test scenario that adds a pointer and never removes it" is actually close enough to the real case. |
Contributor
|
This pull request is not suitable for automatic merging in its current state.
|
Contributor
|
This pull request is not suitable for automatic merging in its current state.
|
c62f92a to
47ac713
Compare
Contributor
|
This pull request is not suitable for automatic merging in its current state.
|
47ac713 to
992c2a0
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 20, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
May 21, 2022
camsim99
pushed a commit
to camsim99/flutter
that referenced
this pull request
Aug 10, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 30, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Aug 30, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR removes an assertion at the end of unit tests that ensures all mouse pointers have been removed. Instead, the
MouseTrackeris directly renewed without checking so.Moreover, this PR deleted all statements that remove mouse pointers at the of a test or schedule so. These changes are not really necessary, but are made nonetheless to verify that the change is safe.
This assertion (and subsequent pointer removal) was added in #32535 to solve an issue where mouse connection was leaked between tests. However this assertion doesn't feel needed for two reasons:
MouseTrackershould be enough to reset states, which has already been done.And it turns out that removing the code does not break any tests!
Moreover, this problem is also the cause for b/227634353: The developers have some tests for a web app that can be run in a real browser for debugging. And when they do, although these tests to not refer to mouse pointers at all, any movement of the real mouse will be captured by the tests, causing the test to throw for unremoved mouse pointers.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.