| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Regression test for http://dartbug.com/7191. |
| 6 |
| 7 // Starts a sub-process which in turn starts another sub-process and then closes |
| 8 // its standard output. If handles are incorrectly inherited on Windows, this |
| 9 // will lead to a situation where the stdout of the first sub-process is never |
| 10 // closed which will make this test hang. |
| 11 |
| 12 import 'dart:io'; |
| 13 |
| 14 main() { |
| 15 var options = new Options(); |
| 16 var executable = options.executable; |
| 17 var scriptDir = new Path.fromNative(options.script).directoryPath; |
| 18 var script = scriptDir.append('regress_7191_script.dart').toNativePath(); |
| 19 Process.start(executable, [script]).then((process) { |
| 20 process.stdin.write([0]); |
| 21 process.stdout.onData = process.stdout.read; |
| 22 process.stderr.onData = process.stderr.read; |
| 23 process.stdout.onClosed = () { |
| 24 process.stdin.write([0]); |
| 25 }; |
| 26 }); |
| 27 } |
| OLD | NEW |