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

Unified Diff: tests/standalone/io/directory_error_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/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 3c26749f0c64cbe112710f97b33445c1d8b82e45..ed2b60c245b30e873091aa7aae927abd3f3ee28d 100644
--- a/tests/standalone/io/directory_error_test.dart
+++ b/tests/standalone/io/directory_error_test.dart
@@ -33,10 +33,9 @@ void testCreateInNonExistent(Directory temp, Function done) {
Expect.throws(() => inNonExistent.createSync(),
(e) => checkCreateInNonExistentFileException(e));
- inNonExistent.create().handleException((e) {
- checkCreateInNonExistentFileException(e);
+ inNonExistent.create().catchError((e) {
+ checkCreateInNonExistentFileException(e.error);
done();
- return true;
});
}
@@ -61,10 +60,9 @@ void testCreateTempInNonExistent(Directory temp, Function done) {
Expect.throws(() => nonExistent.createTempSync(),
(e) => checkCreateTempInNonExistentFileException(e));
- nonExistent.createTemp().handleException((e) {
- checkCreateTempInNonExistentFileException(e);
+ nonExistent.createTemp().catchError((e) {
+ checkCreateTempInNonExistentFileException(e.error);
done();
- return true;
});
}
@@ -84,10 +82,9 @@ void testDeleteNonExistent(Directory temp, Function done) {
Expect.throws(() => nonExistent.deleteSync(),
(e) => checkDeleteNonExistentFileException(e));
- nonExistent.delete().handleException((e) {
- checkDeleteNonExistentFileException(e);
+ nonExistent.delete().catchError((e) {
+ checkDeleteNonExistentFileException(e.error);
done();
- return true;
});
}
@@ -113,10 +110,9 @@ void testDeleteRecursivelyNonExistent(Directory temp, Function done) {
Expect.throws(() => nonExistent.deleteSync(recursive: true),
(e) => checkDeleteRecursivelyNonExistentFileException(e));
- nonExistent.delete(recursive: true).handleException((e) {
- checkDeleteRecursivelyNonExistentFileException(e);
+ nonExistent.delete(recursive: true).catchError((e) {
+ checkDeleteRecursivelyNonExistentFileException(e.error);
done();
- return true;
});
}
@@ -154,11 +150,10 @@ void testRenameNonExistent(Directory temp, Function done) {
Expect.throws(() => nonExistent.renameSync(newPath),
(e) => e is DirectoryIOException);
var renameDone = nonExistent.rename(newPath);
- renameDone.then((ignore) => Expect.fail('rename non existent'));
- renameDone.handleException((e) {
- Expect.isTrue(e is DirectoryIOException);
- done();
- return true;
+ renameDone.then((ignore) => Expect.fail('rename non existent'))
+ .catchError((e) {
+ Expect.isTrue(e.error is DirectoryIOException);
+ done();
});
}
@@ -171,12 +166,11 @@ void testRenameFileAsDirectory(Directory temp, Function done) {
Expect.throws(() => d.renameSync(newPath),
(e) => e is DirectoryIOException);
var renameDone = d.rename(newPath);
- renameDone.then((ignore) => Expect.fail('rename file as directory'));
- renameDone.handleException((e) {
- Expect.isTrue(e is DirectoryIOException);
- done();
- return true;
- });
+ renameDone.then((ignore) => Expect.fail('rename file as directory'))
+ .catchError((e) {
+ Expect.isTrue(e.error is DirectoryIOException);
+ done();
+ });
}
@@ -188,13 +182,12 @@ testRenameOverwriteFile(Directory temp, Function done) {
Expect.throws(() => temp1.renameSync(fileName),
(e) => e is DirectoryIOException);
var renameDone = temp1.rename(fileName);
- renameDone.then((ignore) => Expect.fail('rename dir overwrite file'));
- renameDone.handleException((e) {
- Expect.isTrue(e is DirectoryIOException);
- temp1.deleteSync(recursive: true);
- done();
- return true;
- });
+ renameDone.then((ignore) => Expect.fail('rename dir overwrite file'))
+ .catchError((e) {
+ Expect.isTrue(e.error is DirectoryIOException);
+ temp1.deleteSync(recursive: true);
+ 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