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

Unified Diff: tests/standalone/src/FileTest.dart

Issue 9431034: Fix another problem with the new file test. Don't use the same file (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Better error message if we cannot allocate temp directory Created 8 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/FileTest.dart
diff --git a/tests/standalone/src/FileTest.dart b/tests/standalone/src/FileTest.dart
index 3c2e5b12228bc3b3875b568ea08bdd0d37d08dd8..a32f69d5e91558e58326ac3a3e8bbdfc1b600838 100644
--- a/tests/standalone/src/FileTest.dart
+++ b/tests/standalone/src/FileTest.dart
@@ -27,12 +27,15 @@ class FileTest {
static void createTempDirectory(Function doNext) {
tempDirectory = new Directory('');
+ tempDirectory.errorHandler = (e) {
+ Expect.fail("Failed creating temporary directory");
+ };
tempDirectory.createTempHandler = doNext;
tempDirectory.createTemp();
}
static void deleteTempDirectory() {
- tempDirectory.deleteSync();
+ tempDirectory.deleteSync(recursive: true);
}
// Test for file read functionality.
@@ -404,6 +407,7 @@ class FileTest {
// Test for file write of different types of lists.
static void testWriteVariousLists() {
+ asyncTestStarted();
final String fileName = "${tempDirectory.path}/testWriteVariousLists";
final File file = new File(fileName);
file.create();
@@ -443,6 +447,7 @@ class FileTest {
}
openedFile2.closeSync();
file2.deleteSync();
+ asyncTestDone("testWriteVariousLists");
};
};
file.errorHandler = (s) {
@@ -452,12 +457,17 @@ class FileTest {
}
static void testDirectory() {
+ asyncTestStarted();
+
// Port to verify that the test completes.
var port = new ReceivePort.singleShot();
- port.receive((message, replyTo) => Expect.equals(1, message));
+ port.receive((message, replyTo) {
+ Expect.equals(1, message);
+ asyncTestDone("testDirectory");
+ });
var tempDir = tempDirectory.path;
- var file = new File("${tempDir}/file");
+ var file = new File("${tempDir}/testDirectory");
var errors = 0;
file.directory();
file.directoryHandler = (d) => Expect.fail("non-existing file");
@@ -498,7 +508,7 @@ class FileTest {
static void testDirectorySync() {
var tempDir = tempDirectory.path;
- var file = new File("${tempDir}/file");
+ var file = new File("${tempDir}/testDirectorySync");
// Non-existing file should throw exception.
Expect.throws(file.directorySync, (e) { return e is FileIOException; });
file.createSync();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698