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

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

Issue 890633002: Add an option for starting a detached process with stdio connected (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 5 years, 11 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 | « sdk/lib/io/process.dart ('k') | tests/standalone/io/process_detached_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/process_detached_script.dart
diff --git a/tests/standalone/io/process_detached_script.dart b/tests/standalone/io/process_detached_script.dart
index 122831b433b2d6ef75f6b028643abc49ca0db6ef..6e90759881c563bfbabc8af6be50fcc9475f646b 100644
--- a/tests/standalone/io/process_detached_script.dart
+++ b/tests/standalone/io/process_detached_script.dart
@@ -4,8 +4,19 @@
//
// Simple script hanging for testing a detached process.
+import 'dart:io';
import 'dart:isolate';
-main() {
+void main(List<String> args) {
new ReceivePort().listen(print);
+
+ // If an argument 'echo' is passed echo stdin to stdout and stderr.
+ if (args.length == 1 && args[0] == 'echo') {
+ stdin.fold([], (p, e) => p..addAll(e)).then((message) {
+ stdout.add(message);
+ stderr.add(message);
+ stdout.close();
+ stderr.close();
+ });
+ }
}
« no previous file with comments | « sdk/lib/io/process.dart ('k') | tests/standalone/io/process_detached_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698