| 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();
|
| });
|
|
|