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

Side by Side Diff: tests/standalone/src/io/DirectoryTest.dart

Issue 9630012: Error reporting on File in dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Style issues Created 8 years, 9 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 | « runtime/bin/utils_win.cc ('k') | tests/standalone/src/io/FileErrorTest.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 // Directory listing test. 5 // Directory listing test.
6 6
7 #import("dart:io"); 7 #import("dart:io");
8 #import("dart:isolate"); 8 #import("dart:isolate");
9 9
10 class DirectoryTest { 10 class DirectoryTest {
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 return "*"; 432 return "*";
433 } 433 }
434 return null; 434 return null;
435 } 435 }
436 436
437 437
438 testCreateTempErrorSync() { 438 testCreateTempErrorSync() {
439 var location = illegalTempDirectoryLocation(); 439 var location = illegalTempDirectoryLocation();
440 if (location != null) { 440 if (location != null) {
441 Expect.throws(new Directory(location).createTempSync, 441 Expect.throws(new Directory(location).createTempSync,
442 (e) => e is DirectoryException); 442 (e) => e is DirectoryIOException);
443 } 443 }
444 } 444 }
445 445
446 446
447 testCreateTempError() { 447 testCreateTempError() {
448 var location = illegalTempDirectoryLocation(); 448 var location = illegalTempDirectoryLocation();
449 if (location == null) return; 449 if (location == null) return;
450 450
451 var resultPort = new ReceivePort(); 451 var resultPort = new ReceivePort();
452 resultPort.receive((String message, ignored) { 452 resultPort.receive((String message, ignored) {
453 resultPort.close(); 453 resultPort.close();
454 Expect.equals("error", message); 454 Expect.equals("error", message);
455 }); 455 });
456 456
457 Directory dir = new Directory(location); 457 Directory dir = new Directory(location);
458 dir.onError = (error) { resultPort.toSendPort().send("error"); }; 458 dir.onError = (error) { resultPort.toSendPort().send("error"); };
459 dir.createTemp(() => resultPort.toSendPort().send("success")); 459 dir.createTemp(() => resultPort.toSendPort().send("success"));
460 } 460 }
461 461
462 462
463 main() { 463 main() {
464 DirectoryTest.testMain(); 464 DirectoryTest.testMain();
465 NestedTempDirectoryTest.testMain(); 465 NestedTempDirectoryTest.testMain();
466 testCreateTempErrorSync(); 466 testCreateTempErrorSync();
467 testCreateTempError(); 467 testCreateTempError();
468 } 468 }
OLDNEW
« no previous file with comments | « runtime/bin/utils_win.cc ('k') | tests/standalone/src/io/FileErrorTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698