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

Unified Diff: webkit/fileapi/isolated_file_util_unittest.cc

Issue 10810053: Enables internal filesystem types via Isolated filesystems (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 33bf01061d3850eaea166e43f6305b8b26571393..cfecc49f41011edd2827ab3f66475134a09ae9f6 100644
--- a/webkit/fileapi/isolated_file_util_unittest.cc
+++ b/webkit/fileapi/isolated_file_util_unittest.cc
@@ -50,13 +50,15 @@ FilePath GetTopLevelPath(const FilePath& path) {
} // namespace
+// TODO(kinuko): we should have separate tests for DraggedFileUtil and
+// IsolatedFileUtil.
class IsolatedFileUtilTest : public testing::Test {
public:
IsolatedFileUtilTest() {}
void SetUp() {
ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
- file_util_.reset(new IsolatedFileUtil());
+ file_util_.reset(new DraggedFileUtil());
// Register the files/directories of RegularTestCases (with random
// root paths) as dropped files.
@@ -206,14 +208,14 @@ class IsolatedFileUtilTest : public testing::Test {
FilePath root = root_path().Append(
kRootPaths[(root_path_index++) % arraysize(kRootPaths)]);
toplevel_root_map_[toplevel] = root;
- toplevels.AddPath(root.Append(path));
+ toplevels.AddPath(root.Append(path), NULL);
}
test::SetUpOneTestCase(toplevel_root_map_[toplevel], test_case);
}
// Register the toplevel entries.
- filesystem_id_ = isolated_context()->RegisterFileSystem(toplevels);
+ filesystem_id_ = isolated_context()->RegisterDraggedFileSystem(toplevels);
}
ScopedTempDir data_dir_;
@@ -394,14 +396,6 @@ TEST_F(IsolatedFileUtilTest, CopyOutFileTest) {
file_util(), other_file_util(),
src_url, dest_url));
- // The other way (copy-in) should not work.
- context.reset(new FileSystemOperationContext(file_system_context()));
- ASSERT_EQ(base::PLATFORM_FILE_ERROR_SECURITY,
- FileUtilHelper::Copy(
- context.get(),
- other_file_util(), file_util(),
- dest_url, src_url));
-
VerifyFilesHaveSameContent(file_util(), other_file_util(),
src_url, dest_url);
}
@@ -442,15 +436,6 @@ TEST_F(IsolatedFileUtilTest, CopyOutDirectoryTest) {
file_util(), other_file_util(),
src_url, dest_url));
- // The other way (copy-in) should not work for two reasons:
- // write is prohibited in the isolated filesystem, and copying directory
- // to non-empty directory shouldn't work.
- context.reset(new FileSystemOperationContext(file_system_context()));
- base::PlatformFileError result = FileUtilHelper::Copy(
- context.get(), other_file_util(), file_util(), dest_url, src_url);
- ASSERT_TRUE(result == base::PLATFORM_FILE_ERROR_FAILED ||
- result == base::PLATFORM_FILE_ERROR_NOT_EMPTY);
-
VerifyDirectoriesHaveSameContent(file_util(), other_file_util(),
src_url, dest_url);
}

Powered by Google App Engine
This is Rietveld 408576698