• 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
..
_binding_io.dart Loading commit data...
_binding_web.dart Loading commit data...
_goldens_io.dart Loading commit data...
_goldens_web.dart Loading commit data...
_matchers_io.dart Loading commit data...
_matchers_web.dart Loading commit data...
accessibility.dart Loading commit data...
animation_sheet.dart Loading commit data...
binding.dart Loading commit data...
controller.dart Loading commit data...
deprecated.dart Loading commit data...
event_simulation.dart Loading commit data...
finders.dart Loading commit data...
frame_timing_summarizer.dart Loading commit data...
goldens.dart Loading commit data...
image.dart Loading commit data...
matchers.dart Loading commit data...
mock_canvas.dart Loading commit data...
mock_event_channel.dart Loading commit data...
nonconst.dart Loading commit data...
platform.dart Loading commit data...
recording_canvas.dart Loading commit data...
restoration.dart Loading commit data...
stack_manipulation.dart Loading commit data...
test_async_utils.dart Loading commit data...
test_compat.dart Loading commit data...
test_default_binary_messenger.dart Loading commit data...
test_exception_reporter.dart Loading commit data...
test_pointer.dart Loading commit data...
test_text_input.dart Loading commit data...
test_text_input_key_handler.dart Loading commit data...
test_vsync.dart Loading commit data...
tree_traversal.dart Loading commit data...
widget_tester.dart Loading commit data...
window.dart Loading commit data...