Index: tests/standalone/io/process_start_exception_test.dart |
diff --git a/tests/standalone/io/process_start_exception_test.dart b/tests/standalone/io/process_start_exception_test.dart |
index 1843c431e6c03abaa3a8214be5bd8098768a9309..4909a0ecf63b5c9d56cea71f533fc35c620ab63e 100644 |
--- a/tests/standalone/io/process_start_exception_test.dart |
+++ b/tests/standalone/io/process_start_exception_test.dart |
@@ -7,9 +7,8 @@ |
#import("dart:io"); |
testStartError() { |
- Process process = |
- new Process.start("__path_to_something_that_should_not_exist__", |
- const []); |
+ Process process = Process.start("__path_to_something_that_should_not_exist__", |
+ const []); |
process.onExit = (int exitCode) { |
Expect.fail("exit handler called"); |
@@ -22,17 +21,17 @@ testStartError() { |
testRunError() { |
- Process process = |
- new Process.run("__path_to_something_that_should_not_exist__", |
- const [], |
- null, |
- (exit, out, err) { |
- Expect.fail("exit handler called"); |
- }); |
+ Future<ProcessResult> processFuture = |
+ Process.run("__path_to_something_that_should_not_exist__", |
+ const []); |
- process.onError = (ProcessException e) { |
+ processFuture.then((result) => Expect.fail("exit handler called")); |
+ |
+ processFuture.handleException((e) { |
+ Expect.isTrue(e is ProcessException); |
Expect.equals(2, e.errorCode, e.toString()); |
- }; |
+ return true; |
+ }); |
} |
main() { |