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

Unified Diff: runtime/tests/vm/dart/hello_fuchsia_test.dart

Issue 2619233003: Fuchsia: Adds support for Process.kill() (Closed)
Patch Set: Remove whitespace Created 3 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
« no previous file with comments | « runtime/bin/process_fuchsia.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tests/vm/dart/hello_fuchsia_test.dart
diff --git a/runtime/tests/vm/dart/hello_fuchsia_test.dart b/runtime/tests/vm/dart/hello_fuchsia_test.dart
index 8053b8505a6e88809e6e577dd95a700a03376445..eb2aaf49b255e9d2e19f1b0e6cc258d9894c0cdd 100644
--- a/runtime/tests/vm/dart/hello_fuchsia_test.dart
+++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart
@@ -397,6 +397,17 @@ void testProcessRunSync() {
print("$exe --version had stderr = '${result.stderr}'");
}
+Future testKill() async {
+ String exe = Platform.resolvedExecutable;
+ String script = Platform.script.path;
+ print("Running $exe $script");
+ Process p = await Process.start(exe, [script, "infinite-loop"]);
+ await new Future.delayed(const Duration(seconds: 1));
+ p.kill();
+ int code = await p.exitCode;
+ print("$exe $script exited with code $code");
+}
+
Future testLs(String path) async {
Stream<FileSystemEntity> stream = (new Directory(path)).list();
await for (FileSystemEntity fse in stream) {
@@ -431,7 +442,13 @@ Future testCopy() async {
await tmp.delete();
}
-main() async {
+main(List<String> args) async {
+ if (args.length >= 1) {
+ if (args[0] == "infinite-loop") {
+ while (true);
+ }
+ }
+
print("Hello, Fuchsia!");
print("testAddressParse");
@@ -478,6 +495,10 @@ main() async {
testProcessRunSync();
print("testProcessRunSync done");
+ print("testKill");
+ await testKill();
+ print("testKill done");
+
print("testCopy");
await testCopy();
print("testCopy done");
« no previous file with comments | « runtime/bin/process_fuchsia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698