Commit 90aa2957 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

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

parent 6cd552fe
...@@ -53,12 +53,12 @@ class TestServiceExtensionsBinding extends BindingBase ...@@ -53,12 +53,12 @@ class TestServiceExtensionsBinding extends BindingBase
void doFrame() { void doFrame() {
frameScheduled = false; frameScheduled = false;
if (ui.window.onBeginFrame != null) if (ui.window.onBeginFrame != null)
ui.window.onBeginFrame(const Duration()); ui.window.onBeginFrame(Duration.ZERO);
} }
Future<Null> flushMicrotasks() { Future<Null> flushMicrotasks() {
final Completer<Null> completer = new Completer<Null>(); final Completer<Null> completer = new Completer<Null>();
new Timer(const Duration(), completer.complete); Timer.run(completer.complete);
return completer.future; return completer.future;
} }
} }
......
...@@ -101,8 +101,8 @@ void main() { ...@@ -101,8 +101,8 @@ void main() {
); );
final List<dynamic> events = await channel.receiveBroadcastStream('hello').toList(); final List<dynamic> events = await channel.receiveBroadcastStream('hello').toList();
expect(events, orderedEquals(<String>['hello1', 'hello2'])); expect(events, orderedEquals(<String>['hello1', 'hello2']));
await new Future<Null>.delayed(const Duration()); await new Future<Null>.delayed(Duration.ZERO);
expect(cancelled, isTrue); expect(cancelled, isTrue);
}); });
}); });
} }
\ No newline at end of file
...@@ -255,7 +255,7 @@ void main() { ...@@ -255,7 +255,7 @@ void main() {
} }
Future<Null> eventFiring(WidgetTester tester) async { Future<Null> eventFiring(WidgetTester tester) async {
await tester.pump(const Duration()); await tester.pump(Duration.ZERO);
} }
class StringCollector extends StreamBuilderBase<String, List<String>> { class StringCollector extends StreamBuilderBase<String, List<String>> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment