diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 06:19:42 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 06:19:42 +0000 |
commit | e42c4d260d85a91ef08bfd84ab0dc0423ff3c99f (patch) | |
tree | e9d4225616d1108616380571e00c5d4a8eaee837 | |
parent | d292409206bdfee695b72eae60279a15acb0acd8 (diff) | |
download | chromium_src-e42c4d260d85a91ef08bfd84ab0dc0423ff3c99f.zip chromium_src-e42c4d260d85a91ef08bfd84ab0dc0423ff3c99f.tar.gz chromium_src-e42c4d260d85a91ef08bfd84ab0dc0423ff3c99f.tar.bz2 |
Marks Test{Move,Copy}FailureContainsPath FAILS on Windows, also makes a fix attempt for the failure.
This patch also contains an attempt to fix the failure.
TBR=ericu
BUG=none
TEST=green bot
Review URL: http://codereview.chromium.org/3516014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61481 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/file_util_proxy.cc | 2 | ||||
-rw-r--r-- | webkit/fileapi/file_system_operation_unittest.cc | 22 |
2 files changed, 18 insertions, 6 deletions
diff --git a/base/file_util_proxy.cc b/base/file_util_proxy.cc index 6d16043..b3b18f8 100644 --- a/base/file_util_proxy.cc +++ b/base/file_util_proxy.cc @@ -27,7 +27,7 @@ static base::PlatformFileError PerformCommonCheckAndPreparationForMoveAndCopy( return base::PLATFORM_FILE_ERROR_NOT_FOUND; // It is an error to try to copy/move an entry into its child. - if (file_util::ContainsPath(src_file_path, dest_file_path)) + if (src_file_path.IsParent(dest_file_path)) return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; // Now it is ok to return if the |dest_file_path| does not exist. diff --git a/webkit/fileapi/file_system_operation_unittest.cc b/webkit/fileapi/file_system_operation_unittest.cc index 7e33cce..8ee4ac6 100644 --- a/webkit/fileapi/file_system_operation_unittest.cc +++ b/webkit/fileapi/file_system_operation_unittest.cc @@ -110,8 +110,14 @@ TEST_F(FileSystemOperationTest, TestMoveFailureSrcDoesntExist) { EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } - -TEST_F(FileSystemOperationTest, TestMoveFailureContainsPath) { +// crbug.com/57940 +#if defined(OS_WINDOWS) +#define MAYBE_TestMoveFailureContainsPath FAILS_TestMoveFailureContainsPath +#else +#define MAYBE_TestMoveFailureContainsPath TestMoveFailureContainsPath +#endif + +TEST_F(FileSystemOperationTest, MAYBE_TestMoveFailureContainsPath) { ScopedTempDir src_dir; ASSERT_TRUE(src_dir.CreateUniqueTempDir()); FilePath dest_dir_path; @@ -283,7 +289,14 @@ TEST_F(FileSystemOperationTest, TestCopyFailureSrcDoesntExist) { EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); } -TEST_F(FileSystemOperationTest, TestCopyFailureContainsPath) { +// crbug.com/57940 +#if defined(OS_WINDOWS) +#define MAYBE_TestCopyFailureContainsPath FAILS_TestCopyFailureContainsPath +#else +#define MAYBE_TestCopyFailureContainsPath TestCopyFailureContainsPath +#endif + +TEST_F(FileSystemOperationTest, MAYBE_TestCopyFailureContainsPath) { ScopedTempDir src_dir; ASSERT_TRUE(src_dir.CreateUniqueTempDir()); FilePath dest_dir_path; @@ -761,7 +774,7 @@ TEST_F(FileSystemOperationTest, TestTruncate) { char data[100]; EXPECT_EQ(length, file_util::ReadFile(file, data, length)); for (int i = 0; i < length; ++i) { - if (i < data_size) + if (i < static_cast<int>(sizeof(test_data))) EXPECT_EQ(test_data[i], data[i]); else EXPECT_EQ(0, data[i]); @@ -781,4 +794,3 @@ TEST_F(FileSystemOperationTest, TestTruncate) { for (int i = 0; i < length; ++i) EXPECT_EQ(test_data[i], data[i]); } - |