| Index: webkit/dom_storage/dom_storage_context_unittest.cc
|
| diff --git a/webkit/dom_storage/dom_storage_context_unittest.cc b/webkit/dom_storage/dom_storage_context_unittest.cc
|
| index 401cc87db1e39eab3fe73c8f09714a8428277fb4..f9432df39633d2403813f297b2f6110cd3b46806 100644
|
| --- a/webkit/dom_storage/dom_storage_context_unittest.cc
|
| +++ b/webkit/dom_storage/dom_storage_context_unittest.cc
|
| @@ -159,4 +159,33 @@ TEST_F(DomStorageContextTest, SetForceKeepSessionState) {
|
| VerifySingleOriginRemains(kSessionOnlyOrigin);
|
| }
|
|
|
| +TEST_F(DomStorageContextTest, PersistentIds) {
|
| + const int kFirstSessionStorageNamespaceId = 1;
|
| + const std::string kPersistentId = "persistent";
|
| + context_->CreateSessionNamespace(kFirstSessionStorageNamespaceId,
|
| + kPersistentId);
|
| + DomStorageNamespace* dom_namespace =
|
| + context_->GetStorageNamespace(kFirstSessionStorageNamespaceId);
|
| + ASSERT_TRUE(dom_namespace);
|
| + EXPECT_EQ(kPersistentId, dom_namespace->persistent_namespace_id());
|
| + // Verify that the areas inherit the persistent ID.
|
| + DomStorageArea* area = dom_namespace->OpenStorageArea(kOrigin);
|
| + EXPECT_EQ(kPersistentId, area->persistent_namespace_id_);
|
| +
|
| + // Verify that the persistent IDs are handled correctly when cloning.
|
| + const int kClonedSessionStorageNamespaceId = 2;
|
| + const std::string kClonedPersistentId = "cloned";
|
| + context_->CloneSessionNamespace(kFirstSessionStorageNamespaceId,
|
| + kClonedSessionStorageNamespaceId,
|
| + kClonedPersistentId);
|
| + DomStorageNamespace* cloned_dom_namespace =
|
| + context_->GetStorageNamespace(kClonedSessionStorageNamespaceId);
|
| + ASSERT_TRUE(dom_namespace);
|
| + EXPECT_EQ(kClonedPersistentId,
|
| + cloned_dom_namespace->persistent_namespace_id());
|
| + // Verify that the areas inherit the persistent ID.
|
| + DomStorageArea* cloned_area = cloned_dom_namespace->OpenStorageArea(kOrigin);
|
| + EXPECT_EQ(kClonedPersistentId, cloned_area->persistent_namespace_id_);
|
| +}
|
| +
|
| } // namespace dom_storage
|
|
|