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

Unified Diff: tests/standalone/src/ProcessBrokenPipe.dart

Issue 8662006: Fix a number of issues with the process handling (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 9 years, 1 month 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/bin/socket_stream.dart ('k') | tests/standalone/src/ProcessStdIOScript.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/ProcessBrokenPipe.dart
diff --git a/tests/standalone/src/ProcessBrokenPipe.dart b/tests/standalone/src/ProcessBrokenPipe.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3c6510fddea6a55c28cb31ceaaac8f18ec294a7e
--- /dev/null
+++ b/tests/standalone/src/ProcessBrokenPipe.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Process test program to test closed stdin from child process.
+
+#source("ProcessTestUtil.dart");
+
+main() {
+ // Running dart without arguments makes it close right away.
+ Process process = new Process(getDartBinFileName(), []);
+
+ // Write to the stdin after the process is terminated to test
+ // writing to a broken pipe.
+ OutputStream output = process.stdin;
+ process.exitHandler = (code) {
+ Expect.isFalse(output.write([0]));
+ process.close();
+ };
+
+ process.start();
+}
« no previous file with comments | « runtime/bin/socket_stream.dart ('k') | tests/standalone/src/ProcessStdIOScript.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698