OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // Process test program to test process communication. | 5 // Process test program to test process communication. |
6 | 6 |
7 class ProcessExitTest { | 7 class ProcessExitTest { |
8 | 8 |
9 static void testExit() { | 9 static void testExit() { |
10 Process process = new Process("out/Debug_ia32/process_test", | 10 Process process = new Process("Debug_ia32\\process_test.exe", |
11 const ["0", "0", "99", "0"]); | 11 const ["0", "0", "99", "0"]); |
12 | 12 |
13 void exitHandler(int exitCode) { | 13 void exitHandler(int exitCode) { |
14 Expect.equals(exitCode, 99); | 14 Expect.equals(exitCode, 99); |
15 process.close(); | 15 process.close(); |
16 } | 16 } |
17 | 17 |
18 process.setExitHandler(exitHandler); | 18 process.setExitHandler(exitHandler); |
19 process.start(); | 19 process.start(); |
20 } | 20 } |
21 | 21 |
22 static void testMain() { | 22 static void testMain() { |
23 testExit(); | 23 testExit(); |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
27 main() { | 27 main() { |
28 ProcessExitTest.testMain(); | 28 ProcessExitTest.testMain(); |
29 } | 29 } |
OLD | NEW |