summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi
diff options
context:
space:
mode:
authortzik@google.com <tzik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-21 05:22:06 +0000
committertzik@google.com <tzik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-21 05:22:06 +0000
commit4d65c6d9d06dcbb0d4df527049459d4f31c09fc1 (patch)
tree0a623dd870c54c0cb33e961923983635a63df65b /webkit/fileapi
parentf622310d2f63f1842f986448a67483be9aefdec1 (diff)
downloadchromium_src-4d65c6d9d06dcbb0d4df527049459d4f31c09fc1.zip
chromium_src-4d65c6d9d06dcbb0d4df527049459d4f31c09fc1.tar.gz
chromium_src-4d65c6d9d06dcbb0d4df527049459d4f31c09fc1.tar.bz2
Modify error code of move/copy preparation.
ref: https://bugs.webkit.org/show_bug.cgi?id=58864 BUG=None TEST=None Review URL: http://codereview.chromium.org/6881078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r--webkit/fileapi/file_system_file_util.cc4
-rw-r--r--webkit/fileapi/file_system_operation_unittest.cc8
2 files changed, 6 insertions, 6 deletions
diff --git a/webkit/fileapi/file_system_file_util.cc b/webkit/fileapi/file_system_file_util.cc
index 3e4e6c6..a156a84 100644
--- a/webkit/fileapi/file_system_file_util.cc
+++ b/webkit/fileapi/file_system_file_util.cc
@@ -242,12 +242,12 @@ FileSystemFileUtil::PerformCommonCheckAndPreparationForMoveAndCopy(
bool src_is_directory = DirectoryExists(context, src_file_path);
bool dest_is_directory = DirectoryExists(context, dest_file_path);
if (src_is_directory && !dest_is_directory)
- return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY;
+ return base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
// |src_file_path| exists and is a file.
// |dest_file_path| exists and is a directory.
if (!src_is_directory && dest_is_directory)
- return base::PLATFORM_FILE_ERROR_NOT_A_FILE;
+ return base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
// It is an error to copy/move an entry into the same path.
if (src_file_path.value() == dest_file_path.value())
diff --git a/webkit/fileapi/file_system_operation_unittest.cc b/webkit/fileapi/file_system_operation_unittest.cc
index 934504d..0c0fd92 100644
--- a/webkit/fileapi/file_system_operation_unittest.cc
+++ b/webkit/fileapi/file_system_operation_unittest.cc
@@ -175,7 +175,7 @@ TEST_F(FileSystemOperationTest, TestMoveFailureSrcDirExistsDestFile) {
operation()->Move(URLForPath(src_dir.path()), URLForPath(dest_file));
MessageLoop::current()->RunAllPending();
- EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status());
+ EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status());
}
TEST_F(FileSystemOperationTest, TestMoveFailureSrcFileExistsDestNonEmptyDir) {
@@ -205,7 +205,7 @@ TEST_F(FileSystemOperationTest, TestMoveFailureSrcFileExistsDestDir) {
operation()->Move(URLForPath(src_file), URLForPath(dest_dir.path()));
MessageLoop::current()->RunAllPending();
- EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status());
+ EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status());
}
TEST_F(FileSystemOperationTest, TestMoveFailureDestParentDoesntExist) {
@@ -339,7 +339,7 @@ TEST_F(FileSystemOperationTest, TestCopyFailureSrcDirExistsDestFile) {
operation()->Copy(URLForPath(src_dir.path()), URLForPath(dest_file));
MessageLoop::current()->RunAllPending();
- EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status());
+ EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status());
}
TEST_F(FileSystemOperationTest, TestCopyFailureSrcFileExistsDestNonEmptyDir) {
@@ -369,7 +369,7 @@ TEST_F(FileSystemOperationTest, TestCopyFailureSrcFileExistsDestDir) {
operation()->Copy(URLForPath(src_file), URLForPath(dest_dir.path()));
MessageLoop::current()->RunAllPending();
- EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status());
+ EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status());
}
TEST_F(FileSystemOperationTest, TestCopyFailureDestParentDoesntExist) {