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

Unified Diff: samples/third_party/dromaeo/tests/RunnerSuite.dart

Issue 12218131: Combine window.setTimeout/setInterval with Timer and Timer.repeating. Also (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: samples/third_party/dromaeo/tests/RunnerSuite.dart
diff --git a/samples/third_party/dromaeo/tests/RunnerSuite.dart b/samples/third_party/dromaeo/tests/RunnerSuite.dart
index f4d8c6fd2024d466f3f843e05005a84b98dd650d..86f9e9e182f7e6de39d1c8e7889813c3c85ac27d 100644
--- a/samples/third_party/dromaeo/tests/RunnerSuite.dart
+++ b/samples/third_party/dromaeo/tests/RunnerSuite.dart
@@ -51,7 +51,7 @@ class Suite {
// Run the test several times.
try {
- // TODO(antonm): use .setTimeout to schedule next run as JS
+ // TODO(antonm): use timer to schedule next run as JS
// version does. That allows to report the intermidiate results
// more smoothly as well.
for (int i = 0; i < _N_RUNS; i++) {
@@ -90,12 +90,12 @@ class Suite {
if (currentOperation < _operations.length) {
_operations[currentOperation]();
currentOperation++;
- _window.setTimeout(handler, 1);
+ new Timer(const Duration(milliseconds: 1), handler);
} else {
_postMessage('over');
}
}
- _window.setTimeout(handler, 0);
+ new Timer(const Duration(milliseconds: 1), handler);
blois 2013/02/13 03:09:24 Original had 0 rather than 1.
Emily Fortuna 2013/02/13 20:19:44 Done.
}
_reportTestResults(String name, Result result) {

Powered by Google App Engine
This is Rietveld 408576698