• Bruno Leroux's avatar
    [flutter_test] Use defaultTargetPlatform for key events simulation (#143579) · 471a8285
    Bruno Leroux authored
    ## 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.
    471a8285
Name
Last commit
Last update
..
bindings_environment Loading commit data...
custom_exception_reporter Loading commit data...
semantics_checker Loading commit data...
test_config Loading commit data...
utils Loading commit data...
accessibility_test.dart Loading commit data...
accessibility_window_test.dart Loading commit data...
all_elements_test.dart Loading commit data...
analysis_options.yaml Loading commit data...
bindings_async_gap_test.dart Loading commit data...
bindings_reset_test.dart Loading commit data...
bindings_restoration_test.dart Loading commit data...
bindings_test.dart Loading commit data...
bindings_test_failure.dart Loading commit data...
controller_test.dart Loading commit data...
coordinate_translation_test.dart Loading commit data...
demangle_test.dart Loading commit data...
display_test.dart Loading commit data...
event_simulation_test.dart Loading commit data...
finders_test.dart Loading commit data...
frame_timing_summarizer_test.dart Loading commit data...
goldens_test.dart Loading commit data...
integration_bindings_test.dart Loading commit data...
live_binding_test.dart Loading commit data...
live_widget_controller_test.dart Loading commit data...
matchers_test.dart Loading commit data...
mock_canvas_test.dart Loading commit data...
multi_view_accessibility_test.dart Loading commit data...
multi_view_controller_test.dart Loading commit data...
multi_view_testing.dart Loading commit data...
platform_dispatcher_test.dart Loading commit data...
reference_image_test.dart Loading commit data...
restoration_test.dart Loading commit data...
semantics_finder_test.dart Loading commit data...
stack_manipulation_test.dart Loading commit data...
test_async_utils_test.dart Loading commit data...
test_default_binary_messenger_test.dart Loading commit data...
test_text_input_test.dart Loading commit data...
view_test.dart Loading commit data...
widget_tester_leaks_test.dart Loading commit data...
widget_tester_live_device_test.dart Loading commit data...
widget_tester_test.dart Loading commit data...
window_test.dart Loading commit data...