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

Unified Diff: tests/standalone/io/process_broken_pipe_test.dart

Issue 11343009: Get rid of 'close' on process. It is very easy to use incorrectly and cut off data from your stream… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. 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 e56ab14a9d54f6b916fc16720dbbe8b8f81e0d4e..611f85036e0d407f750d61004525827c0ab31e38 100644
--- a/tests/standalone/io/process_broken_pipe_test.dart
+++ b/tests/standalone/io/process_broken_pipe_test.dart
@@ -15,11 +15,14 @@ main() {
// Ignore error on stdin.
process.stdin.onError = (e) => null;
+ // Drain stdout and stderr.
+ process.stdout.onData = () => process.stdout.read();
+ process.stderr.onData = () => process.stderr.read();
+
// 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();
};
});
}
« no previous file with comments | « tests/standalone/io/dart_std_io_pipe_test.dart ('k') | tests/standalone/io/process_check_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698