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

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

Issue 11091070: Change Process.start to return a future that completes with a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
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 4909a0ecf63b5c9d56cea71f533fc35c620ab63e..d5f6884cdad3874c3b441d0efc8daa0b4b9545f9 100644
--- a/tests/standalone/io/process_start_exception_test.dart
+++ b/tests/standalone/io/process_start_exception_test.dart
@@ -7,19 +7,17 @@
#import("dart:io");
testStartError() {
- Process process = Process.start("__path_to_something_that_should_not_exist__",
- const []);
-
- process.onExit = (int exitCode) {
- Expect.fail("exit handler called");
- };
-
- process.onError = (ProcessException e) {
+ Future<Process> processFuture =
+ Process.start("__path_to_something_that_should_not_exist__",
+ const []);
+ processFuture.then((p) => Expect.fail('got process despite start error'));
+ processFuture.handleException((e) {
+ Expect.isTrue(e is ProcessException);
Expect.equals(2, e.errorCode, e.toString());
- };
+ return true;
+ });
}
-
testRunError() {
Future<ProcessResult> processFuture =
Process.run("__path_to_something_that_should_not_exist__",

Powered by Google App Engine
This is Rietveld 408576698