diff options
Diffstat (limited to 'webkit/fileapi/file_system_operation_unittest.cc')
-rw-r--r-- | webkit/fileapi/file_system_operation_unittest.cc | 121 |
1 files changed, 55 insertions, 66 deletions
diff --git a/webkit/fileapi/file_system_operation_unittest.cc b/webkit/fileapi/file_system_operation_unittest.cc index 310b837..69a79fe 100644 --- a/webkit/fileapi/file_system_operation_unittest.cc +++ b/webkit/fileapi/file_system_operation_unittest.cc @@ -56,16 +56,6 @@ class FileSystemOperationTest : public testing::Test { // Common temp base for nondestructive uses. ScopedTempDir base_; - GURL URLForRelativePath(const std::string& path) const { - // Only the path will actually get used. - return GURL("file://").Resolve(base_.path().value()).Resolve(path); - } - - GURL URLForPath(const FilePath& path) const { - // Only the path will actually get used. - return GURL("file://").Resolve(path.value()); - } - // For post-operation status. int status_; base::PlatformFileInfo info_; @@ -101,7 +91,7 @@ class MockDispatcher : public FileSystemCallbackDispatcher { test_->set_entries(entries); } - virtual void DidOpenFileSystem(const std::string&, const GURL&) { + virtual void DidOpenFileSystem(const std::string&, const FilePath&) { NOTREACHED(); } @@ -123,15 +113,12 @@ FileSystemOperation* FileSystemOperationTest::operation() { kFileSystemTypeTemporary); operation->file_system_operation_context()->set_dest_type( kFileSystemTypeTemporary); - GURL origin_url("fake://fake.foo/"); - operation->file_system_operation_context()->set_src_origin_url(origin_url); - operation->file_system_operation_context()->set_dest_origin_url(origin_url); return operation; } TEST_F(FileSystemOperationTest, TestMoveFailureSrcDoesntExist) { - GURL src(URLForRelativePath("a")); - GURL dest(URLForRelativePath("b")); + FilePath src(base_.path().Append(FILE_PATH_LITERAL("a"))); + FilePath dest(base_.path().Append(FILE_PATH_LITERAL("b"))); operation()->Move(src, dest); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); @@ -144,7 +131,7 @@ TEST_F(FileSystemOperationTest, TestMoveFailureContainsPath) { ASSERT_TRUE(file_util::CreateTemporaryDirInDir(src_dir.path(), FILE_PATH_LITERAL("child_dir"), &dest_dir_path)); - operation()->Move(URLForPath(src_dir.path()), URLForPath(dest_dir_path)); + operation()->Move(src_dir.path(), dest_dir_path); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); } @@ -159,7 +146,7 @@ TEST_F(FileSystemOperationTest, TestMoveFailureSrcDirExistsDestFile) { FilePath dest_file; file_util::CreateTemporaryFileInDir(dest_dir.path(), &dest_file); - operation()->Move(URLForPath(src_dir.path()), URLForPath(dest_file)); + operation()->Move(src_dir.path(), dest_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status()); } @@ -174,7 +161,7 @@ TEST_F(FileSystemOperationTest, TestMoveFailureSrcFileExistsDestNonEmptyDir) { FilePath child_file; file_util::CreateTemporaryFileInDir(dest_dir.path(), &child_file); - operation()->Move(URLForPath(src_dir.path()), URLForPath(dest_dir.path())); + operation()->Move(src_dir.path(), dest_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); } @@ -189,7 +176,7 @@ TEST_F(FileSystemOperationTest, TestMoveFailureSrcFileExistsDestDir) { ScopedTempDir dest_dir; ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - operation()->Move(URLForPath(src_file), URLForPath(dest_dir.path())); + operation()->Move(src_file, dest_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status()); } @@ -202,7 +189,7 @@ TEST_F(FileSystemOperationTest, TestMoveFailureDestParentDoesntExist) { FILE_PATH_LITERAL("NonexistingDir")).Append( FILE_PATH_LITERAL("NonexistingFile")); - operation()->Move(URLForPath(src_dir.path()), URLForPath(nonexisting_file)); + operation()->Move(src_dir.path(), nonexisting_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); } @@ -218,7 +205,7 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcFileAndOverwrite) { FilePath dest_file; file_util::CreateTemporaryFileInDir(dest_dir.path(), &dest_file); - operation()->Move(URLForPath(src_file), URLForPath(dest_file)); + operation()->Move(src_file, dest_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(FileExists(dest_file)); @@ -234,7 +221,7 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcFileAndNew) { ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); FilePath dest_file(dest_dir.path().Append(FILE_PATH_LITERAL("NewFile"))); - operation()->Move(URLForPath(src_file), URLForPath(dest_file)); + operation()->Move(src_file, dest_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(FileExists(dest_file)); @@ -247,7 +234,7 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirAndOverwrite) { ScopedTempDir dest_dir; ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - operation()->Move(URLForPath(src_dir.path()), URLForPath(dest_dir.path())); + operation()->Move(src_dir.path(), dest_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_FALSE(file_util::DirectoryExists(src_dir.path())); @@ -266,7 +253,7 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirAndNew) { ASSERT_TRUE(dir.CreateUniqueTempDir()); FilePath dest_dir_path(dir.path().Append(FILE_PATH_LITERAL("NewDirectory"))); - operation()->Move(URLForPath(src_dir.path()), URLForPath(dest_dir_path)); + operation()->Move(src_dir.path(), dest_dir_path); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_FALSE(file_util::DirectoryExists(src_dir.path())); @@ -282,14 +269,16 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirRecursive) { ScopedTempDir dest_dir; ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - operation()->Move(URLForPath(src_dir.path()), URLForPath(dest_dir.path())); + 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()))); } TEST_F(FileSystemOperationTest, TestCopyFailureSrcDoesntExist) { - operation()->Copy(URLForRelativePath("a"), URLForRelativePath("b")); + FilePath src(base_.path().Append(FILE_PATH_LITERAL("a"))); + FilePath dest(base_.path().Append(FILE_PATH_LITERAL("b"))); + operation()->Copy(src, dest); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); } @@ -301,7 +290,7 @@ TEST_F(FileSystemOperationTest, TestCopyFailureContainsPath) { ASSERT_TRUE(file_util::CreateTemporaryDirInDir(src_dir.path(), FILE_PATH_LITERAL("child_dir"), &dest_dir_path)); - operation()->Copy(URLForPath(src_dir.path()), URLForPath(dest_dir_path)); + operation()->Copy(src_dir.path(), dest_dir_path); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); } @@ -316,7 +305,7 @@ TEST_F(FileSystemOperationTest, TestCopyFailureSrcDirExistsDestFile) { FilePath dest_file; file_util::CreateTemporaryFileInDir(dest_dir.path(), &dest_file); - operation()->Copy(URLForPath(src_dir.path()), URLForPath(dest_file)); + operation()->Copy(src_dir.path(), dest_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status()); } @@ -331,7 +320,7 @@ TEST_F(FileSystemOperationTest, TestCopyFailureSrcFileExistsDestNonEmptyDir) { FilePath child_file; file_util::CreateTemporaryFileInDir(dest_dir.path(), &child_file); - operation()->Copy(URLForPath(src_dir.path()), URLForPath(dest_dir.path())); + operation()->Copy(src_dir.path(), dest_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); } @@ -346,7 +335,7 @@ TEST_F(FileSystemOperationTest, TestCopyFailureSrcFileExistsDestDir) { ScopedTempDir dest_dir; ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - operation()->Copy(URLForPath(src_file), URLForPath(dest_dir.path())); + operation()->Copy(src_file, dest_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status()); } @@ -362,7 +351,7 @@ TEST_F(FileSystemOperationTest, TestCopyFailureDestParentDoesntExist) { FilePath nonexisting_file = nonexisting.Append( FILE_PATH_LITERAL("DontExistFile")); - operation()->Copy(URLForPath(src_dir), URLForPath(nonexisting_file)); + operation()->Copy(src_dir, nonexisting_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); } @@ -378,7 +367,7 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcFileAndOverwrite) { FilePath dest_file; file_util::CreateTemporaryFileInDir(dest_dir.path(), &dest_file); - operation()->Copy(URLForPath(src_file), URLForPath(dest_file)); + operation()->Copy(src_file, dest_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(FileExists(dest_file)); @@ -394,7 +383,7 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcFileAndNew) { ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); FilePath dest_file(dest_dir.path().Append(FILE_PATH_LITERAL("NewFile"))); - operation()->Copy(URLForPath(src_file), URLForPath(dest_file)); + operation()->Copy(src_file, dest_file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(FileExists(dest_file)); @@ -407,7 +396,7 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirAndOverwrite) { ScopedTempDir dest_dir; ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - operation()->Copy(URLForPath(src_dir.path()), URLForPath(dest_dir.path())); + operation()->Copy(src_dir.path(), dest_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); @@ -425,7 +414,7 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirAndNew) { ASSERT_TRUE(dir.CreateUniqueTempDir()); FilePath dest_dir(dir.path().Append(FILE_PATH_LITERAL("NewDirectory"))); - operation()->Copy(URLForPath(src_dir.path()), URLForPath(dest_dir)); + operation()->Copy(src_dir.path(), dest_dir); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(file_util::DirectoryExists(dest_dir)); @@ -440,7 +429,7 @@ TEST_F(FileSystemOperationTest, TestCopySuccessSrcDirRecursive) { ScopedTempDir dest_dir; ASSERT_TRUE(dest_dir.CreateUniqueTempDir()); - operation()->Copy(URLForPath(src_dir.path()), URLForPath(dest_dir.path())); + 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()))); @@ -453,7 +442,7 @@ TEST_F(FileSystemOperationTest, TestCreateFileFailure) { FilePath file; file_util::CreateTemporaryFileInDir(dir.path(), &file); - operation()->CreateFile(URLForPath(file), true); + operation()->CreateFile(file, true); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); } @@ -465,7 +454,7 @@ TEST_F(FileSystemOperationTest, TestCreateFileSuccessFileExists) { FilePath file; file_util::CreateTemporaryFileInDir(dir.path(), &file); - operation()->CreateFile(URLForPath(file), false); + operation()->CreateFile(file, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(FileExists(file)); @@ -476,7 +465,7 @@ TEST_F(FileSystemOperationTest, TestCreateFileSuccessExclusive) { ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); FilePath file = dir.path().Append(FILE_PATH_LITERAL("FileDoesntExist")); - operation()->CreateFile(URLForPath(file), true); + operation()->CreateFile(file, true); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(FileExists(file)); @@ -487,7 +476,7 @@ TEST_F(FileSystemOperationTest, TestCreateFileSuccessFileDoesntExist) { ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); FilePath file = dir.path().Append(FILE_PATH_LITERAL("FileDoesntExist")); - operation()->CreateFile(URLForPath(file), false); + operation()->CreateFile(file, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); } @@ -499,7 +488,7 @@ TEST_F(FileSystemOperationTest, FILE_PATH_LITERAL("DirDoesntExist"))); FilePath nonexisting_file = nonexisting.Append( FILE_PATH_LITERAL("FileDoesntExist")); - operation()->CreateDirectory(URLForPath(nonexisting_file), false, false); + operation()->CreateDirectory(nonexisting_file, false, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); } @@ -508,7 +497,7 @@ TEST_F(FileSystemOperationTest, TestCreateDirFailureDirExists) { // Exclusive and dir existing at path. ScopedTempDir src_dir; ASSERT_TRUE(src_dir.CreateUniqueTempDir()); - operation()->CreateDirectory(URLForPath(src_dir.path()), true, false); + operation()->CreateDirectory(src_dir.path(), true, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); } @@ -519,7 +508,7 @@ TEST_F(FileSystemOperationTest, TestCreateDirFailureFileExists) { ASSERT_TRUE(dir.CreateUniqueTempDir()); FilePath file; file_util::CreateTemporaryFileInDir(dir.path(), &file); - operation()->CreateDirectory(URLForPath(file), true, false); + operation()->CreateDirectory(file, true, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); } @@ -528,14 +517,14 @@ TEST_F(FileSystemOperationTest, TestCreateDirSuccess) { // Dir exists and exclusive is false. ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); - operation()->CreateDirectory(URLForPath(dir.path()), false, false); + operation()->CreateDirectory(dir.path(), false, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); // Dir doesn't exist. FilePath nonexisting_dir_path(base_.path().Append( FILE_PATH_LITERAL("nonexistingdir"))); - operation()->CreateDirectory(URLForPath(nonexisting_dir_path), false, false); + operation()->CreateDirectory(nonexisting_dir_path, false, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(file_util::DirectoryExists(nonexisting_dir_path)); @@ -546,7 +535,7 @@ TEST_F(FileSystemOperationTest, TestCreateDirSuccessExclusive) { FilePath nonexisting_dir_path(base_.path().Append( FILE_PATH_LITERAL("nonexistingdir"))); - operation()->CreateDirectory(URLForPath(nonexisting_dir_path), true, false); + operation()->CreateDirectory(nonexisting_dir_path, true, false); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(file_util::DirectoryExists(nonexisting_dir_path)); @@ -555,16 +544,16 @@ TEST_F(FileSystemOperationTest, TestCreateDirSuccessExclusive) { TEST_F(FileSystemOperationTest, TestExistsAndMetadataFailure) { FilePath nonexisting_dir_path(base_.path().Append( FILE_PATH_LITERAL("nonexistingdir"))); - operation()->GetMetadata(URLForPath(nonexisting_dir_path)); + operation()->GetMetadata(nonexisting_dir_path); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); - operation()->FileExists(URLForPath(nonexisting_dir_path)); + operation()->FileExists(nonexisting_dir_path); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); file_util::EnsureEndsWithSeparator(&nonexisting_dir_path); - operation()->DirectoryExists(URLForPath(nonexisting_dir_path)); + operation()->DirectoryExists(nonexisting_dir_path); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); } @@ -573,11 +562,11 @@ TEST_F(FileSystemOperationTest, TestExistsAndMetadataSuccess) { ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); - operation()->DirectoryExists(URLForPath(dir.path())); + operation()->DirectoryExists(dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); - operation()->GetMetadata(URLForPath(dir.path())); + operation()->GetMetadata(dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_TRUE(info().is_directory); @@ -585,11 +574,11 @@ TEST_F(FileSystemOperationTest, TestExistsAndMetadataSuccess) { FilePath file; file_util::CreateTemporaryFileInDir(dir.path(), &file); - operation()->FileExists(URLForPath(file)); + operation()->FileExists(file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); - operation()->GetMetadata(URLForPath(file)); + operation()->GetMetadata(file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_FALSE(info().is_directory); @@ -599,13 +588,13 @@ TEST_F(FileSystemOperationTest, TestExistsAndMetadataSuccess) { TEST_F(FileSystemOperationTest, TestTypeMismatchErrors) { ScopedTempDir dir; ASSERT_TRUE(dir.CreateUniqueTempDir()); - operation()->FileExists(URLForPath(dir.path())); + operation()->FileExists(dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status()); FilePath file; ASSERT_TRUE(file_util::CreateTemporaryFileInDir(dir.path(), &file)); - operation()->DirectoryExists(URLForPath(file)); + operation()->DirectoryExists(file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status()); } @@ -615,7 +604,7 @@ TEST_F(FileSystemOperationTest, TestReadDirFailure) { FilePath nonexisting_dir_path(base_.path().Append( FILE_PATH_LITERAL("NonExistingDir"))); file_util::EnsureEndsWithSeparator(&nonexisting_dir_path); - operation()->ReadDirectory(URLForPath(nonexisting_dir_path)); + operation()->ReadDirectory(nonexisting_dir_path); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); @@ -624,7 +613,7 @@ TEST_F(FileSystemOperationTest, TestReadDirFailure) { ASSERT_TRUE(dir.CreateUniqueTempDir()); FilePath file; file_util::CreateTemporaryFileInDir(dir.path(), &file); - operation()->ReadDirectory(URLForPath(file)); + operation()->ReadDirectory(file); MessageLoop::current()->RunAllPending(); // TODO(kkanetkar) crbug.com/54309 to change the error code. EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); @@ -643,7 +632,7 @@ TEST_F(FileSystemOperationTest, TestReadDirSuccess) { ASSERT_TRUE(file_util::CreateTemporaryDirInDir( parent_dir.path(), FILE_PATH_LITERAL("child_dir"), &child_dir)); - operation()->ReadDirectory(URLForPath(parent_dir.path())); + operation()->ReadDirectory(parent_dir.path()); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationStatusNotSet, status()); EXPECT_EQ(2u, entries().size()); @@ -665,7 +654,7 @@ TEST_F(FileSystemOperationTest, TestRemoveFailure) { FILE_PATH_LITERAL("NonExistingDir"))); file_util::EnsureEndsWithSeparator(&nonexisting); - operation()->Remove(URLForPath(nonexisting), false /* recursive */); + operation()->Remove(nonexisting, false /* recursive */); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); @@ -683,7 +672,7 @@ TEST_F(FileSystemOperationTest, TestRemoveFailure) { ASSERT_TRUE(file_util::CreateTemporaryDirInDir( parent_dir.path(), FILE_PATH_LITERAL("child_dir"), &child_dir)); - operation()->Remove(URLForPath(parent_dir.path()), false /* recursive */); + operation()->Remove(parent_dir.path(), false /* recursive */); MessageLoop::current()->RunAllPending(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); @@ -694,7 +683,7 @@ TEST_F(FileSystemOperationTest, TestRemoveSuccess) { ASSERT_TRUE(empty_dir.CreateUniqueTempDir()); EXPECT_TRUE(file_util::DirectoryExists(empty_dir.path())); - operation()->Remove(URLForPath(empty_dir.path()), false /* recursive */); + operation()->Remove(empty_dir.path(), false /* recursive */); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_FALSE(file_util::DirectoryExists(empty_dir.path())); @@ -712,7 +701,7 @@ TEST_F(FileSystemOperationTest, TestRemoveSuccess) { ASSERT_TRUE(file_util::CreateTemporaryDirInDir( parent_dir.path(), FILE_PATH_LITERAL("child_dir"), &child_dir)); - operation()->Remove(URLForPath(parent_dir.path()), true /* recursive */); + operation()->Remove(parent_dir.path(), true /* recursive */); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_FALSE(file_util::DirectoryExists(parent_dir.path())); @@ -730,7 +719,7 @@ TEST_F(FileSystemOperationTest, TestTruncate) { file_util::WriteFile(file, test_data, data_size)); // Check that its length is the size of the data written. - operation()->GetMetadata(URLForPath(file)); + operation()->GetMetadata(file); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); EXPECT_FALSE(info().is_directory); @@ -738,7 +727,7 @@ TEST_F(FileSystemOperationTest, TestTruncate) { // Extend the file by truncating it. int length = 17; - operation()->Truncate(URLForPath(file), length); + operation()->Truncate(file, length); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); @@ -759,7 +748,7 @@ TEST_F(FileSystemOperationTest, TestTruncate) { // Shorten the file by truncating it. length = 3; - operation()->Truncate(URLForPath(file), length); + operation()->Truncate(file, length); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kFileOperationSucceeded, status()); |