summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_operation_unittest.cc
diff options
context:
space:
mode:
authorericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-12 23:03:29 +0000
committerericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-12 23:03:29 +0000
commit4520c1ef61642fc8130f1cd9de26db892c3da684 (patch)
tree11140eca636e129f8b21f56fd9504ff33f2ec458 /webkit/fileapi/file_system_operation_unittest.cc
parent3e0c664682b788f3093e0528a772b51c72e95a1f (diff)
downloadchromium_src-4520c1ef61642fc8130f1cd9de26db892c3da684.zip
chromium_src-4520c1ef61642fc8130f1cd9de26db892c3da684.tar.gz
chromium_src-4520c1ef61642fc8130f1cd9de26db892c3da684.tar.bz2
Revert 81319 - More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/ [third try lucky,fourth try persistent?], which bounced most recently due to bugs manifestingonly on XP. There are a few changes here that weren't there [infile_system_operation_write_unittest.cc and file_system_operation.cc], butthey're pretty trivial build/test fixes.BUG=none TEST=noneReview URL: http://codereview.chromium.org/6821065
TBR=ericu@google.com Review URL: http://codereview.chromium.org/6836002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_operation_unittest.cc')
-rw-r--r--webkit/fileapi/file_system_operation_unittest.cc121
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 292104b..75c9d31 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()));
@@ -285,7 +272,7 @@ 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(file_util::DirectoryExists(dest_dir.path().Append(
@@ -296,7 +283,9 @@ TEST_F(FileSystemOperationTest, TestMoveSuccessSrcDirRecursive) {
}
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());
}
@@ -308,7 +297,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());
}
@@ -323,7 +312,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());
}
@@ -338,7 +327,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());
}
@@ -353,7 +342,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());
}
@@ -369,7 +358,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());
}
@@ -385,7 +374,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));
@@ -401,7 +390,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));
@@ -414,7 +403,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());
@@ -432,7 +421,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));
@@ -450,7 +439,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(file_util::DirectoryExists(dest_dir.path().Append(
@@ -467,7 +456,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());
}
@@ -479,7 +468,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));
@@ -490,7 +479,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));
@@ -501,7 +490,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());
}
@@ -513,7 +502,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());
}
@@ -522,7 +511,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());
}
@@ -533,7 +522,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());
}
@@ -542,14 +531,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));
@@ -560,7 +549,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));
@@ -569,16 +558,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());
}
@@ -587,11 +576,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);
@@ -599,11 +588,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);
@@ -613,13 +602,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());
}
@@ -629,7 +618,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());
@@ -638,7 +627,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());
@@ -657,7 +646,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());
@@ -679,7 +668,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());
@@ -697,7 +686,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());
@@ -708,7 +697,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()));
@@ -726,7 +715,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()));
@@ -744,7 +733,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);
@@ -752,7 +741,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());
@@ -773,7 +762,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());