flutter/packages
Bruno Leroux 471a82856d
[flutter_test] Use defaultTargetPlatform for key events simulation (#143579)
## Description

This PRs changes the default value for the `platform` parameter used to simulate key events.

With this PR, the default value is "web" on web, otherwise it is the operating system name retrieved from `defaultTargetPlatform`.

Previously, for methods in `WidgetController`, it defaulted to “web” on web, and “android” everywhere else. And for methods in `KeyEventSimulator` it defaulted to “web” on web, and the operating system that the test was running on everywhere else. Because the operating system was based on `Platform.operatingSystem`, it usually differed from the target platform the test was running on.

AFAIK, the `platform` parameter is only meaningful for simulating `RawKeyEvent`. Once `RawKeyboard` will be fully removed, the `platform` parameter won’t be needed. 
@gspencergoog  In the meantime, do you think it is worth merging this fix?

## Related Issue

Fixes to https://github.com/flutter/flutter/issues/133955

## Tests

Adds one test.
2024-03-07 16:08:20 +00:00
..
flutter [flutter_test] Change KeyEventSimulator default transit mode (#143847) 2024-03-07 07:19:26 +00:00
flutter_driver [Impeller] measure GPU memory usage. (#144575) 2024-03-06 20:17:31 +00:00
flutter_goldens Fix Small Typo in Skia_Client Doc Comment (#144490) 2024-03-04 18:24:13 +00:00
flutter_localizations CalendarDatePicker doesn't announce selected date on desktop (#143583) 2024-02-21 08:59:24 +00:00
flutter_test [flutter_test] Use defaultTargetPlatform for key events simulation (#143579) 2024-03-07 16:08:20 +00:00
flutter_tools Fix frameworks added to bundle multiple times instead of lipo (#144688) 2024-03-07 15:09:15 +00:00
flutter_web_plugins Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
fuchsia_remote_debug_protocol Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
integration_test Use robolectric/AndroidJUnit4 for integration test tests (#144348) 2024-02-29 00:57:24 +00:00
analysis_options.yaml Unify analysis options (#108462) 2022-07-28 09:07:49 -07:00