Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow setting of TestWidgetsFlutterBinding.pointerEventSource #107976

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

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

HelioStrike
Copy link
Contributor

@HelioStrike HelioStrike commented Jul 20, 2022

Solves #107934.

This PR allows setting of TestWidgetsFlutterBinding.pointerEventSource.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Jul 20, 2022
@flutter-dashboard
Copy link

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 (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

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

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

Please add a test.

/cc @goderbauer fyi

@HelioStrike HelioStrike force-pushed the set_pointereventsource branch from 3cd7e05 to acf6bf0 Compare July 20, 2022 00:15
@HelioStrike
Copy link
Contributor Author

@dnfield Hey Dan! I added a test that pretty much checks that the value can be set. Is that alright?

@HelioStrike HelioStrike force-pushed the set_pointereventsource branch from acf6bf0 to 33935b9 Compare July 20, 2022 01:03
@HelioStrike
Copy link
Contributor Author

Also cc @jiahaog

@dnfield
Copy link
Contributor

dnfield commented Jul 20, 2022

Going to revert this - @goderbauer says hes' going to add some valid concerns we discussed offline.

@goderbauer
Copy link
Member

I would have expected that customers would create their own binding subclass here with a feature like that and use those in the test (at least as a one-off until we implement a proper solution for this).

The change as it stands is currently making it too easy to leak state between tests. It is also missing proper documentation around what it means to change this property. The whole API seems easy to miss-use as designed.

Furthermore, to fully fix the original problem we should think about what we can do to properly recognize pointer events coming from adb to have those actually drive the test instead of hacking into the pointer event handling of the test framework.

camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants