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

Unified Diff: tests/standalone/io/process_broken_pipe_test.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: 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
Index: tests/standalone/io/process_broken_pipe_test.dart
diff --git a/tests/standalone/io/process_broken_pipe_test.dart b/tests/standalone/io/process_broken_pipe_test.dart
index 91cfdeac14e638bb88ed1772e6df3f636bee7008..e56ab14a9d54f6b916fc16720dbbe8b8f81e0d4e 100644
--- a/tests/standalone/io/process_broken_pipe_test.dart
+++ b/tests/standalone/io/process_broken_pipe_test.dart
@@ -10,15 +10,16 @@
main() {
// Running dart without arguments makes it close right away.
- Process process = Process.start(new Options().executable, []);
+ var future = Process.start(new Options().executable, []);
+ future.then((process) {
+ // Ignore error on stdin.
+ process.stdin.onError = (e) => null;
- // Ignore error on stdin.
- process.stdin.onError = (e) => null;
-
- // Write to the stdin after the process is terminated to test
- // writing to a broken pipe.
- process.onExit = (code) {
- Expect.isFalse(process.stdin.write([0]));
- process.close();
- };
+ // Write to the stdin after the process is terminated to test
+ // writing to a broken pipe.
+ process.onExit = (code) {
+ Expect.isFalse(process.stdin.write([0]));
+ process.close();
+ };
+ });
}

Powered by Google App Engine
This is Rietveld 408576698