summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_operation_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/fileapi/file_system_operation_unittest.cc')
-rw-r--r--webkit/fileapi/file_system_operation_unittest.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/webkit/fileapi/file_system_operation_unittest.cc b/webkit/fileapi/file_system_operation_unittest.cc
index b535676..7e3a177 100644
--- a/webkit/fileapi/file_system_operation_unittest.cc
+++ b/webkit/fileapi/file_system_operation_unittest.cc
@@ -570,6 +570,20 @@ TEST_F(FileSystemOperationTest, TestExistsAndMetadataSuccess) {
EXPECT_FALSE(info().is_directory);
}
+TEST_F(FileSystemOperationTest, TestTypeMismatchErrors) {
+ ScopedTempDir dir;
+ ASSERT_TRUE(dir.CreateUniqueTempDir());
+ operation()->FileExists(dir.path());
+ MessageLoop::current()->RunAllPending();
+ EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status());
+
+ FilePath file;
+ ASSERT_TRUE(file_util::CreateTemporaryFileInDir(dir.path(), &file));
+ operation()->DirectoryExists(file);
+ MessageLoop::current()->RunAllPending();
+ EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status());
+}
+
TEST_F(FileSystemOperationTest, TestReadDirFailure) {
// Path doesn't exists
FilePath nonexisting_dir_path(base_.path().Append(