summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/fileapi/file_system_operation_unittest.cc26
1 files changed, 20 insertions, 6 deletions
diff --git a/webkit/fileapi/file_system_operation_unittest.cc b/webkit/fileapi/file_system_operation_unittest.cc
index 69a79fe..75c9d31 100644
--- a/webkit/fileapi/file_system_operation_unittest.cc
+++ b/webkit/fileapi/file_system_operation_unittest.cc
@@ -263,8 +263,11 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirAndNew) {
TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirRecursive) {
ScopedTempDir src_dir;
ASSERT_TRUE(src_dir.CreateUniqueTempDir());
- FilePath child_file;
- file_util::CreateTemporaryFileInDir(src_dir.path(), &child_file);
+ FilePath child_dir;
+ file_util::CreateTemporaryDirInDir(src_dir.path(),
+ FILE_PATH_LITERAL("prefix"), &child_dir);
+ FilePath grandchild_file;
+ file_util::CreateTemporaryFileInDir(child_dir, &grandchild_file);
ScopedTempDir dest_dir;
ASSERT_TRUE(dest_dir.CreateUniqueTempDir());
@@ -272,7 +275,11 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirRecursive) {
operation()->Move(src_dir.path(), dest_dir.path());
MessageLoop::current()->RunAllPending();
EXPECT_EQ(kFileOperationSucceeded, status());
- EXPECT_TRUE(FileExists(dest_dir.path().Append(child_file.BaseName())));
+ EXPECT_TRUE(file_util::DirectoryExists(dest_dir.path().Append(
+ child_dir.BaseName())));
+ EXPECT_TRUE(FileExists(dest_dir.path().Append(
+ child_dir.BaseName()).Append(
+ grandchild_file.BaseName())));
}
TEST_F(FileSystemOperationTest, TestCopyFailureSrcDoesntExist) {
@@ -423,8 +430,11 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirAndNew) {
TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirRecursive) {
ScopedTempDir src_dir;
ASSERT_TRUE(src_dir.CreateUniqueTempDir());
- FilePath child_file;
- file_util::CreateTemporaryFileInDir(src_dir.path(), &child_file);
+ FilePath child_dir;
+ file_util::CreateTemporaryDirInDir(src_dir.path(),
+ FILE_PATH_LITERAL("prefix"), &child_dir);
+ FilePath grandchild_file;
+ file_util::CreateTemporaryFileInDir(child_dir, &grandchild_file);
ScopedTempDir dest_dir;
ASSERT_TRUE(dest_dir.CreateUniqueTempDir());
@@ -432,7 +442,11 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirRecursive) {
operation()->Copy(src_dir.path(), dest_dir.path());
MessageLoop::current()->RunAllPending();
EXPECT_EQ(kFileOperationSucceeded, status());
- EXPECT_TRUE(FileExists(dest_dir.path().Append(child_file.BaseName())));
+ EXPECT_TRUE(file_util::DirectoryExists(dest_dir.path().Append(
+ child_dir.BaseName())));
+ EXPECT_TRUE(FileExists(dest_dir.path().Append(
+ child_dir.BaseName()).Append(
+ grandchild_file.BaseName())));
}
TEST_F(FileSystemOperationTest, TestCreateFileFailure) {