This extracts the sample code out from the API doc comments, and places them in separate files on disk, allowing running of the examples locally, testing them, and building of slightly larger examples.
Co-authored-by: Alexander Dahlberg <alexander.dahlberg@sigma.se>
This PR fixed the problem that prevented platform_channel_test.dart being shuffled. Part of #85160.
A couple of tests sets up callbacks through setMethodCallHandler() that gets unresolved and breaks other tests.
This PR clears those callbacks by passing null to setMethodCallHandler.
This PR fixed the problem that has prevented app_overrides_test.dart being shuffled. Part of #85160.
This test is testing WidgetsApp.showPerformanceOverlayOverride and WidgetsApp.debugAllowBannerOverride.
The problem: There was a strong dependecy to the default ordering of the tests. The value of showPerformanceOverlayOverride or debugAllowBannerOverride was expected to be the value that was set in previous test.
The fix: Make the values be set to default values after each test:
WidgetsApp.showPerformanceOverlayOverride=false
WidgetsApp.debugAllowBannerOverride=true
Set the expected value at the start of the test, if the default value is not expected.
Co-authored-by: Alexander Dahlberg <alexander.dahlberg@sigma.se>
This PR fixed the problem that has prevented scheduler_test.dart being shuffled. Part of #85160.
One test schedules a task, but events are locked so the scheduled task does not execute and this messes up other tests.
This PR adds a teardown that executes the scheduled task after the test, when events are unlocked.
Fixes test/painting/image_stream_test.dart of #85160
The problem: The timeDilation was changed to 2.0 but not restored. The changed timeDilation carried on to following tests which messed up some of them when using test ordering seed 456.
The Fix: Restore timeDilation to 1.0 at the end of test.
Fixes test/gestures/long_press_test.dart of #85160
The LongPressGestureRecognizer in test 'non-allowed pointer does not inadvertently reset the recognizer' was not disposed breaking a lot of other tests.