Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2229)

Unified Diff: webkit/fileapi/isolated_file_util_unittest.cc

Issue 10713007: Make isolated file system works for a device root (e.g. X:\\) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/fileapi/isolated_file_util_unittest.cc
diff --git a/webkit/fileapi/isolated_file_util_unittest.cc b/webkit/fileapi/isolated_file_util_unittest.cc
index fb54eddbc0b9397dcf521cc37ffb6cb61884e886..fe5f881b41305caab06bef0e183439faf8480179 100644
--- a/webkit/fileapi/isolated_file_util_unittest.cc
+++ b/webkit/fileapi/isolated_file_util_unittest.cc
@@ -76,7 +76,7 @@ class IsolatedFileUtilTest : public testing::Test {
}
void TearDown() {
- isolated_context()->RevokeIsolatedFileSystem(filesystem_id_);
+ isolated_context()->RevokeFileSystem(filesystem_id_);
other_file_util_helper_.TearDown();
}
@@ -100,8 +100,8 @@ class IsolatedFileUtilTest : public testing::Test {
}
FileSystemURL GetFileSystemURL(const FilePath& path) const {
- FilePath virtual_path = isolated_context()->CreateVirtualPath(
- filesystem_id(), path);
+ FilePath virtual_path = isolated_context()->CreateVirtualRootPath(
+ filesystem_id()).Append(path);
return FileSystemURL(GURL("http://example.com"),
kFileSystemTypeIsolated,
virtual_path);
@@ -194,7 +194,7 @@ class IsolatedFileUtilTest : public testing::Test {
void SimulateDropFiles() {
size_t root_path_index = 0;
- std::set<FilePath> toplevels;
+ std::vector<IsolatedContext::FileInfo> toplevels;
for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) {
const test::TestCaseRecord& test_case = test::kRegularTestCases[i];
FilePath path(test_case.path);
@@ -206,14 +206,16 @@ class IsolatedFileUtilTest : public testing::Test {
FilePath root = root_path().Append(
kRootPaths[(root_path_index++) % arraysize(kRootPaths)]);
toplevel_root_map_[toplevel] = root;
- toplevels.insert(root.Append(path));
+ path = root.Append(path);
+ toplevels.push_back(IsolatedContext::FileInfo(
+ IsolatedContext::GetNameForPath(path), path));
}
test::SetUpOneTestCase(toplevel_root_map_[toplevel], test_case);
}
// Register the toplevel entries.
- filesystem_id_ = isolated_context()->RegisterIsolatedFileSystem(toplevels);
+ filesystem_id_ = isolated_context()->RegisterFileSystem(toplevels);
}
ScopedTempDir data_dir_;
@@ -354,7 +356,8 @@ TEST_F(IsolatedFileUtilTest, GetLocalFilePathTest) {
FilePath local_file_path;
EXPECT_EQ(base::PLATFORM_FILE_OK,
file_util()->GetLocalFilePath(&context, url, &local_file_path));
- EXPECT_EQ(GetTestCasePlatformPath(test_case.path), local_file_path);
+ EXPECT_EQ(GetTestCasePlatformPath(test_case.path).value(),
+ local_file_path.value());
}
}

Powered by Google App Engine
This is Rietveld 408576698