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

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

Issue 11091070: Change Process.start to return a future that completes with a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Restructure to get rid of _onStart and _onError 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 | « tools/testing/dart/test_runner.dart ('k') | utils/pub/io.dart » ('j') | 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 3ada3b77161286aaa3352734c6e8bfd3bbba3b38..3e2d725917e7866862bc15d34e2d98e143c28891 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -65,31 +65,36 @@ bool Contains(element, collection) => collection.indexOf(element) >= 0;
void ccTestLister() {
port.receive((String runnerPath, SendPort replyTo) {
- var p = Process.start(runnerPath, ["--list"]);
- StringInputStream stdoutStream = new StringInputStream(p.stdout);
- List<String> tests = new List<String>();
- stdoutStream.onLine = () {
- String line = stdoutStream.readLine();
- while (line != null) {
- tests.add(line);
- line = stdoutStream.readLine();
- }
- };
- p.onError = (error) {
- print("Failed to list tests: $runnerPath --list");
- replyTo.send("");
- };
- p.onExit = (code) {
- if (code < 0) {
- print("Failed to list tests: $runnerPath --list");
+ void processErrorHandler(error) {
+ }
+ Future processFuture = Process.start(runnerPath, ["--list"]);
+ processFuture.then((p) {
+ StringInputStream stdoutStream = new StringInputStream(p.stdout);
+ List<String> tests = new List<String>();
+ stdoutStream.onLine = () {
+ String line = stdoutStream.readLine();
+ while (line != null) {
+ tests.add(line);
+ line = stdoutStream.readLine();
+ }
+ };
+ p.onExit = (code) {
+ if (code < 0) {
+ print("Failed to list tests: $runnerPath --list");
+ replyTo.send("");
+ }
+ for (String test in tests) {
+ replyTo.send(test);
+ }
replyTo.send("");
- }
- for (String test in tests) {
- replyTo.send(test);
- }
+ };
+ port.close();
+ });
+ processFuture.handleException((e) {
+ print("Failed to list tests: $runnerPath --list");
replyTo.send("");
- };
- port.close();
+ return true;
+ });
});
}
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698