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..9816d41115a61e27e7d695a05452031f972fb52e 100644 |
--- a/tests/standalone/io/process_kill_test.dart |
+++ b/tests/standalone/io/process_kill_test.dart |
@@ -5,11 +5,16 @@ |
// Process test program to test process communication. |
library ProcessKillTest; |
+ |
+import 'dart:io'; |
+ |
+import "package:async_helper/async_helper.dart"; |
import "package:expect/expect.dart"; |
-import "dart:io"; |
+ |
import "process_test_util.dart"; |
testKill() { |
+ asyncStart(); |
// Start a process that will hang waiting for input until killed. |
Process.start(getProcessTestFileName(), const ["0", "1", "0", "0"]).then((p) { |
p.exitCode.then((exitCode) { |
@@ -17,11 +22,28 @@ testKill() { |
Expect.isTrue(exitCode != 0); |
// Killing a process that is already dead returns false. |
Expect.isFalse(p.kill()); |
+ asyncEnd(); |
}); |
Expect.isTrue(p.kill()); |
}); |
} |
+testKillPid() { |
+ asyncStart(); |
+ // Start a process that will hang waiting for input until killed. |
+ 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(Process.killPid(p.pid)); |
+ asyncEnd(); |
+ }); |
+ Expect.isTrue(Process.killPid(p.pid)); |
+ }); |
+} |
+ |
main() { |
testKill(); |
+ testKillPid(); |
} |