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

Unified Diff: pkg/unittest/lib/src/config.dart

Issue 11785026: Fixing unittest: ensure 'wait-until-done' is posted before we reach the end of (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « pkg/unittest/lib/html_enhanced_config.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/config.dart
diff --git a/pkg/unittest/lib/src/config.dart b/pkg/unittest/lib/src/config.dart
index 3bbd7c4cf15db9377265f158f689017665f8d2e0..e01d9335a679b773aa6bb15841da916fef4dbf07 100644
--- a/pkg/unittest/lib/src/config.dart
+++ b/pkg/unittest/lib/src/config.dart
@@ -33,19 +33,17 @@ class Configuration {
* Called as soon as the unittest framework becomes initialized. This is done
* even before tests are added to the test framework. It might be used to
* determine/debug errors that occur before the test harness starts executing.
+ * It is also used to tell the vm or browser that tests are going to be run
+ * asynchronously and that the process should wait until they are done.
*/
- void onInit() {}
-
- /**
- * Called as soon as the unittest framework starts running. Used commonly to
- * tell the vm or browser that tests are still running and the process should
- * wait until they are done.
- */
- void onStart() {
+ void onInit() {
_receivePort = new ReceivePort();
_postMessage('unittest-suite-wait-for-done');
}
+ /** Called as soon as the unittest framework starts running. */
+ void onStart() {}
+
/**
* Called when each test starts. Useful to show intermediate progress on
* a test suite.
@@ -129,10 +127,11 @@ class Configuration {
print('$passed PASSED, $failed FAILED, $errors ERRORS');
}
- _receivePort.close();
if (success) {
_postMessage('unittest-suite-success');
+ _receivePort.close();
} else {
+ _receivePort.close();
throw new Exception('Some tests failed.');
}
}
« no previous file with comments | « pkg/unittest/lib/html_enhanced_config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698