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

Unified Diff: webkit/fileapi/isolated_context_unittest.cc

Issue 10837217: Add RevokeFileSystem back to IsolatedContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« webkit/fileapi/isolated_context.cc ('K') | « webkit/fileapi/isolated_context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_context_unittest.cc
diff --git a/webkit/fileapi/isolated_context_unittest.cc b/webkit/fileapi/isolated_context_unittest.cc
index ac71aece10b378f1fe86ddd71a46a4b6b4549890..a2e637d170de5b7c72a33c01c79dc5bec9431934 100644
--- a/webkit/fileapi/isolated_context_unittest.cc
+++ b/webkit/fileapi/isolated_context_unittest.cc
@@ -124,11 +124,13 @@ TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
ASSERT_FALSE(isolated_context()->GetRegisteredPath(id_, &path));
ASSERT_TRUE(isolated_context()->GetRegisteredPath(id2, &path));
- // Try registering two more file systems for the same path as id2.
+ // Try registering three more file systems for the same path as id2.
std::string id3 = isolated_context()->RegisterFileSystemForPath(
kFileSystemTypeIsolated, path, NULL);
std::string id4 = isolated_context()->RegisterFileSystemForPath(
kFileSystemTypeIsolated, path, NULL);
+ std::string id5 = isolated_context()->RegisterFileSystemForPath(
+ kFileSystemTypeIsolated, path, NULL);
// Remove file system for id4.
isolated_context()->AddReference(id4);
@@ -138,6 +140,19 @@ TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
ASSERT_TRUE(isolated_context()->GetRegisteredPath(id2, &path));
ASSERT_TRUE(isolated_context()->GetRegisteredPath(id3, &path));
ASSERT_FALSE(isolated_context()->GetRegisteredPath(id4, &path));
+ ASSERT_TRUE(isolated_context()->GetRegisteredPath(id5, &path));
+
+ // Revoke file system id5, after adding multiple references.
+ isolated_context()->AddReference(id5);
+ isolated_context()->AddReference(id5);
+ isolated_context()->AddReference(id5);
+ isolated_context()->RevokeFileSystem(id5);
+
+ // No matter how many references we add id5 must be invalid now.
+ ASSERT_TRUE(isolated_context()->GetRegisteredPath(id2, &path));
+ ASSERT_TRUE(isolated_context()->GetRegisteredPath(id3, &path));
+ ASSERT_FALSE(isolated_context()->GetRegisteredPath(id4, &path));
+ ASSERT_FALSE(isolated_context()->GetRegisteredPath(id5, &path));
// Revoke the file systems by path.
isolated_context()->RevokeFileSystemByPath(path);
@@ -146,6 +161,7 @@ TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
ASSERT_FALSE(isolated_context()->GetRegisteredPath(id2, &path));
ASSERT_FALSE(isolated_context()->GetRegisteredPath(id3, &path));
ASSERT_FALSE(isolated_context()->GetRegisteredPath(id4, &path));
+ ASSERT_FALSE(isolated_context()->GetRegisteredPath(id5, &path));
}
TEST_F(IsolatedContextTest, CrackWithRelativePaths) {
« webkit/fileapi/isolated_context.cc ('K') | « webkit/fileapi/isolated_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698