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

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

Issue 15832003: Change File.directory to not do any IO (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « sdk/lib/io/file_impl.dart ('k') | tests/standalone/io/file_fuzz_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_error_test.dart
diff --git a/tests/standalone/io/file_error_test.dart b/tests/standalone/io/file_error_test.dart
index 16c0e243f53b6811e03bd858d98e6905bc04b516..8af6f1f60d639f7d5d3c793d3303ea1c56a6210e 100644
--- a/tests/standalone/io/file_error_test.dart
+++ b/tests/standalone/io/file_error_test.dart
@@ -171,38 +171,6 @@ void testFullPathOnNonExistentDirectory() {
});
}
-bool checkDirectoryInNonExistentDirectoryException(e) {
- Expect.isTrue(e is FileIOException);
- Expect.isTrue(e.osError != null);
- Expect.isTrue(
- e.toString().indexOf("Cannot retrieve directory for file") != -1);
- // File not not found has error code 2 on all supported platforms.
- Expect.equals(2, e.osError.errorCode);
-
- return true;
-}
-
-void testDirectoryInNonExistentDirectory() {
- Directory temp = tempDir();
- ReceivePort p = new ReceivePort();
- p.receive((x, y) {
- p.close();
- temp.deleteSync(recursive: true);
- });
- var file = new File("${temp.path}/nonExistentDirectory/newFile");
-
- // Create in non-existent directory should throw exception.
- Expect.throws(() => file.directorySync(),
- (e) => checkDirectoryInNonExistentDirectoryException(e));
-
- var dirFuture = file.directory();
- dirFuture.then((directory) => Expect.fail("Unreachable code"))
- .catchError((error) {
- checkDirectoryInNonExistentDirectoryException(error);
- p.toSendPort().send(null);
- });
-}
-
void testReadAsBytesNonExistent() {
Directory temp = tempDir();
ReceivePort p = new ReceivePort();
@@ -481,7 +449,6 @@ main() {
testLengthNonExistent();
testCreateInNonExistentDirectory();
testFullPathOnNonExistentDirectory();
- testDirectoryInNonExistentDirectory();
testReadAsBytesNonExistent();
testReadAsTextNonExistent();
testReadAsLinesNonExistent();
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | tests/standalone/io/file_fuzz_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698