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"); |