diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 21:44:35 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 21:44:35 +0000 |
commit | c27a5ed3f25971f028dd1baedd73efb59497ceeb (patch) | |
tree | 178dbc2db3eec96e696277ffff66effe3281e502 /webkit | |
parent | 5e0eb3c58f459bdf9b42d8666a7fef4f475224c5 (diff) | |
download | chromium_src-c27a5ed3f25971f028dd1baedd73efb59497ceeb.zip chromium_src-c27a5ed3f25971f028dd1baedd73efb59497ceeb.tar.gz chromium_src-c27a5ed3f25971f028dd1baedd73efb59497ceeb.tar.bz2 |
Revert 61613 - possible culprit for valgrind error. (Support removeRecursively and new copy/move)
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3576017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/blob/deletable_file_reference.cc | 2 | ||||
-rw-r--r-- | webkit/fileapi/file_system_operation.cc | 7 | ||||
-rw-r--r-- | webkit/fileapi/file_system_operation.h | 5 | ||||
-rw-r--r-- | webkit/fileapi/file_system_operation_unittest.cc | 258 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_file_system.cc | 9 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_file_system.h | 2 |
7 files changed, 60 insertions, 225 deletions
diff --git a/webkit/blob/deletable_file_reference.cc b/webkit/blob/deletable_file_reference.cc index 9f49943..b005eeb 100644 --- a/webkit/blob/deletable_file_reference.cc +++ b/webkit/blob/deletable_file_reference.cc @@ -57,7 +57,7 @@ DeletableFileReference::DeletableFileReference( DeletableFileReference::~DeletableFileReference() { DCHECK(map()->find(path_)->second == this); map()->erase(path_); - base::FileUtilProxy::Delete(file_thread_, path_, false /* recursive */, NULL); + base::FileUtilProxy::Delete(file_thread_, path_, NULL); } } // namespace webkit_blob diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc index 29336a8..e636420 100644 --- a/webkit/fileapi/file_system_operation.cc +++ b/webkit/fileapi/file_system_operation.cc @@ -118,15 +118,14 @@ void FileSystemOperation::ReadDirectory(const FilePath& path) { &FileSystemOperation::DidReadDirectory)); } -void FileSystemOperation::Remove(const FilePath& path, bool recursive) { +void FileSystemOperation::Remove(const FilePath& path) { #ifndef NDEBUG DCHECK(kOperationNone == pending_operation_); pending_operation_ = kOperationRemove; #endif - base::FileUtilProxy::Delete(proxy_, path, recursive, - callback_factory_.NewCallback( - &FileSystemOperation::DidFinishFileOperation)); + base::FileUtilProxy::Delete(proxy_, path, callback_factory_.NewCallback( + &FileSystemOperation::DidFinishFileOperation)); } void FileSystemOperation::Write( diff --git a/webkit/fileapi/file_system_operation.h b/webkit/fileapi/file_system_operation.h index ba65b7d..ab6d56c 100644 --- a/webkit/fileapi/file_system_operation.h +++ b/webkit/fileapi/file_system_operation.h @@ -45,6 +45,9 @@ class FileSystemOperation { void Copy(const FilePath& src_path, const FilePath& dest_path); + // If |dest_path| exists and is a directory, behavior is unspecified or + // varies for different platforms. TODO(kkanetkar): Fix this as per spec + // when it is addressed in spec. void Move(const FilePath& src_path, const FilePath& dest_path); @@ -56,7 +59,7 @@ class FileSystemOperation { void ReadDirectory(const FilePath& path); - void Remove(const FilePath& path, bool recursive); + void Remove(const FilePath& path); void Write(const FilePath& path, const GURL& blob_url, int64 offset); diff --git a/webkit/fileapi/file_system_operation_unittest.cc b/webkit/fileapi/file_system_operation_unittest.cc index 9b07c03..8a02ade 100644 --- a/webkit/fileapi/file_system_operation_unittest.cc +++ b/webkit/fileapi/file_system_operation_unittest.cc @@ -89,7 +89,9 @@ class FileSystemOperationTest : public testing::Test { } protected: - // Common temp base for nondestructive uses. + // Common temp base for all non-existing file/dir path test cases. + // This is in case a dir on test machine exists. It's better to + // create temp and then create non-existing file paths under it. ScopedTempDir base_; int request_id_; @@ -110,14 +112,17 @@ TEST_F(FileSystemOperationTest, TestMoveFailureSrcDoesntExist) { EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } -TEST_F(FileSystemOperationTest, TestMoveFailureContainsPath) { - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - FilePath dest_dir_path; - ASSERT_TRUE(file_util::CreateTemporaryDirInDir(src_dir.path(), - FILE_PATH_LITERAL("child_dir"), - &dest_dir_path)); - operation()->Move(src_dir.path(), dest_dir_path); +// crbug.com/57940 +#if defined(OS_WINDOWS) +#define MAYBE_TestMoveFailureContainsPath FAILS_TestMoveFailureContainsPath +#else +#define MAYBE_TestMoveFailureContainsPath TestMoveFailureContainsPath +#endif + +TEST_F(FileSystemOperationTest, MAYBE_TestMoveFailureContainsPath) { + ScopedTempDir dir_under_base; + dir_under_base.CreateUniqueTempDirUnderPath(base_.path()); + operation()->Move(base_.path(), dir_under_base.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, mock_dispatcher_->status()); @@ -126,51 +131,14 @@ TEST_F(FileSystemOperationTest, TestMoveFailureContainsPath) { TEST_F(FileSystemOperationTest, TestMoveFailureSrcDirExistsDestFile) { // Src exists and is dir. Dest is a file. - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - ScopedTempDir dest_dir; ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); FilePath dest_file; file_util::CreateTemporaryFileInDir(dest_dir.path(), &dest_file); - operation()->Move(src_dir.path(), dest_file); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, - mock_dispatcher_->status()); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); -} - -TEST_F(FileSystemOperationTest, TestMoveFailureSrcFileExistsDestNonEmptyDir) { - // Src exists and is a directory. Dest is a non-empty directory. - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - - ScopedTempDir dest_dir; - ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - FilePath child_file; - file_util::CreateTemporaryFileInDir(dest_dir.path(), &child_file); - - operation()->Move(src_dir.path(), dest_dir.path()); + operation()->Move(base_.path(), dest_file); MessageLoop::current()->RunAllPending(); - EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, mock_dispatcher_->status()); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); -} - -TEST_F(FileSystemOperationTest, TestMoveFailureSrcFileExistsDestDir) { - // Src exists and is a file. Dest is a directory. - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - FilePath src_file; - file_util::CreateTemporaryFileInDir(src_dir.path(), &src_file); - - ScopedTempDir dest_dir; - ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - - operation()->Move(src_file, dest_dir.path()); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, - mock_dispatcher_->status()); + EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, mock_dispatcher_->status()); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } @@ -180,7 +148,7 @@ TEST_F(FileSystemOperationTest, TestMoveFailureDestParentDoesntExist) { ASSERT_TRUE(src_dir.CreateUniqueTempDir()); FilePath nonexisting_file = base_.path().Append( FILE_PATH_LITERAL("NonexistingDir")).Append( - FILE_PATH_LITERAL("NonexistingFile")); + FILE_PATH_LITERAL("NonexistingFile"));; operation()->Move(src_dir.path(), nonexisting_file); MessageLoop::current()->RunAllPending(); @@ -223,57 +191,6 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcFileAndNew) { EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } -TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirAndOverwrite) { - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - - ScopedTempDir dest_dir; - ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - - operation()->Move(src_dir.path(), dest_dir.path()); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); - EXPECT_FALSE(file_util::DirectoryExists(src_dir.path())); - - // Make sure we've overwritten but not moved the source under the |dest_dir|. - EXPECT_TRUE(file_util::DirectoryExists(dest_dir.path())); - EXPECT_FALSE(file_util::DirectoryExists( - dest_dir.path().Append(src_dir.path().BaseName()))); -} - -TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirAndNew) { - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - - ScopedTempDir dir; - ASSERT_TRUE(dir.CreateUniqueTempDir()); - FilePath dest_dir_path(dir.path().Append(FILE_PATH_LITERAL("NewDirectory"))); - - operation()->Move(src_dir.path(), dest_dir_path); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); - EXPECT_FALSE(file_util::DirectoryExists(src_dir.path())); - EXPECT_TRUE(file_util::DirectoryExists(dest_dir_path)); -} - -TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirRecursive) { - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - FilePath child_file; - file_util::CreateTemporaryFileInDir(src_dir.path(), &child_file); - - ScopedTempDir dest_dir; - ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - - operation()->Move(src_dir.path(), dest_dir.path()); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); - EXPECT_TRUE(FileExists(dest_dir.path().Append(child_file.BaseName()))); -} - TEST_F(FileSystemOperationTest, TestCopyFailureSrcDoesntExist) { FilePath src(base_.path().Append(FILE_PATH_LITERAL("a"))); FilePath dest(base_.path().Append(FILE_PATH_LITERAL("b"))); @@ -283,70 +200,35 @@ TEST_F(FileSystemOperationTest, TestCopyFailureSrcDoesntExist) { EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } -TEST_F(FileSystemOperationTest, TestCopyFailureContainsPath) { - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - FilePath dest_dir_path; - ASSERT_TRUE(file_util::CreateTemporaryDirInDir(src_dir.path(), - FILE_PATH_LITERAL("child_dir"), - &dest_dir_path)); - operation()->Copy(src_dir.path(), dest_dir_path); +// crbug.com/57940 +#if defined(OS_WINDOWS) +#define MAYBE_TestCopyFailureContainsPath FAILS_TestCopyFailureContainsPath +#else +#define MAYBE_TestCopyFailureContainsPath TestCopyFailureContainsPath +#endif + +TEST_F(FileSystemOperationTest, MAYBE_TestCopyFailureContainsPath) { + FilePath file_under_base = base_.path().Append(FILE_PATH_LITERAL("b")); + operation()->Copy(base_.path(), file_under_base); MessageLoop::current()->RunAllPending(); - EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, - mock_dispatcher_->status()); + EXPECT_EQ(base::PLATFORM_FILE_ERROR_FAILED, mock_dispatcher_->status()); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } TEST_F(FileSystemOperationTest, TestCopyFailureSrcDirExistsDestFile) { // Src exists and is dir. Dest is a file. - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - - ScopedTempDir dest_dir; - ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); + ScopedTempDir dir; + ASSERT_TRUE(dir.CreateUniqueTempDir()); FilePath dest_file; - file_util::CreateTemporaryFileInDir(dest_dir.path(), &dest_file); + file_util::CreateTemporaryFileInDir(dir.path(), &dest_file); - operation()->Copy(src_dir.path(), dest_file); + operation()->Copy(base_.path(), dest_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, mock_dispatcher_->status()); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } -TEST_F(FileSystemOperationTest, TestCopyFailureSrcFileExistsDestNonEmptyDir) { - // Src exists and is a directory. Dest is a non-empty directory. - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - - ScopedTempDir dest_dir; - ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - FilePath child_file; - file_util::CreateTemporaryFileInDir(dest_dir.path(), &child_file); - - operation()->Copy(src_dir.path(), dest_dir.path()); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, mock_dispatcher_->status()); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); -} - -TEST_F(FileSystemOperationTest, TestCopyFailureSrcFileExistsDestDir) { - // Src exists and is a file. Dest is a directory. - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - FilePath src_file; - file_util::CreateTemporaryFileInDir(src_dir.path(), &src_file); - - ScopedTempDir dest_dir; - ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - - operation()->Copy(src_file, dest_dir.path()); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, - mock_dispatcher_->status()); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); -} - TEST_F(FileSystemOperationTest, TestCopyFailureDestParentDoesntExist) { // Dest. parent path does not exist. ScopedTempDir dir; @@ -399,7 +281,7 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcFileAndNew) { EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } -TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirAndOverwrite) { +TEST_F(FileSystemOperationTest, TestCopySuccessSrcDir) { ScopedTempDir src_dir; ASSERT_TRUE(src_dir.CreateUniqueTempDir()); @@ -410,42 +292,24 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirAndOverwrite) { MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); - - // Make sure we've overwritten but not copied the source under the |dest_dir|. - EXPECT_TRUE(file_util::DirectoryExists(dest_dir.path())); - EXPECT_FALSE(file_util::DirectoryExists( - dest_dir.path().Append(src_dir.path().BaseName()))); } -TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirAndNew) { +TEST_F(FileSystemOperationTest, TestCopyDestParentExistsSuccess) { ScopedTempDir src_dir; ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - - ScopedTempDir dir; - ASSERT_TRUE(dir.CreateUniqueTempDir()); - FilePath dest_dir(dir.path().Append(FILE_PATH_LITERAL("NewDirectory"))); - - operation()->Copy(src_dir.path(), dest_dir); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); - EXPECT_TRUE(file_util::DirectoryExists(dest_dir)); -} - -TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirRecursive) { - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - FilePath child_file; - file_util::CreateTemporaryFileInDir(src_dir.path(), &child_file); + FilePath src_file; + file_util::CreateTemporaryFileInDir(src_dir.path(), &src_file); ScopedTempDir dest_dir; ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - operation()->Copy(src_dir.path(), dest_dir.path()); + operation()->Copy(src_file, dest_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); - EXPECT_TRUE(FileExists(dest_dir.path().Append(child_file.BaseName()))); + + FilePath src_filename(src_file.BaseName()); + EXPECT_TRUE(FileExists(dest_dir.path().Append(src_filename))); } TEST_F(FileSystemOperationTest, TestCreateFileFailure) { @@ -503,6 +367,7 @@ TEST_F(FileSystemOperationTest, // Dest. parent path does not exist. FilePath nonexisting(base_.path().Append( FILE_PATH_LITERAL("DirDoesntExist"))); + file_util::EnsureEndsWithSeparator(&nonexisting); FilePath nonexisting_file = nonexisting.Append( FILE_PATH_LITERAL("FileDoesntExist")); operation()->CreateDirectory(nonexisting_file, false, false); @@ -513,9 +378,7 @@ TEST_F(FileSystemOperationTest, TEST_F(FileSystemOperationTest, TestCreateDirFailureDirExists) { // Exclusive and dir existing at path. - ScopedTempDir src_dir; - ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - operation()->CreateDirectory(src_dir.path(), true, false); + operation()->CreateDirectory(base_.path(), true, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, mock_dispatcher_->status()); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); @@ -543,8 +406,7 @@ TEST_F(FileSystemOperationTest, TestCreateDirSuccess) { EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); // Dir doesn't exist. - FilePath nonexisting_dir_path(base_.path().Append( - FILE_PATH_LITERAL("nonexistingdir"))); + FilePath nonexisting_dir_path(FILE_PATH_LITERAL("nonexistingdir")); operation()->CreateDirectory(nonexisting_dir_path, false, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); @@ -554,7 +416,9 @@ TEST_F(FileSystemOperationTest, TestCreateDirSuccess) { TEST_F(FileSystemOperationTest, TestCreateDirSuccessExclusive) { // Dir doesn't exist. - FilePath nonexisting_dir_path(base_.path().Append( + ScopedTempDir dir; + ASSERT_TRUE(dir.CreateUniqueTempDir()); + FilePath nonexisting_dir_path(dir.path().Append( FILE_PATH_LITERAL("nonexistingdir"))); operation()->CreateDirectory(nonexisting_dir_path, true, false); @@ -670,13 +534,12 @@ TEST_F(FileSystemOperationTest, TestRemoveFailure) { FILE_PATH_LITERAL("NonExistingDir"))); file_util::EnsureEndsWithSeparator(&nonexisting); - operation()->Remove(nonexisting, false /* recursive */); + operation()->Remove(nonexisting); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, mock_dispatcher_->status()); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); - // It's an error to try to remove a non-empty directory if recursive flag - // is false. + // By spec recursive is always false. Non-empty dir should fail. // parent_dir // | | // child_dir child_file @@ -689,9 +552,9 @@ TEST_F(FileSystemOperationTest, TestRemoveFailure) { ASSERT_TRUE(file_util::CreateTemporaryDirInDir( parent_dir.path(), FILE_PATH_LITERAL("child_dir"), &child_dir)); - operation()->Remove(parent_dir.path(), false /* recursive */); + operation()->Remove(parent_dir.path()); MessageLoop::current()->RunAllPending(); - EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, + EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, mock_dispatcher_->status()); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } @@ -701,30 +564,11 @@ TEST_F(FileSystemOperationTest, TestRemoveSuccess) { ASSERT_TRUE(empty_dir.CreateUniqueTempDir()); EXPECT_TRUE(file_util::DirectoryExists(empty_dir.path())); - operation()->Remove(empty_dir.path(), false /* recursive */); + operation()->Remove(empty_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); EXPECT_FALSE(file_util::DirectoryExists(empty_dir.path())); EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); - - // Removing a non-empty directory with recursive flag == true should be ok. - // parent_dir - // | | - // child_dir child_file - // Verify deleting parent_dir. - ScopedTempDir parent_dir; - ASSERT_TRUE(parent_dir.CreateUniqueTempDir()); - FilePath child_file; - file_util::CreateTemporaryFileInDir(parent_dir.path(), &child_file); - FilePath child_dir; - ASSERT_TRUE(file_util::CreateTemporaryDirInDir( - parent_dir.path(), FILE_PATH_LITERAL("child_dir"), &child_dir)); - - operation()->Remove(parent_dir.path(), true /* recursive */); - MessageLoop::current()->RunAllPending(); - EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); - EXPECT_FALSE(file_util::DirectoryExists(parent_dir.path())); - EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } TEST_F(FileSystemOperationTest, TestTruncate) { diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index f7f60aa..661b87b 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -321,8 +321,6 @@ WebKit::WebFileError PlatformFileErrorToWebFileError( case base::PLATFORM_FILE_ERROR_INVALID_OPERATION: case base::PLATFORM_FILE_ERROR_EXISTS: case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY: - case base::PLATFORM_FILE_ERROR_NOT_A_FILE: - case base::PLATFORM_FILE_ERROR_NOT_EMPTY: return WebKit::WebFileErrorInvalidModification; case base::PLATFORM_FILE_ERROR_ACCESS_DENIED: return WebKit::WebFileErrorNoModificationAllowed; diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc index 411d987..8e059ea 100644 --- a/webkit/tools/test_shell/simple_file_system.cc +++ b/webkit/tools/test_shell/simple_file_system.cc @@ -133,14 +133,7 @@ void SimpleFileSystem::remove( const WebString& path, WebFileSystemCallbacks* callbacks) { FilePath filepath(webkit_glue::WebStringToFilePath(path)); - GetNewOperation(callbacks)->Remove(filepath, false /* recursive */); -} - -void SimpleFileSystem::removeRecursively( - const WebString& path, WebFileSystemCallbacks* callbacks) { - FilePath filepath(webkit_glue::WebStringToFilePath(path)); - - GetNewOperation(callbacks)->Remove(filepath, true /* recursive */); + GetNewOperation(callbacks)->Remove(filepath); } void SimpleFileSystem::readMetadata( diff --git a/webkit/tools/test_shell/simple_file_system.h b/webkit/tools/test_shell/simple_file_system.h index 031ed8b..2f9eeef 100644 --- a/webkit/tools/test_shell/simple_file_system.h +++ b/webkit/tools/test_shell/simple_file_system.h @@ -28,8 +28,6 @@ class SimpleFileSystem : public WebKit::WebFileSystem { WebKit::WebFileSystemCallbacks* callbacks); virtual void remove(const WebKit::WebString& path, WebKit::WebFileSystemCallbacks* callbacks); - virtual void removeRecursively(const WebKit::WebString& path, - WebKit::WebFileSystemCallbacks* callbacks); virtual void readMetadata(const WebKit::WebString& path, WebKit::WebFileSystemCallbacks* callbacks); virtual void createFile(const WebKit::WebString& path, |