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

Unified Diff: content/browser/dom_storage/dom_storage_context_impl_unittest.cc

Issue 881253004: offset namespace ids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/dom_storage/dom_storage_context_impl_unittest.cc
diff --git a/content/browser/dom_storage/dom_storage_context_impl_unittest.cc b/content/browser/dom_storage/dom_storage_context_impl_unittest.cc
index 7d6cd0dec360facc33ad15fb991cf37d8534b71d..9ea46028b6f5b90a930775fd9f71fb0e0c79e84b 100644
--- a/content/browser/dom_storage/dom_storage_context_impl_unittest.cc
+++ b/content/browser/dom_storage/dom_storage_context_impl_unittest.cc
@@ -63,6 +63,8 @@ class DOMStorageContextImplTest : public testing::Test {
EXPECT_EQ(origin, infos[0].origin);
}
+ int session_id_offset() { return context_->session_id_offset_; }
+
protected:
base::MessageLoop message_loop_;
base::ScopedTempDir temp_dir_;
@@ -80,7 +82,7 @@ TEST_F(DOMStorageContextImplTest, Basics) {
EXPECT_EQ(base::FilePath(), context_->sessionstorage_directory());
EXPECT_EQ(storage_policy_.get(), context_->special_storage_policy_.get());
context_->DeleteLocalStorage(GURL("http://chromium.org/"));
- const int kFirstSessionStorageNamespaceId = 1;
+ const int kFirstSessionStorageNamespaceId = 1 + session_id_offset();
EXPECT_TRUE(context_->GetStorageNamespace(kLocalStorageNamespaceId));
EXPECT_FALSE(context_->GetStorageNamespace(kFirstSessionStorageNamespaceId));
EXPECT_EQ(kFirstSessionStorageNamespaceId, context_->AllocateSessionId());
@@ -162,7 +164,7 @@ TEST_F(DOMStorageContextImplTest, SetForceKeepSessionState) {
}
TEST_F(DOMStorageContextImplTest, PersistentIds) {
- const int kFirstSessionStorageNamespaceId = 1;
+ const int kFirstSessionStorageNamespaceId = 1 + session_id_offset();
const std::string kPersistentId = "persistent";
context_->CreateSessionNamespace(kFirstSessionStorageNamespaceId,
kPersistentId);
@@ -175,7 +177,7 @@ TEST_F(DOMStorageContextImplTest, PersistentIds) {
EXPECT_EQ(kPersistentId, area->persistent_namespace_id_);
// Verify that the persistent IDs are handled correctly when cloning.
- const int kClonedSessionStorageNamespaceId = 2;
+ const int kClonedSessionStorageNamespaceId = 2 + session_id_offset();
const std::string kClonedPersistentId = "cloned";
context_->CloneSessionNamespace(kFirstSessionStorageNamespaceId,
kClonedSessionStorageNamespaceId,
@@ -200,7 +202,7 @@ TEST_F(DOMStorageContextImplTest, DeleteSessionStorage) {
ASSERT_EQ(temp_dir_.path(), context_->sessionstorage_directory());
// Write data.
- const int kSessionStorageNamespaceId = 1;
+ const int kSessionStorageNamespaceId = 1 + session_id_offset();
const std::string kPersistentId = "persistent";
context_->CreateSessionNamespace(kSessionStorageNamespaceId,
kPersistentId);
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698