Index: tests/standalone/io/process_kill_test.dart |
diff --git a/tests/standalone/io/process_kill_test.dart b/tests/standalone/io/process_kill_test.dart |
index 673933649893dc9e0a3021218ae8b7cd8be36a9b..4955b2c1782b2379830ce8636b62ce1adbd9a33d 100644 |
--- a/tests/standalone/io/process_kill_test.dart |
+++ b/tests/standalone/io/process_kill_test.dart |
@@ -22,6 +22,20 @@ testKill() { |
}); |
} |
+testKillPid() { |
+ // Start a process that will hang waiting for input until killed. |
Lasse Reichstein Nielsen
2015/02/03 14:00:47
You need to add startAsync/endAsync calls, otherwi
Søren Gjesse
2015/02/04 08:16:02
Thanks, done.
|
+ Process.start(getProcessTestFileName(), const ["0", "1", "0", "0"]).then((p) { |
+ p.exitCode.then((exitCode) { |
+ // Process killed from the side so exit code is not 0. |
+ Expect.isTrue(exitCode != 0); |
+ // Killing a process that is already dead returns false. |
+ Expect.isFalse(p.kill()); |
Lasse Reichstein Nielsen
2015/02/03 14:00:47
Why not Process.killPid(p.pid) ?
Søren Gjesse
2015/02/04 08:16:02
Done.
|
+ }); |
+ Expect.isTrue(Process.killPid(p.pid)); |
+ }); |
+} |
+ |
main() { |
testKill(); |
+ testKillPid(); |
} |