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

Unified Diff: tests/standalone/io/directory_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
« no previous file with comments | « tests/standalone/io/directory_fuzz_test.dart ('k') | tests/standalone/io/echo_server_stream_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/directory_test.dart
diff --git a/tests/standalone/io/directory_test.dart b/tests/standalone/io/directory_test.dart
index 825cb9cf285386222808f9b994fc0ae291275395..b25907119fc8ca0bed48687bee79a34d6452ed5b 100644
--- a/tests/standalone/io/directory_test.dart
+++ b/tests/standalone/io/directory_test.dart
@@ -143,12 +143,10 @@ class DirectoryTest {
static void testDeleteNonExistent() {
// Test that deleting a non-existing directory fails.
setupFutureHandlers(future) {
- future.handleException((e) {
- Expect.isTrue(e is DirectoryIOException);
- return true;
- });
future.then((ignore) {
Expect.fail("Deletion of non-existing directory should fail");
+ }).catchError((e) {
+ Expect.isTrue(e.error is DirectoryIOException);
});
}
@@ -176,14 +174,14 @@ class DirectoryTest {
var long = new Directory("${buffer.toString()}");
var errors = 0;
onError(e) {
- Expect.isTrue(e is DirectoryIOException);
+ Expect.isTrue(e.error is DirectoryIOException);
if (++errors == 2) {
d.delete(recursive: true).then((ignore) => port.close());
}
return true;
}
- long.delete().handleException(onError);
- long.delete(recursive: true).handleException(onError);
+ long.delete().catchError(onError);
+ long.delete(recursive: true).catchError(onError);
});
});
}
@@ -482,7 +480,7 @@ testCreateTempError() {
var port = new ReceivePort();
var future = new Directory(location).createTemp();
- future.handleException((e) => port.close());
+ future.catchError((e) => port.close());
}
@@ -550,14 +548,13 @@ testCreateDirExistingFile() {
var subDir = new Directory(path);
file.create().then((_) {
subDir.create()
- ..then((_) { Expect.fail("dir create should fail on existing file"); })
- ..handleException((e) {
- Expect.isTrue(e is DirectoryIOException);
- temp.delete(recursive: true).then((_) {
- port.close();
- });
- return true;
+ .then((_) { Expect.fail("dir create should fail on existing file"); })
+ .catchError((e) {
+ Expect.isTrue(e.error is DirectoryIOException);
+ temp.delete(recursive: true).then((_) {
+ port.close();
});
+ });
});
});
}
« no previous file with comments | « tests/standalone/io/directory_fuzz_test.dart ('k') | tests/standalone/io/echo_server_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698