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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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/dart_std_io_pipe_test.dart ('k') | tests/standalone/io/directory_fuzz_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/directory_error_test.dart
diff --git a/tests/standalone/io/directory_error_test.dart b/tests/standalone/io/directory_error_test.dart
index ed2b60c245b30e873091aa7aae927abd3f3ee28d..950f025097d0e3dd7c4d1d611bfa81cc3f46d192 100644
--- a/tests/standalone/io/directory_error_test.dart
+++ b/tests/standalone/io/directory_error_test.dart
@@ -4,6 +4,7 @@
//
// Dart test program for testing error handling in directory I/O.
+import "dart:async";
import "dart:io";
import "dart:isolate";
@@ -133,14 +134,21 @@ bool checkListNonExistentFileException(e) {
}
+bool checkAsyncListNonExistentFileException(e) {
+ Expect.isTrue(e is AsyncError);
+ return checkListNonExistentFileException(e.error);
+}
+
+
void testListNonExistent(Directory temp, Function done) {
Directory nonExistent = new Directory("${temp.path}/nonExistent");
Expect.throws(() => nonExistent.listSync(), (e) => e is DirectoryIOException);
- var lister = nonExistent.list();
- lister.onError = (e) {
- checkListNonExistentFileException(e);
- done();
- };
+ nonExistent.list().listen(
+ (_) => Expect.fail("listing should not succeed"),
+ onError: (e) {
+ checkAsyncListNonExistentFileException(e);
+ done();
+ });
}
« no previous file with comments | « tests/standalone/io/dart_std_io_pipe_test.dart ('k') | tests/standalone/io/directory_fuzz_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698