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

Unified Diff: tools/testing/dart/test_suite.dart

Issue 11270032: Fix CCTestSuite in test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 0b9c8fd5f3fb02361f494ea4c6f731d75b38ea8e..99c0e959383da72adeed0e2d1f7efd3ba912a705 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -65,28 +65,32 @@ bool Contains(element, collection) => collection.indexOf(element) >= 0;
void ccTestLister() {
port.receive((String runnerPath, SendPort replyTo) {
- void processErrorHandler(error) {
- }
Future processFuture = Process.start(runnerPath, ["--list"]);
processFuture.then((p) {
StringInputStream stdoutStream = new StringInputStream(p.stdout);
- List<String> tests = new List<String>();
+ var streamDone = false;
+ var processExited = false;
+ checkDone() {
+ if (streamDone && processExited) {
+ replyTo.send("");
+ }
+ }
stdoutStream.onLine = () {
String line = stdoutStream.readLine();
- while (line != null) {
- tests.add(line);
- line = stdoutStream.readLine();
- }
+ replyTo.send(line);
+ };
+ stdoutStream.onClosed = () {
+ streamDone = true;
+ checkDone();
};
p.onExit = (code) {
if (code < 0) {
print("Failed to list tests: $runnerPath --list");
replyTo.send("");
+ } else {
+ processExited = true;
+ checkDone();
}
- for (String test in tests) {
- replyTo.send(test);
- }
- replyTo.send("");
};
port.close();
});
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698