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

Unified Diff: pkg/unittest/lib/compact_vm_config.dart

Issue 19557003: Make the compact VM config keep open a receive port. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/compact_vm_config.dart
diff --git a/pkg/unittest/lib/compact_vm_config.dart b/pkg/unittest/lib/compact_vm_config.dart
index b2bbc59bad43a9f19ac83b7deeaf2b2d2375dc8c..64b2021a627c0178e39a403f79b20e0fccbf82fb 100644
--- a/pkg/unittest/lib/compact_vm_config.dart
+++ b/pkg/unittest/lib/compact_vm_config.dart
@@ -12,6 +12,7 @@ library compact_vm_config;
import 'dart:async';
import 'dart:io';
+import 'dart:isolate';
import 'unittest.dart';
import 'vm_config.dart';
@@ -23,11 +24,16 @@ const String _NONE = '\u001b[0m';
const int MAX_LINE = 80;
class CompactVMConfiguration extends VMConfiguration {
+ // The VM won't shut down if a receive port is open. Use this to make sure
+ // we correctly wait for asynchronous tests.
+ ReceivePort _receivePort;
+
DateTime _start;
int _pass = 0;
int _fail = 0;
void onInit() {
+ _receivePort = new ReceivePort();
// Override and don't call the superclass onInit() to avoid printing the
// "unittest-suite-..." boilerplate.
}
@@ -64,6 +70,7 @@ class CompactVMConfiguration extends VMConfiguration {
// Override and don't call the superclass onDone() to avoid printing the
// "unittest-suite-..." boilerplate.
Future.wait([stdout.close(), stderr.close()]).then((_) {
+ _receivePort.close();
exit(success ? 0 : 1);
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698