Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: tests/standalone/io/process_kill_test.dart

Issue 895623002: Add support for killing a process with a given PID to dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« sdk/lib/io/process.dart ('K') | « sdk/lib/io/process.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« sdk/lib/io/process.dart ('K') | « sdk/lib/io/process.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698