| 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 a5fc0eb6a8dd9e363f6dec870b1ed7489ed3477c..6ae6f670fab6bd1573a8a8654a71389cc6c8c989 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::RunLoop().RunUntilIdle();
|
| }
|
| -
|
| std::unique_ptr<CookiesTreeModel> CreateCookiesTreeModelWithInitialSample() {
|
| LocalDataContainer* container =
|
| new LocalDataContainer(mock_browsing_data_cookie_helper_,
|
| @@ -1653,4 +1652,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());
|
| +
|
| + 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-so://foobar.host4:4
|
| + // -> http://host4:4
|
| + // host3 -> local storage -> http-so://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-so://foobar.host3:3/,"
|
| + "http-so://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
|
|
|