flutter/dev/integration_tests/android_views
gmackall d1eb1f0a57
Upgrade integration tests to use AGP 7.3/Gradle 7.4 (#129642)
Upgrades tests under `dev/integration_tests` to use the latest values [in the templates](944d6c8fef/dev/tools/bin/generate_gradle_lockfiles.dart (L135)). Most of this PR was auto-generated, by running `find dev/integration_tests/ -type d -name 'android' | dart dev/tools/bin/generate_gradle_lockfiles.dart` from the root of the flutter directory.

The pieces that were not are:
1. Upgrading the Gradle versions used in integration tests to be >=7.4, in places where it was currently lower.
2. Upgrading the mac, windows, and linux build_tests .ci.yaml configuration to use jdk 17 on all shards. It currently was using a mix of 17 and 11. This isn't desirable, because some of the tests require 17, and the distribution is [random across shards](cef9a8c54b/dev/bots/test.dart (L553)) (so they were only passing because they were getting randomly placed on shards using jdk 17).
3. Adding a dependency on jdk 11 for the tests based on the `firebaselab/firebaselab` recipe. Previously they had no java dependency, and were therefore defaulting to java 1.8. The newer AGP versions necessitated an upgrade to 11 to run.

Note that it also ended up downgrading the AGP version in two places (in the [hybrid_android_views](https://github.com/flutter/flutter/pull/129642/files#diff-d7cfaa1c96d5c2383e7fc253ac8c9df062b544c24f7d80aa8a02290c01d17205L17) and [platform_interaction](https://github.com/flutter/flutter/pull/129642/files#diff-b2fba811efadd1cfb097bebd93be99fe4b6d6f17aefa863267290fc704290766L17) tests), because those had been manually edited to a newer version than the template.

Related to: https://github.com/flutter/flutter/issues/123636, https://github.com/flutter/flutter/pull/123910
2023-06-30 19:34:20 +00:00
..
android Upgrade integration tests to use AGP 7.3/Gradle 7.4 (#129642) 2023-06-30 19:34:20 +00:00
lib Add spaces after flow control statements (#126320) 2023-05-15 11:07:30 +02:00
test_driver Use runUnsynchronized for android_views test (#99311) 2022-02-28 23:31:20 -08:00
.metadata
pubspec.yaml Unpin path_provider_android (#129205) 2023-06-22 21:22:49 +00:00
README.md ✒ Spell Check All .md Files Related to Flutter 💙 (#61564) 2020-07-22 18:23:47 -07:00

Integration test for touch events on embedded Android views

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.