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

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

Issue 10392023: Change dart:io to use Future for one-shot operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding stable test binaries Created 8 years, 7 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
« no previous file with comments | « tests/standalone/io/process_segfault_test.dart ('k') | tests/standalone/io/process_stderr_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « tests/standalone/io/process_segfault_test.dart ('k') | tests/standalone/io/process_stderr_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698