Chromium Code Reviews| Index: tests/standalone/io/process_working_directory_test.dart |
| diff --git a/tests/standalone/io/process_working_directory_test.dart b/tests/standalone/io/process_working_directory_test.dart |
| index 55a0ad721bd90f7e35ea29a0eb707860f53fe0a1..52304a6377d79df6c446cafdc8384457ba15474a 100644 |
| --- a/tests/standalone/io/process_working_directory_test.dart |
| +++ b/tests/standalone/io/process_working_directory_test.dart |
| @@ -22,20 +22,20 @@ class ProcessWorkingDirectoryTest { |
| var options = new ProcessOptions(); |
| options.workingDirectory = directory.path; |
| - Process process = Process.start(fullTestFilePath, |
| - const ["0", "0", "99", "0"], |
| - options); |
| + Process.start(fullTestFilePath, |
| + const ["0", "0", "99", "0"], |
| + options).then((process) { |
| + process.onExit = (int exitCode) { |
| + Expect.equals(exitCode, 99); |
| + process.close(); |
| + directory.deleteSync(); |
| + }; |
| - process.onExit = (int exitCode) { |
| - Expect.equals(exitCode, 99); |
| - process.close(); |
| - directory.deleteSync(); |
| - }; |
| - |
| - process.onError = (error) { |
| - Expect.fail("error running process $error"); |
| - directory.deleteSync(); |
| - }; |
| + process.onError = (error) { |
| + Expect.fail("error running process $error"); |
| + directory.deleteSync(); |
| + }; |
| + }); |
| } |
| static void testInvalidDirectory() { |
| @@ -44,20 +44,20 @@ class ProcessWorkingDirectoryTest { |
| var options = new ProcessOptions(); |
| options.workingDirectory = directory.path.concat("/subPath"); |
| - Process process = Process.start(fullTestFilePath, |
| - const ["0", "0", "99", "0"], |
| - options); |
| - |
| - process.onExit = (int exitCode) { |
| + var future = Process.start(fullTestFilePath, |
|
Søren Gjesse
2012/10/12 07:47:22
One could consider writing this with cascades and
Mads Ager (google)
2012/10/12 08:44:46
I actually did a couple of places and removed it a
|
| + const ["0", "0", "99", "0"], |
| + options); |
| + future.then((process) { |
| Expect.fail("bad process completed"); |
| process.close(); |
| directory.deleteSync(); |
| - }; |
| + }); |
| - process.onError = (error) { |
| - Expect.isNotNull(error); |
| + future.handleException((e) { |
| + Expect.isNotNull(e); |
| directory.deleteSync(); |
| - }; |
| + return true; |
| + }); |
| } |
| } |