Catch Stopwatch with static analysis (#140019)

I did not include the `'// flutter_ignore_for_file: stopwatch (see analyze.dart)'` directive since it's currently not used, and adding that shouldn't be too difficult.
This commit is contained in:
LongCatIsLooong
2023-12-13 16:31:49 -08:00
committed by GitHub
parent 4162272592
commit f2c6f03ca3
10 changed files with 312 additions and 120 deletions

View File

@@ -47,7 +47,8 @@ class TestSamplingClock implements SamplingClock {
DateTime now() => clock.now();
@override
Stopwatch stopwatch() => clock.stopwatch();
Stopwatch stopwatch() => clock.stopwatch(); // flutter_ignore: stopwatch (see analyze.dart)
// Ignore context: FakeAsync controls clock.stopwatch(), this is safe in tests.
}
typedef ResampleEventTest = void Function(FakeAsync async);