diff options
author | dmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 06:14:09 +0000 |
---|---|---|
committer | dmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 06:14:09 +0000 |
commit | b43db5a635d2a4c1c245f2244a4058d99ccd8f31 (patch) | |
tree | 3656117ef1fca2c4579599b5bf9327f1a9ae79bd /webkit/fileapi | |
parent | 499ededff612a67eba5bc0b4dfa767ae7bfb36d5 (diff) | |
download | chromium_src-b43db5a635d2a4c1c245f2244a4058d99ccd8f31.zip chromium_src-b43db5a635d2a4c1c245f2244a4058d99ccd8f31.tar.gz chromium_src-b43db5a635d2a4c1c245f2244a4058d99ccd8f31.tar.bz2 |
Modify tests for FileSystemOperation to test directory-in-directory.
BUG=none
TEST=FileSystemOperationTest.Test*SuccessSrcDirRecursive
Review URL: http://codereview.chromium.org/6816048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r-- | webkit/fileapi/file_system_operation_unittest.cc | 26 |
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) { |