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

Unified Diff: webkit/fileapi/isolated_context_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_context_unittest.cc
diff --git a/webkit/fileapi/isolated_context_unittest.cc b/webkit/fileapi/isolated_context_unittest.cc
index ee54557f68b68dfde51fe98d09e4e7af738a68fa..92c5b56320e27c43a01915f1688c361959eb1b07 100644
--- a/webkit/fileapi/isolated_context_unittest.cc
+++ b/webkit/fileapi/isolated_context_unittest.cc
@@ -51,9 +51,13 @@ class IsolatedContextTest : public testing::Test {
void SetUp() {
IsolatedContext::FileInfoSet files;
- for (size_t i = 0; i < arraysize(kTestPaths); ++i)
- names_.push_back(files.AddPath(kTestPaths[i].NormalizePathSeparators()));
- id_ = IsolatedContext::GetInstance()->RegisterFileSystem(files);
+ for (size_t i = 0; i < arraysize(kTestPaths); ++i) {
+ std::string name;
+ ASSERT_TRUE(
+ files.AddPath(kTestPaths[i].NormalizePathSeparators(), &name));
+ names_.push_back(name);
+ }
+ id_ = IsolatedContext::GetInstance()->RegisterDraggedFileSystem(files);
ASSERT_FALSE(id_.empty());
}
@@ -77,14 +81,14 @@ class IsolatedContextTest : public testing::Test {
TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
// See if the returned top-level entries match with what we registered.
std::vector<FileInfo> toplevels;
- ASSERT_TRUE(isolated_context()->GetRegisteredFileInfo(id_, &toplevels));
+ ASSERT_TRUE(isolated_context()->GetDraggedFileInfo(id_, &toplevels));
ASSERT_EQ(fileset_.size(), toplevels.size());
for (size_t i = 0; i < toplevels.size(); ++i) {
ASSERT_TRUE(fileset_.find(toplevels[i].path) != fileset_.end());
}
// See if the name of each registered kTestPaths (that is what we
- // register in SetUp() by RegisterFileSystem) is properly cracked as
+ // register in SetUp() by RegisterDraggedFileSystem) is properly cracked as
// a valid virtual path in the isolated filesystem.
for (size_t i = 0; i < arraysize(kTestPaths); ++i) {
FilePath virtual_path = isolated_context()->CreateVirtualRootPath(id_)
@@ -101,14 +105,23 @@ TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
ASSERT_EQ(id_, cracked_id);
}
- // Revoking the current one and registering a new (empty) one.
+ // Make sure GetRegisteredPath returns false for id_ since it is
+ // registered for dragged files.
+ FilePath path;
+ ASSERT_FALSE(isolated_context()->GetRegisteredPath(id_, &path));
+
+ // Revoking the current one and registering a new one.
isolated_context()->RevokeFileSystem(id_);
- std::string id2 = isolated_context()->RegisterFileSystem(
- IsolatedContext::FileInfoSet());
+ std::string id2 = isolated_context()->RegisterFileSystemForPath(
+ kFileSystemTypeIsolated, FilePath(DRIVE FPL("/foo")), NULL);
+
+ // Make sure the GetDraggedFileInfo returns false for both ones.
+ ASSERT_FALSE(isolated_context()->GetDraggedFileInfo(id2, &toplevels));
+ ASSERT_FALSE(isolated_context()->GetDraggedFileInfo(id_, &toplevels));
- // Make sure the GetRegisteredFileInfo returns true only for the new one.
- ASSERT_TRUE(isolated_context()->GetRegisteredFileInfo(id2, &toplevels));
- ASSERT_FALSE(isolated_context()->GetRegisteredFileInfo(id_, &toplevels));
+ // Make sure the GetRegisteredPath returns true only for the new one.
+ ASSERT_TRUE(isolated_context()->GetRegisteredPath(id2, &path));
+ ASSERT_FALSE(isolated_context()->GetRegisteredPath(id_, &path));
isolated_context()->RevokeFileSystem(id2);
}

Powered by Google App Engine
This is Rietveld 408576698