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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
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 4a6d319a9a11b0bf73921bc3308d1d9bdf038115..a75b131bfbbe433ab6df51a6e34ca94e61ef8198 100644
--- a/tests/standalone/io/process_start_exception_test.dart
+++ b/tests/standalone/io/process_start_exception_test.dart
@@ -4,17 +4,17 @@
//
// Process test program to errors during startup of the process.
-import "dart:io";
+import 'dart:async';
+import 'dart:io';
testStartError() {
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;
+ processFuture.then((p) => Expect.fail('got process despite start error'))
+ .catchError((e) {
+ Expect.isTrue(e.error is ProcessException);
+ Expect.equals(2, e.error.errorCode, e.error.toString());
});
}
@@ -23,12 +23,10 @@ testRunError() {
Process.run("__path_to_something_that_should_not_exist__",
const []);
- 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;
+ processFuture.then((result) => Expect.fail("exit handler called"))
+ .catchError((e) {
+ Expect.isTrue(e.error is ProcessException);
+ Expect.equals(2, e.error.errorCode, e.error.toString());
});
}
« no previous file with comments | « tests/standalone/io/process_check_arguments_script.dart ('k') | tests/standalone/io/process_stderr_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698