| Index: chrome/browser/browsing_data/cookies_tree_model_unittest.cc
|
| diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
|
| index 3141e2597d82f00e3004e0aed376e0adf04adb42..cb6fe394f4047d434628f8b7afbda8e5096dcd16 100644
|
| --- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
|
| +++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
|
| @@ -108,7 +108,6 @@ class CookiesTreeModelTest : public testing::Test {
|
| mock_browsing_data_flash_lso_helper_ = nullptr;
|
| base::MessageLoop::current()->RunUntilIdle();
|
| }
|
| -
|
| std::unique_ptr<CookiesTreeModel> CreateCookiesTreeModelWithInitialSample() {
|
| LocalDataContainer* container =
|
| new LocalDataContainer(mock_browsing_data_cookie_helper_.get(),
|
| @@ -1654,4 +1653,44 @@ TEST_F(CookiesTreeModelTest, CookiesFilterWithoutSource) {
|
| EXPECT_EQ("A", GetDisplayedCookies(&cookies_model));
|
| }
|
|
|
| +TEST_F(CookiesTreeModelTest, Suborigins) {
|
| + LocalDataContainer* container =
|
| + new LocalDataContainer(mock_browsing_data_cookie_helper_.get(),
|
| + mock_browsing_data_database_helper_.get(),
|
| + mock_browsing_data_local_storage_helper_.get(),
|
| + mock_browsing_data_session_storage_helper_.get(),
|
| + mock_browsing_data_appcache_helper_.get(),
|
| + mock_browsing_data_indexed_db_helper_.get(),
|
| + mock_browsing_data_file_system_helper_.get(),
|
| + mock_browsing_data_quota_helper_.get(),
|
| + mock_browsing_data_channel_id_helper_.get(),
|
| + mock_browsing_data_service_worker_helper_.get(),
|
| + mock_browsing_data_cache_storage_helper_.get(),
|
| + mock_browsing_data_flash_lso_helper_.get());
|
| + CookiesTreeModel cookies_model(container, special_storage_policy(), false);
|
| +
|
| + mock_browsing_data_local_storage_helper_
|
| + ->AddLocalStorageSamplesWithSuborigins();
|
| + mock_browsing_data_local_storage_helper_->Notify();
|
| + {
|
| + SCOPED_TRACE(
|
| + "Suborigins get their own storage partitions and are folded into their "
|
| + "respective hosts");
|
| + // root
|
| + // host4 -> local storage -> http://foobar_host4:4
|
| + // -> http://host4:4
|
| + // host3 -> local storage -> http://foobar_host3:3
|
| + // host2 -> local storage -> http://host2:2
|
| + // host1 -> local storage -> http://host1:1
|
| + EXPECT_EQ(14, cookies_model.GetRoot()->GetTotalNodeCount());
|
| + EXPECT_EQ(
|
| + "http://host1:1/,http://host2:2/,http://foobar_host3:3/,"
|
| + "http://foobar_host4:4/,http://host4:4/",
|
| + GetDisplayedLocalStorages(&cookies_model));
|
| + // Delete host4, which should delete foobar_host4:4 in addition to host4:4
|
| + DeleteStoredObjects(cookies_model.GetRoot()->GetChild(3));
|
| + EXPECT_EQ(10, cookies_model.GetRoot()->GetTotalNodeCount());
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|