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

Side by Side Diff: tests/standalone/io/directory_error_test.dart

Issue 11748017: Add synchronous directory listing to dart:io Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments, move tests that fail on Windows due to VM bug 7157 to a separate test file. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/directory_impl.dart ('k') | tests/standalone/io/directory_fuzz_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // Dart test program for testing error handling in directory I/O. 5 // Dart test program for testing error handling in directory I/O.
6 6
7 import "dart:io"; 7 import "dart:io";
8 import "dart:isolate"; 8 import "dart:isolate";
9 9
10 Directory tempDir() { 10 Directory tempDir() {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } else if (Platform.operatingSystem == "windows") { 132 } else if (Platform.operatingSystem == "windows") {
133 Expect.equals(3, e.osError.errorCode); 133 Expect.equals(3, e.osError.errorCode);
134 } 134 }
135 135
136 return true; 136 return true;
137 } 137 }
138 138
139 139
140 void testListNonExistent(Directory temp, Function done) { 140 void testListNonExistent(Directory temp, Function done) {
141 Directory nonExistent = new Directory("${temp.path}/nonExistent"); 141 Directory nonExistent = new Directory("${temp.path}/nonExistent");
142 Expect.throws(() => nonExistent.listSync(), (e) => e is DirectoryIOException);
142 var lister = nonExistent.list(); 143 var lister = nonExistent.list();
143 lister.onError = (e) { 144 lister.onError = (e) {
144 checkListNonExistentFileException(e); 145 checkListNonExistentFileException(e);
145 done(); 146 done();
146 }; 147 };
147 } 148 }
148 149
149 150
150 void testRenameNonExistent(Directory temp, Function done) { 151 void testRenameNonExistent(Directory temp, Function done) {
151 Directory nonExistent = new Directory("${temp.path}/nonExistent"); 152 Directory nonExistent = new Directory("${temp.path}/nonExistent");
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 main() { 217 main() {
217 runTest(testCreateInNonExistent); 218 runTest(testCreateInNonExistent);
218 runTest(testCreateTempInNonExistent); 219 runTest(testCreateTempInNonExistent);
219 runTest(testDeleteNonExistent); 220 runTest(testDeleteNonExistent);
220 runTest(testDeleteRecursivelyNonExistent); 221 runTest(testDeleteRecursivelyNonExistent);
221 runTest(testListNonExistent); 222 runTest(testListNonExistent);
222 runTest(testRenameNonExistent); 223 runTest(testRenameNonExistent);
223 runTest(testRenameFileAsDirectory); 224 runTest(testRenameFileAsDirectory);
224 runTest(testRenameOverwriteFile); 225 runTest(testRenameOverwriteFile);
225 } 226 }
OLDNEW
« no previous file with comments | « sdk/lib/io/directory_impl.dart ('k') | tests/standalone/io/directory_fuzz_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698