blob: a68a800b2afbd1e8d78498c27766998d6d937c78 [file] [log] [blame]
// 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.
// OtherResources=regress_7191_script.dart
// Regression test for
// Starts a sub-process which in turn starts another sub-process and then closes
// its standard output. If handles are incorrectly inherited on Windows, this
// will lead to a situation where the stdout of the first sub-process is never
// closed which will make this test hang.
import 'dart:io';
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
import 'package:path/path.dart';
main() {
var executable = Platform.executable;
var script = Platform.script.resolve('regress_7191_script.dart').toFilePath();
Process.start(executable, [script]).then((process) {
process.stdout.listen((_) {}, onDone: () {
process.stderr.listen((_) {});
process.exitCode.then((exitCode) {
if (exitCode != 0) throw "Bad exit code";