Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Unified Diff: tests/lib/async/slow_consumer_test.dart

Issue 12213092: Rework Timer interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/async/slow_consumer3_test.dart ('k') | tests/standalone/io/http_auth_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/slow_consumer_test.dart
diff --git a/tests/lib/async/slow_consumer_test.dart b/tests/lib/async/slow_consumer_test.dart
index 027924eb393c0212dbd780bc2387049c82e3c646..dcc616714ad9d1dc449f2a42e54780daa5901cf9 100644
--- a/tests/lib/async/slow_consumer_test.dart
+++ b/tests/lib/async/slow_consumer_test.dart
@@ -50,7 +50,7 @@ class DataProvider {
DataProvider(int this.bytesPerSecond, int this.targetCount, this.chunkSize) {
controller = new StreamController(onPauseStateChange: onPauseStateChange);
- new Timer(0, (_) => send());
+ Timer.run(send);
}
Stream get stream => controller.stream;
@@ -69,7 +69,8 @@ class DataProvider {
}
controller.add(new List.fixedLength(listSize));
int ms = listSize * 1000 ~/ bytesPerSecond;
- if (!controller.isPaused) new Timer(ms, (_) => send());
+ Duration duration = new Duration(milliseconds: ms);
+ if (!controller.isPaused) new Timer(duration, send);
}
onPauseStateChange() {
« no previous file with comments | « tests/lib/async/slow_consumer3_test.dart ('k') | tests/standalone/io/http_auth_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698