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

Unified Diff: lib/src/backend/invoker.dart

Issue 1887853002: Add a LiveSuite class. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 8 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 | « dart_test.yaml ('k') | lib/src/runner/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/invoker.dart
diff --git a/lib/src/backend/invoker.dart b/lib/src/backend/invoker.dart
index 0a0a31846fb34e740fac30b4687b26379dd9cff7..b93a801439004ff3ed0a31e5d4cbda19d77fb479 100644
--- a/lib/src/backend/invoker.dart
+++ b/lib/src/backend/invoker.dart
@@ -279,6 +279,9 @@ class Invoker {
// handled, we can end up with [onError] callbacks firing before the
// corresponding [onStateChange], which violates the timing
// guarantees.
+ //
+ // Using [new Future] also avoids starving the DOM or other
+ // microtask-level events.
new Future(_test._body)
.then((_) => removeOutstandingCallback());
@@ -288,9 +291,7 @@ class Invoker {
_controller.setState(
new State(Status.complete, liveTest.state.result));
- // Use [Timer.run] here to avoid starving the DOM or other
- // non-microtask events.
- Timer.run(_controller.completer.complete);
+ _controller.completer.complete();
}, zoneValues: {
#test.invoker: this,
// Use the invoker as a key so that multiple invokers can have different
« no previous file with comments | « dart_test.yaml ('k') | lib/src/runner/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698