engine
engine copied to clipboard
support embedder_id for pointer events in embedder API
This implements what has been proposed in https://github.com/flutter/flutter/issues/100680
Pre-launch Checklist
- [x] 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.
- [x] I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
- [x] I listed at least one issue that this PR fixes in the description above.
- [ ] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with
///). - [ ] I signed the CLA.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
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.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
For more information, open the CLA check for this pull request.
@hansihe Is this something you would be able to write a test for? We can't land PRs without tests.
@Hixie For sure, I would definitely be willing to write tests for this. I tried asking in the testing discord channel and in another issue for hints on how such a PR would be testable, but I haven't gotten any reply yet.
Do you have any tips here? I couldn't find any other tests in the repo that tests such things with the embedder API as a reference, but I might have overlooked something.
@Hixie Using https://github.com/flutter/flutter/issues/100680 as the main discussion area.
Any feedback on how a change like this could be tested would be much appreciated.
@hansihe I recommend asking in #hackers-new (I don't see your question in the #hackers-tests channel; you might be on a different server? There's a link in the contributing guidelines to the flutter team server.)
Testing guidance: See EmbedderTest::PlatformMessagesCanReceiveResponse for an instance of a test you can use for inspiration. You would send the pointer event with the custom message via FlutterEngineSendPointerEvent in native code. On the Dart side, set PlatformDispatcher.instance.onPointerDataPacket and send the embedder ID back down to the native code and run your gtest assertion there.
@hansihe Thanks for the contribution, I'm going to close this because it doesn't have tests but please don't hesitate to submit a new PR if you have the opportunity to write some!