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

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: Minor cleanup 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
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..2911f2a8bc4effbd353e94798257e48d89b686cf 100644
--- a/tests/standalone/io/process_start_exception_test.dart
+++ b/tests/standalone/io/process_start_exception_test.dart
@@ -7,9 +7,9 @@
#import("dart:io");
testStartError() {
- Process process =
- new Process.start("__path_to_something_that_should_not_exist__",
- const []);
+ InteractiveProcess process =
+ Process.start("__path_to_something_that_should_not_exist__",
+ const []);
process.onExit = (int exitCode) {
Expect.fail("exit handler called");
@@ -22,17 +22,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() {

Powered by Google App Engine
This is Rietveld 408576698