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

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

Issue 1196413003: Add a LoadSuite class. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 6 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 | « no previous file | lib/src/executable.dart » ('j') | lib/src/runner/load_suite.dart » ('J')
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 0e13d789b32069ca1a40717017f3a492e4181fda..fce4089aeb8d63f0d43fdc5486ac1a9f22c871f1 100644
--- a/lib/src/backend/invoker.dart
+++ b/lib/src/backend/invoker.dart
@@ -68,8 +68,11 @@ class Invoker {
/// Once the test is closed, [expect] and [expectAsync] will throw
/// [ClosedException]s whenever accessed to help the test stop executing as
/// soon as possible.
- bool get closed => _closed;
- bool _closed = false;
+ bool get closed => _onCloseCompleter.isCompleted;
+
+ /// A future that completes once the test has been closed.
+ Future get onClose => _onCloseCompleter.future;
+ final _onCloseCompleter = new Completer();
/// The test being run.
LocalTest get _test => liveTest.test as LocalTest;
@@ -100,9 +103,8 @@ class Invoker {
Invoker._(Suite suite, LocalTest test)
: metadata = suite.metadata.merge(test.metadata) {
- _controller = new LiveTestController(suite, test, _onRun, () {
- _closed = true;
- });
+ _controller = new LiveTestController(
+ suite, test, _onRun, _onCloseCompleter.complete);
}
/// Tells the invoker that there's a callback running that it should wait for
« no previous file with comments | « no previous file | lib/src/executable.dart » ('j') | lib/src/runner/load_suite.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698