mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
Make Spinner test case use mockStopwatch (#43761)
This commit is contained in:
parent
50da3bd062
commit
9cb2047139
|
@ -90,6 +90,7 @@ void main() {
|
|||
|
||||
void doWhileAsync(FakeAsync time, bool doThis()) {
|
||||
do {
|
||||
mockStopwatch.elapsed += const Duration(milliseconds: 1);
|
||||
time.elapse(const Duration(milliseconds: 1));
|
||||
} while (doThis());
|
||||
}
|
||||
|
@ -97,6 +98,7 @@ void main() {
|
|||
for (String testOs in testPlatforms) {
|
||||
testUsingContext('AnsiSpinner works for $testOs (1)', () async {
|
||||
bool done = false;
|
||||
mockStopwatch = FakeStopwatch();
|
||||
FakeAsync().run((FakeAsync time) {
|
||||
final AnsiSpinner ansiSpinner = AnsiSpinner(
|
||||
timeout: const Duration(hours: 10),
|
||||
|
@ -129,6 +131,7 @@ void main() {
|
|||
}, overrides: <Type, Generator>{
|
||||
Platform: () => FakePlatform(operatingSystem: testOs),
|
||||
Stdio: () => mockStdio,
|
||||
Stopwatch: () => mockStopwatch,
|
||||
});
|
||||
|
||||
testUsingContext('AnsiSpinner works for $testOs (2)', () async {
|
||||
|
|
Loading…
Reference in a new issue