flutter/packages/flutter_test/test
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
..
bindings_environment add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
custom_exception_reporter Enable use_function_type_syntax_for_parameters lint (#77163) 2021-03-04 08:59:17 -08:00
semantics_checker Stand-alone widget tree with multiple render trees to enable multi-view rendering (#125003) 2023-07-17 16:14:08 +00:00
test_config Enable private field promotion for other packages (#134475) 2023-09-12 21:08:19 +00:00
utils Improve testing for leak tracking. (#140553) 2024-01-10 11:04:28 -08:00
accessibility_test.dart Reland "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2" (#144273) 2024-02-28 13:55:50 -08:00
accessibility_window_test.dart Remvoe last few references to window singleton (#122644) 2023-03-15 00:34:34 +00:00
all_elements_test.dart reland List queue search optimization (#68214) 2020-10-15 13:46:50 -07:00
analysis_options.yaml Enable more lints (#91642) 2021-10-14 22:03:03 -07:00
bindings_async_gap_test.dart Make FlutterErrorDetails.exception non-nullable as documented (#67364) 2020-10-05 18:07:02 -07:00
bindings_reset_test.dart TestWidgetsFlutterBinding should dispose old RestorationManager on reset. (#133999) 2023-09-07 17:49:33 -07:00
bindings_restoration_test.dart Properly initialize RestorationManager in the TestBinding (#70398) 2020-11-12 13:59:05 -08:00
bindings_test.dart Updates AutomatedTestWidgetsFlutterBinding.pump to support microsecond precision (#132401) 2023-08-14 23:24:47 +00:00
bindings_test_failure.dart Migrate the tests of flutter_test to null-safety (#67058) 2020-10-01 16:27:02 -07:00
controller_test.dart Reland [a11y] Add isEnabled semantics flag to text field (#143601) 2024-02-27 22:49:13 +00:00
coordinate_translation_test.dart Remove LiveTestRenderView (#127882) 2023-06-02 20:41:05 +00:00
demangle_test.dart Migrate the tests of flutter_test to null-safety (#67058) 2020-10-01 16:27:02 -07:00
display_test.dart Adds TestDisplay API for testing Display features (#127525) 2023-05-26 00:04:05 +00:00
event_simulation_test.dart [flutter_test] Use defaultTargetPlatform for key events simulation (#143579) 2024-03-07 16:08:20 +00:00
finders_test.dart Reland find.textRange.ofSubstring changes (#140469) 2023-12-20 22:00:55 +00:00
frame_timing_summarizer_test.dart [flutter_test] Fix incorrect missed budget count (#95003) 2021-12-10 18:44:11 -08:00
goldens_test.dart Fix: performance improvement on golden test comparison (#142913) 2024-02-09 22:05:00 +00:00
integration_bindings_test.dart Migrate the tests of flutter_test to null-safety (#67058) 2020-10-01 16:27:02 -07:00
live_binding_test.dart Remvoe last few references to window singleton (#122644) 2023-03-15 00:34:34 +00:00
live_widget_controller_test.dart Assert that runApp is called in the same zone as binding.ensureInitialized (#122836) 2023-03-16 22:33:09 +00:00
matchers_test.dart Add accessibility identifier to SemanticsProperties (#138331) 2023-12-11 18:03:07 +00:00
mock_canvas_test.dart Move mock canvas to flutter_test (#131631) 2023-08-07 23:43:03 +00:00
multi_view_accessibility_test.dart Relands "Add runWidget to bootstrap a widget tree without a default View" (#142344) 2024-01-26 23:05:53 +00:00
multi_view_controller_test.dart Fix SemanticsFinder for multi-view (#143485) 2024-02-16 22:24:55 +00:00
multi_view_testing.dart Prepare for dynamically sized views - pt. 2 (#139079) 2023-11-27 19:06:00 +00:00
platform_dispatcher_test.dart Add viewId to PointerEvents (#128287) 2023-06-06 19:16:02 -07:00
reference_image_test.dart Remove usage of testWidgetsWithLeakTracking. (#140239) 2023-12-15 14:13:31 -08:00
restoration_test.dart Prepare packages (minus tools,framework) for use_super_parameters (#100510) 2022-03-30 15:31:59 -07:00
semantics_finder_test.dart Fix SemanticsFinder for multi-view (#143485) 2024-02-16 22:24:55 +00:00
stack_manipulation_test.dart Enable only_throw_errors (#91567) 2021-10-11 14:13:03 -07:00
test_async_utils_test.dart Remove uses of deprecated test_api imports (#124732) 2023-04-20 20:55:28 +00:00
test_default_binary_messenger_test.dart [flutter_test] Adds method to mock EventChannels (#124415) 2023-04-10 17:02:48 +00:00
test_text_input_test.dart Add deleteBackwardByDecomposingPreviousCharacter mapping for tests (#132919) 2023-08-21 23:27:19 +00:00
view_test.dart Reapply "Dynamic view sizing" (#140165) (#140918) 2024-01-09 14:10:43 -08:00
widget_tester_leaks_test.dart Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
widget_tester_live_device_test.dart cleanup now-irrelevant ignores for deprecated_member_use (#143403) 2024-02-14 21:08:25 +00:00
widget_tester_test.dart Fix implementation imports outside of lib (#143594) 2024-02-16 22:38:10 +00:00
window_test.dart cleanup now-irrelevant ignores for deprecated_member_use (#143403) 2024-02-14 21:08:25 +00:00