| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013, 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 // Process test program to test process communication. |
| 6 |
| 7 import "package:expect/expect.dart"; |
| 8 import "dart:async"; |
| 9 import "dart:io"; |
| 10 import "dart:isolate"; |
| 11 |
| 12 main() { |
| 13 var port = new ReceivePort(); |
| 14 Expect.isTrue(pid > 0); |
| 15 var futures = []; |
| 16 futures.add(Process.start(new Options().executable,['--version'])); |
| 17 futures.add(Process.run(new Options().executable,['--version'])); |
| 18 Future.wait(futures).then((results) { |
| 19 Expect.isTrue(results[0].pid > 0); |
| 20 Expect.isTrue(results[1].pid > 0); |
| 21 Expect.equals(0, results[1].exitCode); |
| 22 results[0].exitCode.then((exitCode) { |
| 23 Expect.equals(0, exitCode); |
| 24 port.close(); |
| 25 }); |
| 26 }); |
| 27 } |
| OLD | NEW |