replace const Duration() with Duration.ZERO (#8835)

This commit is contained in:
Alexandre Ardhuin 2017-03-17 08:04:48 +01:00 committed by GitHub
parent 6cd552fe69
commit 90aa2957fe
3 changed files with 5 additions and 5 deletions

View File

@ -53,12 +53,12 @@ class TestServiceExtensionsBinding extends BindingBase
void doFrame() {
frameScheduled = false;
if (ui.window.onBeginFrame != null)
ui.window.onBeginFrame(const Duration());
ui.window.onBeginFrame(Duration.ZERO);
}
Future<Null> flushMicrotasks() {
final Completer<Null> completer = new Completer<Null>();
new Timer(const Duration(), completer.complete);
Timer.run(completer.complete);
return completer.future;
}
}

View File

@ -101,8 +101,8 @@ void main() {
);
final List<dynamic> events = await channel.receiveBroadcastStream('hello').toList();
expect(events, orderedEquals(<String>['hello1', 'hello2']));
await new Future<Null>.delayed(const Duration());
await new Future<Null>.delayed(Duration.ZERO);
expect(cancelled, isTrue);
});
});
}
}

View File

@ -255,7 +255,7 @@ void main() {
}
Future<Null> eventFiring(WidgetTester tester) async {
await tester.pump(const Duration());
await tester.pump(Duration.ZERO);
}
class StringCollector extends StreamBuilderBase<String, List<String>> {