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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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 | « tests/standalone/io/regress_7097_test.dart ('k') | tests/standalone/io/regress_7191_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/regress_7191_script.dart
diff --git a/tests/standalone/io/regress_7191_script.dart b/tests/standalone/io/regress_7191_script.dart
index d90f0b544c29283b5bdd2e9bfcfe98e354707d41..1b047f16e295964aee2af1417934b9f23de39041 100644
--- a/tests/standalone/io/regress_7191_script.dart
+++ b/tests/standalone/io/regress_7191_script.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, 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.
@@ -9,22 +9,21 @@ main() {
// Open a port to make the script hang.
var port = new ReceivePort();
// Start sub-process when receiving data.
- stdin.onData = () {
- var data = stdin.read();
+ var subscription;
+ subscription = stdin.listen((data) {
var options = new Options();
Process.start(options.executable, [options.script]).then((p) {
- p.stdout.onData = p.stdout.read;
- p.stderr.onData = p.stderr.read;
+ p.stdout.listen((_) { });
+ p.stderr.listen((_) { });
// When receiving data again, kill sub-process and exit.
- stdin.onData = () {
- var data = stdin.read();
+ subscription.onData((data) {
Expect.listEquals([0], data);
p.kill();
- p.onExit = exit;
- };
+ p.exitCode.then(exit);
+ });
// Close stdout. If handles are incorrectly inherited this will
// not actually close stdout and the test will hang.
stdout.close();
});
- };
+ });
}
« no previous file with comments | « tests/standalone/io/regress_7097_test.dart ('k') | tests/standalone/io/regress_7191_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698