flutter/dev/integration_tests/hybrid_android_views
Jacob MacDonald 193fe3e980
Update null safe deps to prepare for the 2.12 sdk version (#69041)
* update pinned null safety deps

* run update-packages

* add http dep to devicelab package

* rerun update-packages
2020-10-26 14:31:13 -07:00
..
android move compile/target sdk versions to 29 (#62799) (#63008) 2020-08-11 14:51:02 -07:00
lib Migrate Scaffold SnackBars in the framework to ScaffoldMessenger (#67946) 2020-10-14 13:12:03 -07:00
test_driver Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -07:00
pubspec.yaml Update null safe deps to prepare for the 2.12 sdk version (#69041) 2020-10-26 14:31:13 -07:00
README.md Android views using hybrid composition e2e driver test (#61507) 2020-07-16 16:19:49 -07:00

Integration test for hybrid composition on Android

This test verifies that the synthesized motion events that get to embedded Android view are equal to the motion events that originally hit the FlutterView.

The test app's Android code listens to MotionEvents that get to FlutterView and to an embedded Android view and sends them over a platform channel to the Dart code where the events are matched.

This is what the app looks like:

android_views test app

The blue part is the embedded Android view, because it is positioned at the top left corner, the coordinate systems for FlutterView and for the embedded view's virtual display has the same origin (this makes the MotionEvent comparison easier as we don't need to translate the coordinates).

The app includes the following control buttons:

  • RECORD - Start listening for MotionEvents for 3 seconds, matched/unmatched events are displayed in the listview as they arrive.
  • CLEAR - Clears the events that were recorded so far.
  • SAVE - Saves the events that hit FlutterView to a file.
  • PLAY FILE - Send a list of events from a bundled asset file to FlutterView.

A recorded touch events sequence is bundled as an asset in the assets_for_android_view package which lives in the goldens repository.

When running this test with flutter drive the record touch sequences is replayed and the test asserts that the events that got to FlutterView are equivalent to the ones that got to the embedded view.