Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/browsing_data/cookies_tree_model.h" | 5 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/browsing_data/mock_browsing_data_appcache_helper.h" | 12 #include "chrome/browser/browsing_data/mock_browsing_data_appcache_helper.h" |
| 13 #include "chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.h " | 13 #include "chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.h " |
| 14 #include "chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.h" | 14 #include "chrome/browser/browsing_data/mock_browsing_data_channel_id_helper.h" |
| 15 #include "chrome/browser/browsing_data/mock_browsing_data_cookie_helper.h" | 15 #include "chrome/browser/browsing_data/mock_browsing_data_cookie_helper.h" |
| 16 #include "chrome/browser/browsing_data/mock_browsing_data_database_helper.h" | 16 #include "chrome/browser/browsing_data/mock_browsing_data_database_helper.h" |
| 17 #include "chrome/browser/browsing_data/mock_browsing_data_file_system_helper.h" | 17 #include "chrome/browser/browsing_data/mock_browsing_data_file_system_helper.h" |
| 18 #include "chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h" | 18 #include "chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h" |
| 19 #include "chrome/browser/browsing_data/mock_browsing_data_indexed_db_helper.h" | 19 #include "chrome/browser/browsing_data/mock_browsing_data_indexed_db_helper.h" |
| 20 #include "chrome/browser/browsing_data/mock_browsing_data_local_storage_helper.h " | 20 #include "chrome/browser/browsing_data/mock_browsing_data_local_storage_helper.h " |
| 21 #include "chrome/browser/browsing_data/mock_browsing_data_media_license_helper.h " | |
| 21 #include "chrome/browser/browsing_data/mock_browsing_data_quota_helper.h" | 22 #include "chrome/browser/browsing_data/mock_browsing_data_quota_helper.h" |
| 22 #include "chrome/browser/browsing_data/mock_browsing_data_service_worker_helper. h" | 23 #include "chrome/browser/browsing_data/mock_browsing_data_service_worker_helper. h" |
| 23 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 24 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| 24 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 25 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 25 #include "chrome/browser/content_settings/mock_settings_observer.h" | 26 #include "chrome/browser/content_settings/mock_settings_observer.h" |
| 26 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
| 27 #include "components/content_settings/core/browser/cookie_settings.h" | 28 #include "components/content_settings/core/browser/cookie_settings.h" |
| 28 #include "components/content_settings/core/browser/host_content_settings_map.h" | 29 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 29 #include "components/prefs/pref_service.h" | 30 #include "components/prefs/pref_service.h" |
| 30 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 mock_browsing_data_quota_helper_ = | 75 mock_browsing_data_quota_helper_ = |
| 75 new MockBrowsingDataQuotaHelper(profile_.get()); | 76 new MockBrowsingDataQuotaHelper(profile_.get()); |
| 76 mock_browsing_data_channel_id_helper_ = | 77 mock_browsing_data_channel_id_helper_ = |
| 77 new MockBrowsingDataChannelIDHelper(); | 78 new MockBrowsingDataChannelIDHelper(); |
| 78 mock_browsing_data_service_worker_helper_ = | 79 mock_browsing_data_service_worker_helper_ = |
| 79 new MockBrowsingDataServiceWorkerHelper(profile_.get()); | 80 new MockBrowsingDataServiceWorkerHelper(profile_.get()); |
| 80 mock_browsing_data_cache_storage_helper_ = | 81 mock_browsing_data_cache_storage_helper_ = |
| 81 new MockBrowsingDataCacheStorageHelper(profile_.get()); | 82 new MockBrowsingDataCacheStorageHelper(profile_.get()); |
| 82 mock_browsing_data_flash_lso_helper_ = | 83 mock_browsing_data_flash_lso_helper_ = |
| 83 new MockBrowsingDataFlashLSOHelper(profile_.get()); | 84 new MockBrowsingDataFlashLSOHelper(profile_.get()); |
| 85 mock_browsing_data_media_license_helper_ = | |
| 86 new MockBrowsingDataMediaLicenseHelper(profile_.get()); | |
| 84 | 87 |
| 85 const char kExtensionScheme[] = "extensionscheme"; | 88 const char kExtensionScheme[] = "extensionscheme"; |
| 86 scoped_refptr<content_settings::CookieSettings> cookie_settings = | 89 scoped_refptr<content_settings::CookieSettings> cookie_settings = |
| 87 new content_settings::CookieSettings( | 90 new content_settings::CookieSettings( |
| 88 HostContentSettingsMapFactory::GetForProfile(profile_.get()), | 91 HostContentSettingsMapFactory::GetForProfile(profile_.get()), |
| 89 profile_->GetPrefs(), | 92 profile_->GetPrefs(), |
| 90 kExtensionScheme); | 93 kExtensionScheme); |
| 91 #if defined(ENABLE_EXTENSIONS) | 94 #if defined(ENABLE_EXTENSIONS) |
| 92 special_storage_policy_ = | 95 special_storage_policy_ = |
| 93 new ExtensionSpecialStoragePolicy(cookie_settings.get()); | 96 new ExtensionSpecialStoragePolicy(cookie_settings.get()); |
| 94 #endif | 97 #endif |
| 95 } | 98 } |
| 96 | 99 |
| 97 void TearDown() override { | 100 void TearDown() override { |
| 98 mock_browsing_data_service_worker_helper_ = nullptr; | 101 mock_browsing_data_service_worker_helper_ = nullptr; |
| 99 mock_browsing_data_cache_storage_helper_ = nullptr; | 102 mock_browsing_data_cache_storage_helper_ = nullptr; |
| 100 mock_browsing_data_channel_id_helper_ = nullptr; | 103 mock_browsing_data_channel_id_helper_ = nullptr; |
| 101 mock_browsing_data_quota_helper_ = nullptr; | 104 mock_browsing_data_quota_helper_ = nullptr; |
| 102 mock_browsing_data_file_system_helper_ = nullptr; | 105 mock_browsing_data_file_system_helper_ = nullptr; |
| 103 mock_browsing_data_indexed_db_helper_ = nullptr; | 106 mock_browsing_data_indexed_db_helper_ = nullptr; |
| 104 mock_browsing_data_appcache_helper_ = nullptr; | 107 mock_browsing_data_appcache_helper_ = nullptr; |
| 105 mock_browsing_data_session_storage_helper_ = nullptr; | 108 mock_browsing_data_session_storage_helper_ = nullptr; |
| 106 mock_browsing_data_local_storage_helper_ = nullptr; | 109 mock_browsing_data_local_storage_helper_ = nullptr; |
| 107 mock_browsing_data_database_helper_ = nullptr; | 110 mock_browsing_data_database_helper_ = nullptr; |
| 108 mock_browsing_data_flash_lso_helper_ = nullptr; | 111 mock_browsing_data_flash_lso_helper_ = nullptr; |
| 112 mock_browsing_data_media_license_helper_ = nullptr; | |
| 109 base::RunLoop().RunUntilIdle(); | 113 base::RunLoop().RunUntilIdle(); |
| 110 } | 114 } |
| 111 | 115 |
| 112 std::unique_ptr<CookiesTreeModel> CreateCookiesTreeModelWithInitialSample() { | 116 std::unique_ptr<CookiesTreeModel> CreateCookiesTreeModelWithInitialSample() { |
| 113 LocalDataContainer* container = | 117 LocalDataContainer* container = |
| 114 new LocalDataContainer(mock_browsing_data_cookie_helper_.get(), | 118 new LocalDataContainer(mock_browsing_data_cookie_helper_.get(), |
| 115 mock_browsing_data_database_helper_.get(), | 119 mock_browsing_data_database_helper_.get(), |
| 116 mock_browsing_data_local_storage_helper_.get(), | 120 mock_browsing_data_local_storage_helper_.get(), |
| 117 mock_browsing_data_session_storage_helper_.get(), | 121 mock_browsing_data_session_storage_helper_.get(), |
| 118 mock_browsing_data_appcache_helper_.get(), | 122 mock_browsing_data_appcache_helper_.get(), |
| 119 mock_browsing_data_indexed_db_helper_.get(), | 123 mock_browsing_data_indexed_db_helper_.get(), |
| 120 mock_browsing_data_file_system_helper_.get(), | 124 mock_browsing_data_file_system_helper_.get(), |
| 121 mock_browsing_data_quota_helper_.get(), | 125 mock_browsing_data_quota_helper_.get(), |
| 122 mock_browsing_data_channel_id_helper_.get(), | 126 mock_browsing_data_channel_id_helper_.get(), |
| 123 mock_browsing_data_service_worker_helper_.get(), | 127 mock_browsing_data_service_worker_helper_.get(), |
| 124 mock_browsing_data_cache_storage_helper_.get(), | 128 mock_browsing_data_cache_storage_helper_.get(), |
| 125 mock_browsing_data_flash_lso_helper_.get()); | 129 mock_browsing_data_flash_lso_helper_.get(), |
| 130 mock_browsing_data_media_license_helper_.get()); | |
| 126 | 131 |
| 127 CookiesTreeModel* cookies_model = | 132 CookiesTreeModel* cookies_model = |
| 128 new CookiesTreeModel(container, special_storage_policy()); | 133 new CookiesTreeModel(container, special_storage_policy()); |
| 129 mock_browsing_data_cookie_helper_-> | 134 mock_browsing_data_cookie_helper_-> |
| 130 AddCookieSamples(GURL("http://foo1"), "A=1"); | 135 AddCookieSamples(GURL("http://foo1"), "A=1"); |
| 131 mock_browsing_data_cookie_helper_-> | 136 mock_browsing_data_cookie_helper_-> |
| 132 AddCookieSamples(GURL("http://foo2"), "B=1"); | 137 AddCookieSamples(GURL("http://foo2"), "B=1"); |
| 133 mock_browsing_data_cookie_helper_-> | 138 mock_browsing_data_cookie_helper_-> |
| 134 AddCookieSamples(GURL("http://foo3"), "C=1"); | 139 AddCookieSamples(GURL("http://foo3"), "C=1"); |
| 135 mock_browsing_data_cookie_helper_->Notify(); | 140 mock_browsing_data_cookie_helper_->Notify(); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 149 "sbc1"); | 154 "sbc1"); |
| 150 mock_browsing_data_channel_id_helper_->AddChannelIDSample( | 155 mock_browsing_data_channel_id_helper_->AddChannelIDSample( |
| 151 "sbc2"); | 156 "sbc2"); |
| 152 mock_browsing_data_channel_id_helper_->Notify(); | 157 mock_browsing_data_channel_id_helper_->Notify(); |
| 153 mock_browsing_data_service_worker_helper_->AddServiceWorkerSamples(); | 158 mock_browsing_data_service_worker_helper_->AddServiceWorkerSamples(); |
| 154 mock_browsing_data_service_worker_helper_->Notify(); | 159 mock_browsing_data_service_worker_helper_->Notify(); |
| 155 mock_browsing_data_cache_storage_helper_->AddCacheStorageSamples(); | 160 mock_browsing_data_cache_storage_helper_->AddCacheStorageSamples(); |
| 156 mock_browsing_data_cache_storage_helper_->Notify(); | 161 mock_browsing_data_cache_storage_helper_->Notify(); |
| 157 mock_browsing_data_flash_lso_helper_->AddFlashLSODomain("xyz.com"); | 162 mock_browsing_data_flash_lso_helper_->AddFlashLSODomain("xyz.com"); |
| 158 mock_browsing_data_flash_lso_helper_->Notify(); | 163 mock_browsing_data_flash_lso_helper_->Notify(); |
| 164 mock_browsing_data_media_license_helper_->AddMediaLicenseSamples(); | |
| 165 mock_browsing_data_media_license_helper_->Notify(); | |
| 159 | 166 |
| 160 { | 167 { |
| 161 SCOPED_TRACE( | 168 SCOPED_TRACE( |
| 162 "Initial State 3 cookies, 2 databases, 2 local storages, " | 169 "Initial State 3 cookies, 2 databases, 2 local storages, " |
| 163 "2 session storages, 2 indexed DBs, 3 filesystems, " | 170 "2 session storages, 2 indexed DBs, 3 filesystems, " |
| 164 "2 quotas, 2 server bound certs, 2 service workers, " | 171 "2 quotas, 2 server bound certs, 2 service workers, " |
| 165 "2 cache storages, 1 Flash LSO"); | 172 "2 cache storages, 1 Flash LSO, 2 media licenses"); |
| 166 // 65 because there's the root, then | 173 // 71 because there's the root, then |
| 167 // cshost1 -> cache storage -> https://cshost1:1/ | 174 // cshost1 -> cache storage -> https://cshost1:1/ |
| 168 // cshost2 -> cache storage -> https://cshost2:2/ | 175 // cshost2 -> cache storage -> https://cshost2:2/ |
| 169 // foo1 -> cookies -> a, | 176 // foo1 -> cookies -> a, |
| 170 // foo2 -> cookies -> b, | 177 // foo2 -> cookies -> b, |
| 171 // foo3 -> cookies -> c, | 178 // foo3 -> cookies -> c, |
| 172 // dbhost1 -> database -> db1, | 179 // gdbhost1 -> database -> db1, |
| 173 // dbhost2 -> database -> db2, | 180 // gdbhost2 -> database -> db2, |
| 174 // host1 -> localstorage -> http://host1:1/, | 181 // host1 -> localstorage -> http://host1:1/, |
| 175 // -> sessionstorage -> http://host1:1/, | 182 // -> sessionstorage -> http://host1:1/, |
| 176 // host2 -> localstorage -> http://host2:2/. | 183 // host2 -> localstorage -> http://host2:2/. |
| 177 // -> sessionstorage -> http://host2:2/, | 184 // -> sessionstorage -> http://host2:2/, |
| 178 // idbhost1 -> indexeddb -> http://idbhost1:1/, | 185 // idbhost1 -> indexeddb -> http://idbhost1:1/, |
| 179 // idbhost2 -> indexeddb -> http://idbhost2:2/, | 186 // idbhost2 -> indexeddb -> http://idbhost2:2/, |
| 180 // fshost1 -> filesystem -> http://fshost1:1/, | 187 // fshost1 -> filesystem -> http://fshost1:1/, |
| 181 // fshost2 -> filesystem -> http://fshost2:1/, | 188 // fshost2 -> filesystem -> http://fshost2:1/, |
| 182 // fshost3 -> filesystem -> http://fshost3:1/, | 189 // fshost3 -> filesystem -> http://fshost3:1/, |
| 190 // media1.com -> media_licenses -> media_license, | |
|
msramek
2016/09/26 18:28:06
The hostname is just "media1", not "media1.com".
jrummell
2016/09/27 18:21:15
Done.
| |
| 191 // media2.com -> media_licenses -> media_license, | |
| 183 // quotahost1 -> quotahost1, | 192 // quotahost1 -> quotahost1, |
| 184 // quotahost2 -> quotahost2, | 193 // quotahost2 -> quotahost2, |
| 185 // sbc1 -> sbcerts -> sbc1, | 194 // sbc1 -> sbcerts -> sbc1, |
| 186 // sbc2 -> sbcerts -> sbc2. | 195 // sbc2 -> sbcerts -> sbc2. |
| 187 // swhost1 -> service worker -> https://swhost1:1 | 196 // swhost1 -> service worker -> https://swhost1:1 |
| 188 // swhost2 -> service worker -> https://swhost1:2 | 197 // swhost2 -> service worker -> https://swhost1:2 |
| 189 // xyz.com -> flash_lsos | 198 // xyz.com -> flash_lsos |
| 190 EXPECT_EQ(65, cookies_model->GetRoot()->GetTotalNodeCount()); | 199 EXPECT_EQ(71, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 191 EXPECT_EQ("A,B,C", GetDisplayedCookies(cookies_model)); | 200 EXPECT_EQ("A,B,C", GetDisplayedCookies(cookies_model)); |
| 192 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model)); | 201 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model)); |
| 193 EXPECT_EQ("http://host1:1/,http://host2:2/", | 202 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 194 GetDisplayedLocalStorages(cookies_model)); | 203 GetDisplayedLocalStorages(cookies_model)); |
| 195 EXPECT_EQ("http://host1:1/,http://host2:2/", | 204 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 196 GetDisplayedSessionStorages(cookies_model)); | 205 GetDisplayedSessionStorages(cookies_model)); |
| 197 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 206 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 198 GetDisplayedIndexedDBs(cookies_model)); | 207 GetDisplayedIndexedDBs(cookies_model)); |
| 199 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 208 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 200 GetDisplayedFileSystems(cookies_model)); | 209 GetDisplayedFileSystems(cookies_model)); |
| 201 EXPECT_EQ("quotahost1,quotahost2", | 210 EXPECT_EQ("quotahost1,quotahost2", |
| 202 GetDisplayedQuotas(cookies_model)); | 211 GetDisplayedQuotas(cookies_model)); |
| 203 EXPECT_EQ("sbc1,sbc2", | 212 EXPECT_EQ("sbc1,sbc2", |
| 204 GetDisplayedChannelIDs(cookies_model)); | 213 GetDisplayedChannelIDs(cookies_model)); |
| 205 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 214 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 206 GetDisplayedServiceWorkers(cookies_model)); | 215 GetDisplayedServiceWorkers(cookies_model)); |
| 207 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 216 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 208 GetDisplayedCacheStorages(cookies_model)); | 217 GetDisplayedCacheStorages(cookies_model)); |
| 209 EXPECT_EQ("xyz.com", | 218 EXPECT_EQ("xyz.com", |
| 210 GetDisplayedFlashLSOs(cookies_model)); | 219 GetDisplayedFlashLSOs(cookies_model)); |
| 220 EXPECT_EQ("https://media1/,https://media2/", | |
| 221 GetDisplayedMediaLicenses(cookies_model)); | |
| 211 } | 222 } |
| 212 return base::WrapUnique(cookies_model); | 223 return base::WrapUnique(cookies_model); |
| 213 } | 224 } |
| 214 | 225 |
| 215 // Checks that, when setting content settings for host nodes in the | 226 // Checks that, when setting content settings for host nodes in the |
| 216 // cookie tree, the content settings are applied to the expected URL. | 227 // cookie tree, the content settings are applied to the expected URL. |
| 217 void CheckContentSettingsUrlForHostNodes( | 228 void CheckContentSettingsUrlForHostNodes( |
| 218 const CookieTreeNode* node, | 229 const CookieTreeNode* node, |
| 219 CookieTreeNode::DetailedInfo::NodeType node_type, | 230 CookieTreeNode::DetailedInfo::NodeType node_type, |
| 220 content_settings::CookieSettings* cookie_settings, | 231 content_settings::CookieSettings* cookie_settings, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 case CookieTreeNode::DetailedInfo::TYPE_QUOTA: | 294 case CookieTreeNode::DetailedInfo::TYPE_QUOTA: |
| 284 return node->GetDetailedInfo().quota_info->host + ","; | 295 return node->GetDetailedInfo().quota_info->host + ","; |
| 285 case CookieTreeNode::DetailedInfo::TYPE_CHANNEL_ID: | 296 case CookieTreeNode::DetailedInfo::TYPE_CHANNEL_ID: |
| 286 return node->GetDetailedInfo().channel_id->server_identifier() + ","; | 297 return node->GetDetailedInfo().channel_id->server_identifier() + ","; |
| 287 case CookieTreeNode::DetailedInfo::TYPE_SERVICE_WORKER: | 298 case CookieTreeNode::DetailedInfo::TYPE_SERVICE_WORKER: |
| 288 return node->GetDetailedInfo().service_worker_info->origin.spec() + ","; | 299 return node->GetDetailedInfo().service_worker_info->origin.spec() + ","; |
| 289 case CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE: | 300 case CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE: |
| 290 return node->GetDetailedInfo().cache_storage_info->origin.spec() + ","; | 301 return node->GetDetailedInfo().cache_storage_info->origin.spec() + ","; |
| 291 case CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO: | 302 case CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO: |
| 292 return node->GetDetailedInfo().flash_lso_domain + ","; | 303 return node->GetDetailedInfo().flash_lso_domain + ","; |
| 304 case CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSE: | |
| 305 return node->GetDetailedInfo().media_license_info->origin.spec() + ","; | |
| 293 default: | 306 default: |
| 294 return std::string(); | 307 return std::string(); |
| 295 } | 308 } |
| 296 } | 309 } |
| 297 | 310 |
| 298 std::string GetCookiesOfChildren(const CookieTreeNode* node) { | 311 std::string GetCookiesOfChildren(const CookieTreeNode* node) { |
| 299 return GetNodesOfChildren(node, CookieTreeNode::DetailedInfo::TYPE_COOKIE); | 312 return GetNodesOfChildren(node, CookieTreeNode::DetailedInfo::TYPE_COOKIE); |
| 300 } | 313 } |
| 301 | 314 |
| 302 std::string GetDatabasesOfChildren(const CookieTreeNode* node) { | 315 std::string GetDatabasesOfChildren(const CookieTreeNode* node) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 std::string GetCacheStoragesOfChildren(const CookieTreeNode* node) { | 350 std::string GetCacheStoragesOfChildren(const CookieTreeNode* node) { |
| 338 return GetNodesOfChildren(node, | 351 return GetNodesOfChildren(node, |
| 339 CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE); | 352 CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE); |
| 340 } | 353 } |
| 341 | 354 |
| 342 std::string GetFlashLSOsOfChildren(const CookieTreeNode* node) { | 355 std::string GetFlashLSOsOfChildren(const CookieTreeNode* node) { |
| 343 return GetNodesOfChildren( | 356 return GetNodesOfChildren( |
| 344 node, CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO); | 357 node, CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO); |
| 345 } | 358 } |
| 346 | 359 |
| 360 std::string GetMediaLicensesOfChildren(const CookieTreeNode* node) { | |
| 361 return GetNodesOfChildren(node, | |
| 362 CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSE); | |
| 363 } | |
| 364 | |
| 347 // Get the nodes names displayed in the view (if we had one) in the order | 365 // Get the nodes names displayed in the view (if we had one) in the order |
| 348 // they are displayed, as a comma seperated string. | 366 // they are displayed, as a comma seperated string. |
| 349 // Ex: EXPECT_STREQ("X,Y", GetDisplayedNodes(cookies_view, type).c_str()); | 367 // Ex: EXPECT_STREQ("X,Y", GetDisplayedNodes(cookies_view, type).c_str()); |
| 350 std::string GetDisplayedNodes(CookiesTreeModel* cookies_model, | 368 std::string GetDisplayedNodes(CookiesTreeModel* cookies_model, |
| 351 CookieTreeNode::DetailedInfo::NodeType type) { | 369 CookieTreeNode::DetailedInfo::NodeType type) { |
| 352 CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>( | 370 CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>( |
| 353 cookies_model->GetRoot()); | 371 cookies_model->GetRoot()); |
| 354 std::string retval = GetNodesOfChildren(root, type); | 372 std::string retval = GetNodesOfChildren(root, type); |
| 355 if (!retval.empty() && retval.back() == ',') | 373 if (!retval.empty() && retval.back() == ',') |
| 356 retval.erase(retval.length() - 1); | 374 retval.erase(retval.length() - 1); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 410 std::string GetDisplayedCacheStorages(CookiesTreeModel* cookies_model) { | 428 std::string GetDisplayedCacheStorages(CookiesTreeModel* cookies_model) { |
| 411 return GetDisplayedNodes(cookies_model, | 429 return GetDisplayedNodes(cookies_model, |
| 412 CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE); | 430 CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE); |
| 413 } | 431 } |
| 414 | 432 |
| 415 std::string GetDisplayedFlashLSOs(CookiesTreeModel* cookies_model) { | 433 std::string GetDisplayedFlashLSOs(CookiesTreeModel* cookies_model) { |
| 416 return GetDisplayedNodes( | 434 return GetDisplayedNodes( |
| 417 cookies_model, CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO); | 435 cookies_model, CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO); |
| 418 } | 436 } |
| 419 | 437 |
| 438 std::string GetDisplayedMediaLicenses(CookiesTreeModel* cookies_model) { | |
| 439 return GetDisplayedNodes(cookies_model, | |
| 440 CookieTreeNode::DetailedInfo::TYPE_MEDIA_LICENSE); | |
| 441 } | |
| 442 | |
| 420 // Do not call on the root. | 443 // Do not call on the root. |
| 421 void DeleteStoredObjects(CookieTreeNode* node) { | 444 void DeleteStoredObjects(CookieTreeNode* node) { |
| 422 node->DeleteStoredObjects(); | 445 node->DeleteStoredObjects(); |
| 423 CookieTreeNode* parent_node = node->parent(); | 446 CookieTreeNode* parent_node = node->parent(); |
| 424 DCHECK(parent_node); | 447 DCHECK(parent_node); |
| 425 delete parent_node->GetModel()->Remove(parent_node, node); | 448 delete parent_node->GetModel()->Remove(parent_node, node); |
| 426 } | 449 } |
| 427 | 450 |
| 428 protected: | 451 protected: |
| 429 ExtensionSpecialStoragePolicy* special_storage_policy() { | 452 ExtensionSpecialStoragePolicy* special_storage_policy() { |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 453 scoped_refptr<MockBrowsingDataQuotaHelper> | 476 scoped_refptr<MockBrowsingDataQuotaHelper> |
| 454 mock_browsing_data_quota_helper_; | 477 mock_browsing_data_quota_helper_; |
| 455 scoped_refptr<MockBrowsingDataChannelIDHelper> | 478 scoped_refptr<MockBrowsingDataChannelIDHelper> |
| 456 mock_browsing_data_channel_id_helper_; | 479 mock_browsing_data_channel_id_helper_; |
| 457 scoped_refptr<MockBrowsingDataServiceWorkerHelper> | 480 scoped_refptr<MockBrowsingDataServiceWorkerHelper> |
| 458 mock_browsing_data_service_worker_helper_; | 481 mock_browsing_data_service_worker_helper_; |
| 459 scoped_refptr<MockBrowsingDataCacheStorageHelper> | 482 scoped_refptr<MockBrowsingDataCacheStorageHelper> |
| 460 mock_browsing_data_cache_storage_helper_; | 483 mock_browsing_data_cache_storage_helper_; |
| 461 scoped_refptr<MockBrowsingDataFlashLSOHelper> | 484 scoped_refptr<MockBrowsingDataFlashLSOHelper> |
| 462 mock_browsing_data_flash_lso_helper_; | 485 mock_browsing_data_flash_lso_helper_; |
| 486 scoped_refptr<MockBrowsingDataMediaLicenseHelper> | |
| 487 mock_browsing_data_media_license_helper_; | |
| 463 | 488 |
| 464 #if defined(ENABLE_EXTENSIONS) | 489 #if defined(ENABLE_EXTENSIONS) |
| 465 scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_; | 490 scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_; |
| 466 #endif | 491 #endif |
| 467 }; | 492 }; |
| 468 | 493 |
| 469 TEST_F(CookiesTreeModelTest, RemoveAll) { | 494 TEST_F(CookiesTreeModelTest, RemoveAll) { |
| 470 std::unique_ptr<CookiesTreeModel> cookies_model( | 495 std::unique_ptr<CookiesTreeModel> cookies_model( |
| 471 CreateCookiesTreeModelWithInitialSample()); | 496 CreateCookiesTreeModelWithInitialSample()); |
| 472 | 497 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 488 EXPECT_EQ("quotahost1,quotahost2", | 513 EXPECT_EQ("quotahost1,quotahost2", |
| 489 GetDisplayedQuotas(cookies_model.get())); | 514 GetDisplayedQuotas(cookies_model.get())); |
| 490 EXPECT_EQ("sbc1,sbc2", | 515 EXPECT_EQ("sbc1,sbc2", |
| 491 GetDisplayedChannelIDs(cookies_model.get())); | 516 GetDisplayedChannelIDs(cookies_model.get())); |
| 492 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 517 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 493 GetDisplayedCacheStorages(cookies_model.get())); | 518 GetDisplayedCacheStorages(cookies_model.get())); |
| 494 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 519 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 495 GetDisplayedServiceWorkers(cookies_model.get())); | 520 GetDisplayedServiceWorkers(cookies_model.get())); |
| 496 EXPECT_EQ("xyz.com", | 521 EXPECT_EQ("xyz.com", |
| 497 GetDisplayedFlashLSOs(cookies_model.get())); | 522 GetDisplayedFlashLSOs(cookies_model.get())); |
| 523 EXPECT_EQ("https://media1/,https://media2/", | |
| 524 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 498 } | 525 } |
| 499 | 526 |
| 500 mock_browsing_data_cookie_helper_->Reset(); | 527 mock_browsing_data_cookie_helper_->Reset(); |
| 501 mock_browsing_data_database_helper_->Reset(); | 528 mock_browsing_data_database_helper_->Reset(); |
| 502 mock_browsing_data_local_storage_helper_->Reset(); | 529 mock_browsing_data_local_storage_helper_->Reset(); |
| 503 mock_browsing_data_session_storage_helper_->Reset(); | 530 mock_browsing_data_session_storage_helper_->Reset(); |
| 504 mock_browsing_data_indexed_db_helper_->Reset(); | 531 mock_browsing_data_indexed_db_helper_->Reset(); |
| 505 mock_browsing_data_service_worker_helper_->Reset(); | 532 mock_browsing_data_service_worker_helper_->Reset(); |
| 506 mock_browsing_data_cache_storage_helper_->Reset(); | 533 mock_browsing_data_cache_storage_helper_->Reset(); |
| 507 mock_browsing_data_file_system_helper_->Reset(); | 534 mock_browsing_data_file_system_helper_->Reset(); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 521 EXPECT_TRUE(mock_browsing_data_cookie_helper_->AllDeleted()); | 548 EXPECT_TRUE(mock_browsing_data_cookie_helper_->AllDeleted()); |
| 522 EXPECT_TRUE(mock_browsing_data_database_helper_->AllDeleted()); | 549 EXPECT_TRUE(mock_browsing_data_database_helper_->AllDeleted()); |
| 523 EXPECT_TRUE(mock_browsing_data_local_storage_helper_->AllDeleted()); | 550 EXPECT_TRUE(mock_browsing_data_local_storage_helper_->AllDeleted()); |
| 524 EXPECT_FALSE(mock_browsing_data_session_storage_helper_->AllDeleted()); | 551 EXPECT_FALSE(mock_browsing_data_session_storage_helper_->AllDeleted()); |
| 525 EXPECT_TRUE(mock_browsing_data_indexed_db_helper_->AllDeleted()); | 552 EXPECT_TRUE(mock_browsing_data_indexed_db_helper_->AllDeleted()); |
| 526 EXPECT_TRUE(mock_browsing_data_file_system_helper_->AllDeleted()); | 553 EXPECT_TRUE(mock_browsing_data_file_system_helper_->AllDeleted()); |
| 527 EXPECT_TRUE(mock_browsing_data_channel_id_helper_->AllDeleted()); | 554 EXPECT_TRUE(mock_browsing_data_channel_id_helper_->AllDeleted()); |
| 528 EXPECT_TRUE(mock_browsing_data_service_worker_helper_->AllDeleted()); | 555 EXPECT_TRUE(mock_browsing_data_service_worker_helper_->AllDeleted()); |
| 529 EXPECT_TRUE(mock_browsing_data_cache_storage_helper_->AllDeleted()); | 556 EXPECT_TRUE(mock_browsing_data_cache_storage_helper_->AllDeleted()); |
| 530 EXPECT_TRUE(mock_browsing_data_flash_lso_helper_->AllDeleted()); | 557 EXPECT_TRUE(mock_browsing_data_flash_lso_helper_->AllDeleted()); |
| 558 EXPECT_TRUE(mock_browsing_data_media_license_helper_->AllDeleted()); | |
| 531 } | 559 } |
| 532 } | 560 } |
| 533 | 561 |
| 534 TEST_F(CookiesTreeModelTest, Remove) { | 562 TEST_F(CookiesTreeModelTest, Remove) { |
| 535 std::unique_ptr<CookiesTreeModel> cookies_model( | 563 std::unique_ptr<CookiesTreeModel> cookies_model( |
| 536 CreateCookiesTreeModelWithInitialSample()); | 564 CreateCookiesTreeModelWithInitialSample()); |
| 537 | 565 |
| 538 // Children start out arranged as follows: | 566 // Children start out arranged as follows: |
| 539 // | 567 // |
| 540 // 0. `cshost1` | 568 // 0. `cshost1` |
| 541 // 1. `cshost2` | 569 // 1. `cshost2` |
| 542 // 2. `foo1` | 570 // 2. `foo1` |
| 543 // 3. `foo2` | 571 // 3. `foo2` |
| 544 // 4. `foo3` | 572 // 4. `foo3` |
| 545 // 5. `fshost1` | 573 // 5. `fshost1` |
| 546 // 6. `fshost2` | 574 // 6. `fshost2` |
| 547 // 7. `fshost3` | 575 // 7. `fshost3` |
| 548 // 8. `gdbhost1` | 576 // 8. `gdbhost1` |
| 549 // 9. `gdbhost2` | 577 // 9. `gdbhost2` |
| 550 // 10. `host1` | 578 // 10. `host1` |
| 551 // 11. `host2` | 579 // 11. `host2` |
| 552 // 12. `idbhost1` | 580 // 12. `idbhost1` |
| 553 // 13. `idbhost2` | 581 // 13. `idbhost2` |
| 554 // 14. `quotahost1` | 582 // 14. `media1.com` |
|
msramek
2016/09/26 18:28:06
Ditto here.
jrummell
2016/09/27 18:21:15
Done.
| |
| 555 // 15. `quotahost2` | 583 // 15. `media2.com` |
| 556 // 16. `sbc1` | 584 // 16. `quotahost1` |
| 557 // 17. `sbc2` | 585 // 17. `quotahost2` |
| 558 // 18. `swhost1` | 586 // 18. `sbc1` |
| 559 // 19. `swhost2` | 587 // 19. `sbc2` |
| 560 // 20. `xyz.com` | 588 // 20. `swhost1` |
| 589 // 21. `swhost2` | |
| 590 // 22. `xyz.com`, 2 nodes | |
|
msramek
2016/09/26 18:28:06
nit: Why specify the number of nodes here and not
jrummell
2016/09/27 18:21:15
I think I started here, and then realized it would
| |
| 561 // | 591 // |
| 562 // Here, we'll remove them one by one, starting from the end, and | 592 // Here, we'll remove them one by one, starting from the end, and |
| 563 // check that the state makes sense. | 593 // check that the state makes sense. Initially there are 71 total nodes. |
| 564 | 594 |
| 565 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(20)); | 595 // xyz.com -> flash_lsos (2 nodes) |
| 596 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(22)); | |
| 566 { | 597 { |
| 567 SCOPED_TRACE("`xyz.com` removed."); | 598 SCOPED_TRACE("`xyz.com` removed."); |
| 568 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 599 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 569 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 600 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 570 EXPECT_EQ("http://host1:1/,http://host2:2/", | 601 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 571 GetDisplayedLocalStorages(cookies_model.get())); | 602 GetDisplayedLocalStorages(cookies_model.get())); |
| 572 EXPECT_EQ("http://host1:1/,http://host2:2/", | 603 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 573 GetDisplayedSessionStorages(cookies_model.get())); | 604 GetDisplayedSessionStorages(cookies_model.get())); |
| 574 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 605 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 575 GetDisplayedFileSystems(cookies_model.get())); | 606 GetDisplayedFileSystems(cookies_model.get())); |
| 576 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 607 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 577 GetDisplayedIndexedDBs(cookies_model.get())); | 608 GetDisplayedIndexedDBs(cookies_model.get())); |
| 578 EXPECT_EQ("quotahost1,quotahost2", | 609 EXPECT_EQ("quotahost1,quotahost2", |
| 579 GetDisplayedQuotas(cookies_model.get())); | 610 GetDisplayedQuotas(cookies_model.get())); |
| 580 EXPECT_EQ("sbc1,sbc2", | 611 EXPECT_EQ("sbc1,sbc2", |
| 581 GetDisplayedChannelIDs(cookies_model.get())); | 612 GetDisplayedChannelIDs(cookies_model.get())); |
| 582 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 613 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 583 GetDisplayedServiceWorkers(cookies_model.get())); | 614 GetDisplayedServiceWorkers(cookies_model.get())); |
| 584 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 615 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 585 GetDisplayedCacheStorages(cookies_model.get())); | 616 GetDisplayedCacheStorages(cookies_model.get())); |
| 586 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 617 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 587 EXPECT_EQ(63, cookies_model->GetRoot()->GetTotalNodeCount()); | 618 EXPECT_EQ("https://media1/,https://media2/", |
| 619 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 620 EXPECT_EQ(69, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 588 } | 621 } |
| 589 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(19)); | 622 |
| 623 // swhost2 -> service worker -> https://swhost1:2 (3 objects) | |
| 624 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(21)); | |
| 590 { | 625 { |
| 591 SCOPED_TRACE("`swhost2` removed."); | 626 SCOPED_TRACE("`swhost2` removed."); |
| 592 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 627 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 593 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 628 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 594 EXPECT_EQ("http://host1:1/,http://host2:2/", | 629 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 595 GetDisplayedLocalStorages(cookies_model.get())); | 630 GetDisplayedLocalStorages(cookies_model.get())); |
| 596 EXPECT_EQ("http://host1:1/,http://host2:2/", | 631 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 597 GetDisplayedSessionStorages(cookies_model.get())); | 632 GetDisplayedSessionStorages(cookies_model.get())); |
| 598 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 633 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 599 GetDisplayedFileSystems(cookies_model.get())); | 634 GetDisplayedFileSystems(cookies_model.get())); |
| 600 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 635 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 601 GetDisplayedIndexedDBs(cookies_model.get())); | 636 GetDisplayedIndexedDBs(cookies_model.get())); |
| 602 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); | 637 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); |
| 603 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); | 638 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); |
| 604 EXPECT_EQ("https://swhost1:1/", | 639 EXPECT_EQ("https://swhost1:1/", |
| 605 GetDisplayedServiceWorkers(cookies_model.get())); | 640 GetDisplayedServiceWorkers(cookies_model.get())); |
| 606 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 641 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 607 GetDisplayedCacheStorages(cookies_model.get())); | 642 GetDisplayedCacheStorages(cookies_model.get())); |
| 608 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 643 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 609 EXPECT_EQ(60, cookies_model->GetRoot()->GetTotalNodeCount()); | 644 EXPECT_EQ("https://media1/,https://media2/", |
| 645 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 646 EXPECT_EQ(66, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 610 } | 647 } |
| 611 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(18)); | 648 |
| 649 // swhost1 -> service worker -> https://swhost1:1 (3 nodes) | |
| 650 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(20)); | |
| 612 { | 651 { |
| 613 SCOPED_TRACE("`swhost1` removed."); | 652 SCOPED_TRACE("`swhost1` removed."); |
| 614 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 653 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 615 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 654 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 616 EXPECT_EQ("http://host1:1/,http://host2:2/", | 655 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 617 GetDisplayedLocalStorages(cookies_model.get())); | 656 GetDisplayedLocalStorages(cookies_model.get())); |
| 618 EXPECT_EQ("http://host1:1/,http://host2:2/", | 657 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 619 GetDisplayedSessionStorages(cookies_model.get())); | 658 GetDisplayedSessionStorages(cookies_model.get())); |
| 620 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 659 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 621 GetDisplayedFileSystems(cookies_model.get())); | 660 GetDisplayedFileSystems(cookies_model.get())); |
| 622 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 661 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 623 GetDisplayedIndexedDBs(cookies_model.get())); | 662 GetDisplayedIndexedDBs(cookies_model.get())); |
| 624 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); | 663 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); |
| 625 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); | 664 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); |
| 626 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 665 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 627 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 666 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 628 GetDisplayedCacheStorages(cookies_model.get())); | 667 GetDisplayedCacheStorages(cookies_model.get())); |
| 629 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 668 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 630 EXPECT_EQ(57, cookies_model->GetRoot()->GetTotalNodeCount()); | 669 EXPECT_EQ("https://media1/,https://media2/", |
| 670 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 671 EXPECT_EQ(63, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 631 } | 672 } |
| 632 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(17)); | 673 |
| 674 // sbc2 -> sbcerts -> sbc2 (3 objects) | |
| 675 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(19)); | |
| 633 { | 676 { |
| 634 SCOPED_TRACE("`sbc2` removed."); | 677 SCOPED_TRACE("`sbc2` removed."); |
| 635 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 678 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 636 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 679 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 637 EXPECT_EQ("http://host1:1/,http://host2:2/", | 680 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 638 GetDisplayedLocalStorages(cookies_model.get())); | 681 GetDisplayedLocalStorages(cookies_model.get())); |
| 639 EXPECT_EQ("http://host1:1/,http://host2:2/", | 682 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 640 GetDisplayedSessionStorages(cookies_model.get())); | 683 GetDisplayedSessionStorages(cookies_model.get())); |
| 641 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 684 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 642 GetDisplayedFileSystems(cookies_model.get())); | 685 GetDisplayedFileSystems(cookies_model.get())); |
| 643 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 686 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 644 GetDisplayedIndexedDBs(cookies_model.get())); | 687 GetDisplayedIndexedDBs(cookies_model.get())); |
| 645 EXPECT_EQ("quotahost1,quotahost2", | 688 EXPECT_EQ("quotahost1,quotahost2", |
| 646 GetDisplayedQuotas(cookies_model.get())); | 689 GetDisplayedQuotas(cookies_model.get())); |
| 647 EXPECT_EQ("sbc1", | 690 EXPECT_EQ("sbc1", |
| 648 GetDisplayedChannelIDs(cookies_model.get())); | 691 GetDisplayedChannelIDs(cookies_model.get())); |
| 649 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 692 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 650 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 693 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 651 GetDisplayedCacheStorages(cookies_model.get())); | 694 GetDisplayedCacheStorages(cookies_model.get())); |
| 652 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 695 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 653 EXPECT_EQ(54, cookies_model->GetRoot()->GetTotalNodeCount()); | 696 EXPECT_EQ("https://media1/,https://media2/", |
| 697 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 698 EXPECT_EQ(60, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 654 } | 699 } |
| 655 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(16)); | 700 |
| 701 // sbc1 -> sbcerts -> sbc1 (3 objects) | |
| 702 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(18)); | |
| 656 { | 703 { |
| 657 SCOPED_TRACE("`sbc1` removed."); | 704 SCOPED_TRACE("`sbc1` removed."); |
| 658 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 705 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 659 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 706 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 660 EXPECT_EQ("http://host1:1/,http://host2:2/", | 707 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 661 GetDisplayedLocalStorages(cookies_model.get())); | 708 GetDisplayedLocalStorages(cookies_model.get())); |
| 662 EXPECT_EQ("http://host1:1/,http://host2:2/", | 709 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 663 GetDisplayedSessionStorages(cookies_model.get())); | 710 GetDisplayedSessionStorages(cookies_model.get())); |
| 664 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 711 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 665 GetDisplayedFileSystems(cookies_model.get())); | 712 GetDisplayedFileSystems(cookies_model.get())); |
| 666 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 713 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 667 GetDisplayedIndexedDBs(cookies_model.get())); | 714 GetDisplayedIndexedDBs(cookies_model.get())); |
| 668 EXPECT_EQ("quotahost1,quotahost2", | 715 EXPECT_EQ("quotahost1,quotahost2", |
| 669 GetDisplayedQuotas(cookies_model.get())); | 716 GetDisplayedQuotas(cookies_model.get())); |
| 670 EXPECT_EQ("", GetDisplayedChannelIDs(cookies_model.get())); | 717 EXPECT_EQ("", GetDisplayedChannelIDs(cookies_model.get())); |
| 671 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 718 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 672 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 719 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 673 GetDisplayedCacheStorages(cookies_model.get())); | 720 GetDisplayedCacheStorages(cookies_model.get())); |
| 674 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 721 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 675 EXPECT_EQ(51, cookies_model->GetRoot()->GetTotalNodeCount()); | 722 EXPECT_EQ("https://media1/,https://media2/", |
| 723 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 724 EXPECT_EQ(57, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 676 } | 725 } |
| 677 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(15)); | 726 |
| 727 // quotahost2 -> quotahost2 (2 objects) | |
| 728 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(17)); | |
| 678 { | 729 { |
| 679 SCOPED_TRACE("`quotahost2` removed."); | 730 SCOPED_TRACE("`quotahost2` removed."); |
| 680 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 731 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 681 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 732 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 682 EXPECT_EQ("http://host1:1/,http://host2:2/", | 733 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 683 GetDisplayedLocalStorages(cookies_model.get())); | 734 GetDisplayedLocalStorages(cookies_model.get())); |
| 684 EXPECT_EQ("http://host1:1/,http://host2:2/", | 735 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 685 GetDisplayedSessionStorages(cookies_model.get())); | 736 GetDisplayedSessionStorages(cookies_model.get())); |
| 686 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 737 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 687 GetDisplayedFileSystems(cookies_model.get())); | 738 GetDisplayedFileSystems(cookies_model.get())); |
| 688 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 739 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 689 GetDisplayedIndexedDBs(cookies_model.get())); | 740 GetDisplayedIndexedDBs(cookies_model.get())); |
| 690 EXPECT_EQ("quotahost1", | 741 EXPECT_EQ("quotahost1", |
| 691 GetDisplayedQuotas(cookies_model.get())); | 742 GetDisplayedQuotas(cookies_model.get())); |
| 692 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 743 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 693 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 744 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 694 GetDisplayedCacheStorages(cookies_model.get())); | 745 GetDisplayedCacheStorages(cookies_model.get())); |
| 695 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 746 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 696 EXPECT_EQ(49, cookies_model->GetRoot()->GetTotalNodeCount()); | 747 EXPECT_EQ("https://media1/,https://media2/", |
| 748 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 749 EXPECT_EQ(55, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 697 } | 750 } |
| 698 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(14)); | 751 |
| 752 // quotahost1 -> quotahost1 (2 objects) | |
| 753 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(16)); | |
| 699 { | 754 { |
| 700 SCOPED_TRACE("`quotahost1` removed."); | 755 SCOPED_TRACE("`quotahost1` removed."); |
| 701 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 756 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 702 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 757 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 703 EXPECT_EQ("http://host1:1/,http://host2:2/", | 758 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 704 GetDisplayedLocalStorages(cookies_model.get())); | 759 GetDisplayedLocalStorages(cookies_model.get())); |
| 705 EXPECT_EQ("http://host1:1/,http://host2:2/", | 760 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 706 GetDisplayedSessionStorages(cookies_model.get())); | 761 GetDisplayedSessionStorages(cookies_model.get())); |
| 707 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 762 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 708 GetDisplayedFileSystems(cookies_model.get())); | 763 GetDisplayedFileSystems(cookies_model.get())); |
| 709 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 764 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 710 GetDisplayedIndexedDBs(cookies_model.get())); | 765 GetDisplayedIndexedDBs(cookies_model.get())); |
| 711 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 766 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 712 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 767 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 713 GetDisplayedCacheStorages(cookies_model.get())); | 768 GetDisplayedCacheStorages(cookies_model.get())); |
| 714 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 769 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 770 EXPECT_EQ("https://media1/,https://media2/", | |
| 771 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 772 EXPECT_EQ(53, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 773 } | |
| 774 | |
| 775 // media2.com -> media_licenses -> media_license (3 objects) | |
|
msramek
2016/09/26 18:28:06
Ditto here and below.
jrummell
2016/09/27 18:21:15
Done.
| |
| 776 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(15)); | |
| 777 { | |
| 778 SCOPED_TRACE("`media2.com` removed."); | |
| 779 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | |
| 780 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | |
| 781 EXPECT_EQ("http://host1:1/,http://host2:2/", | |
| 782 GetDisplayedLocalStorages(cookies_model.get())); | |
| 783 EXPECT_EQ("http://host1:1/,http://host2:2/", | |
| 784 GetDisplayedSessionStorages(cookies_model.get())); | |
| 785 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | |
| 786 GetDisplayedFileSystems(cookies_model.get())); | |
| 787 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | |
| 788 GetDisplayedIndexedDBs(cookies_model.get())); | |
| 789 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | |
| 790 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | |
| 791 GetDisplayedCacheStorages(cookies_model.get())); | |
| 792 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | |
| 793 EXPECT_EQ("https://media1/", | |
| 794 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 795 EXPECT_EQ(50, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 796 } | |
| 797 | |
| 798 // media1.com -> media_licenses -> media_license (3 objects) | |
| 799 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(14)); | |
| 800 { | |
| 801 SCOPED_TRACE("`media1.com` removed."); | |
| 802 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | |
| 803 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | |
| 804 EXPECT_EQ("http://host1:1/,http://host2:2/", | |
| 805 GetDisplayedLocalStorages(cookies_model.get())); | |
| 806 EXPECT_EQ("http://host1:1/,http://host2:2/", | |
| 807 GetDisplayedSessionStorages(cookies_model.get())); | |
| 808 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | |
| 809 GetDisplayedFileSystems(cookies_model.get())); | |
| 810 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | |
| 811 GetDisplayedIndexedDBs(cookies_model.get())); | |
| 812 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | |
| 813 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | |
| 814 GetDisplayedCacheStorages(cookies_model.get())); | |
| 815 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | |
| 816 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 715 EXPECT_EQ(47, cookies_model->GetRoot()->GetTotalNodeCount()); | 817 EXPECT_EQ(47, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 716 } | 818 } |
| 819 | |
| 820 // idbhost2 -> indexeddb -> http://idbhost2:2/ (3 objects) | |
| 717 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(13)); | 821 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(13)); |
| 718 { | 822 { |
| 719 SCOPED_TRACE("`idbhost2` removed."); | 823 SCOPED_TRACE("`idbhost2` removed."); |
| 720 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 824 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 721 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 825 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 722 EXPECT_EQ("http://host1:1/,http://host2:2/", | 826 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 723 GetDisplayedLocalStorages(cookies_model.get())); | 827 GetDisplayedLocalStorages(cookies_model.get())); |
| 724 EXPECT_EQ("http://host1:1/,http://host2:2/", | 828 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 725 GetDisplayedSessionStorages(cookies_model.get())); | 829 GetDisplayedSessionStorages(cookies_model.get())); |
| 726 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 830 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 727 GetDisplayedFileSystems(cookies_model.get())); | 831 GetDisplayedFileSystems(cookies_model.get())); |
| 728 EXPECT_EQ("http://idbhost1:1/", | 832 EXPECT_EQ("http://idbhost1:1/", |
| 729 GetDisplayedIndexedDBs(cookies_model.get())); | 833 GetDisplayedIndexedDBs(cookies_model.get())); |
| 730 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 834 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 731 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 835 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 732 GetDisplayedCacheStorages(cookies_model.get())); | 836 GetDisplayedCacheStorages(cookies_model.get())); |
| 733 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 837 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 838 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 734 EXPECT_EQ(44, cookies_model->GetRoot()->GetTotalNodeCount()); | 839 EXPECT_EQ(44, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 735 } | 840 } |
| 841 | |
| 842 // idbhost1 -> indexeddb -> http://idbhost1:1/ (3 objects) | |
| 736 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(12)); | 843 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(12)); |
| 737 { | 844 { |
| 738 SCOPED_TRACE("`idbhost1` removed."); | 845 SCOPED_TRACE("`idbhost1` removed."); |
| 739 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 846 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 740 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 847 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 741 EXPECT_EQ("http://host1:1/,http://host2:2/", | 848 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 742 GetDisplayedLocalStorages(cookies_model.get())); | 849 GetDisplayedLocalStorages(cookies_model.get())); |
| 743 EXPECT_EQ("http://host1:1/,http://host2:2/", | 850 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 744 GetDisplayedSessionStorages(cookies_model.get())); | 851 GetDisplayedSessionStorages(cookies_model.get())); |
| 745 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 852 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 746 GetDisplayedFileSystems(cookies_model.get())); | 853 GetDisplayedFileSystems(cookies_model.get())); |
| 747 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 854 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 748 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 855 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 749 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 856 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 750 GetDisplayedCacheStorages(cookies_model.get())); | 857 GetDisplayedCacheStorages(cookies_model.get())); |
| 751 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 858 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 859 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 752 EXPECT_EQ(41, cookies_model->GetRoot()->GetTotalNodeCount()); | 860 EXPECT_EQ(41, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 753 } | 861 } |
| 862 | |
| 863 // host2 -> localstorage -> http://host2:2/, | |
| 864 // -> sessionstorage -> http://host2:2/ (5 objects) | |
| 754 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(11)); | 865 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(11)); |
| 755 { | 866 { |
| 756 SCOPED_TRACE("`host2` removed."); | 867 SCOPED_TRACE("`host2` removed."); |
| 757 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 868 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 758 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 869 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 759 EXPECT_EQ("http://host1:1/", | 870 EXPECT_EQ("http://host1:1/", |
| 760 GetDisplayedLocalStorages(cookies_model.get())); | 871 GetDisplayedLocalStorages(cookies_model.get())); |
| 761 EXPECT_EQ("http://host1:1/", | 872 EXPECT_EQ("http://host1:1/", |
| 762 GetDisplayedSessionStorages(cookies_model.get())); | 873 GetDisplayedSessionStorages(cookies_model.get())); |
| 763 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 874 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 764 GetDisplayedFileSystems(cookies_model.get())); | 875 GetDisplayedFileSystems(cookies_model.get())); |
| 765 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 876 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 766 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 877 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 767 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 878 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 768 GetDisplayedCacheStorages(cookies_model.get())); | 879 GetDisplayedCacheStorages(cookies_model.get())); |
| 769 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 880 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 881 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 770 EXPECT_EQ(36, cookies_model->GetRoot()->GetTotalNodeCount()); | 882 EXPECT_EQ(36, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 771 } | 883 } |
| 884 | |
| 885 // host1 -> localstorage -> http://host1:1/, | |
| 886 // -> sessionstorage -> http://host1:1/ (5 objects) | |
| 772 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(10)); | 887 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(10)); |
| 773 { | 888 { |
| 774 SCOPED_TRACE("`host1` removed."); | 889 SCOPED_TRACE("`host1` removed."); |
| 775 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 890 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 776 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 891 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 777 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 892 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 778 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 893 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 779 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 894 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 780 GetDisplayedFileSystems(cookies_model.get())); | 895 GetDisplayedFileSystems(cookies_model.get())); |
| 781 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 896 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 782 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 897 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 783 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 898 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 784 GetDisplayedCacheStorages(cookies_model.get())); | 899 GetDisplayedCacheStorages(cookies_model.get())); |
| 785 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 900 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 901 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 786 EXPECT_EQ(31, cookies_model->GetRoot()->GetTotalNodeCount()); | 902 EXPECT_EQ(31, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 787 } | 903 } |
| 904 | |
| 905 // gdbhost2 -> database -> db2 (3 objects) | |
| 788 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(9)); | 906 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(9)); |
| 789 { | 907 { |
| 790 SCOPED_TRACE("`gdbhost2` removed."); | 908 SCOPED_TRACE("`gdbhost2` removed."); |
| 791 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 909 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 792 EXPECT_EQ("db1", GetDisplayedDatabases(cookies_model.get())); | 910 EXPECT_EQ("db1", GetDisplayedDatabases(cookies_model.get())); |
| 793 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 911 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 794 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 912 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 795 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 913 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 796 GetDisplayedFileSystems(cookies_model.get())); | 914 GetDisplayedFileSystems(cookies_model.get())); |
| 797 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 915 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 798 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 916 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 799 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 917 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 800 GetDisplayedCacheStorages(cookies_model.get())); | 918 GetDisplayedCacheStorages(cookies_model.get())); |
| 801 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 919 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 920 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 802 EXPECT_EQ(28, cookies_model->GetRoot()->GetTotalNodeCount()); | 921 EXPECT_EQ(28, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 803 } | 922 } |
| 923 // gdbhost1 -> database -> db1 (3 objects) | |
| 804 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(8)); | 924 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(8)); |
| 805 { | 925 { |
| 806 SCOPED_TRACE("`gdbhost1` removed."); | 926 SCOPED_TRACE("`gdbhost1` removed."); |
| 807 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 927 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 808 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 928 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 809 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 929 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 810 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 930 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 811 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 931 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 812 GetDisplayedFileSystems(cookies_model.get())); | 932 GetDisplayedFileSystems(cookies_model.get())); |
| 813 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 933 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 814 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 934 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 815 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 935 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 816 GetDisplayedCacheStorages(cookies_model.get())); | 936 GetDisplayedCacheStorages(cookies_model.get())); |
| 817 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 937 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 938 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 818 EXPECT_EQ(25, cookies_model->GetRoot()->GetTotalNodeCount()); | 939 EXPECT_EQ(25, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 819 } | 940 } |
| 941 | |
| 942 // fshost3 -> filesystem -> http://fshost3:1/ (3 objects) | |
| 820 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(7)); | 943 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(7)); |
| 821 { | 944 { |
| 822 SCOPED_TRACE("`fshost3` removed."); | 945 SCOPED_TRACE("`fshost3` removed."); |
| 823 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 946 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 824 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 947 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 825 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 948 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 826 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 949 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 827 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/", | 950 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/", |
| 828 GetDisplayedFileSystems(cookies_model.get())); | 951 GetDisplayedFileSystems(cookies_model.get())); |
| 829 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 952 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 830 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 953 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 831 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 954 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 832 GetDisplayedCacheStorages(cookies_model.get())); | 955 GetDisplayedCacheStorages(cookies_model.get())); |
| 833 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 956 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 957 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 834 EXPECT_EQ(22, cookies_model->GetRoot()->GetTotalNodeCount()); | 958 EXPECT_EQ(22, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 835 } | 959 } |
| 960 | |
| 961 // fshost2 -> filesystem -> http://fshost2:1/ (3 objects) | |
| 836 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(6)); | 962 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(6)); |
| 837 { | 963 { |
| 838 SCOPED_TRACE("`fshost2` removed."); | 964 SCOPED_TRACE("`fshost2` removed."); |
| 839 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 965 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 840 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 966 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 841 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 967 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 842 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 968 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 843 EXPECT_EQ("http://fshost1:1/", | 969 EXPECT_EQ("http://fshost1:1/", |
| 844 GetDisplayedFileSystems(cookies_model.get())); | 970 GetDisplayedFileSystems(cookies_model.get())); |
| 845 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 971 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 846 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 972 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 847 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 973 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 848 GetDisplayedCacheStorages(cookies_model.get())); | 974 GetDisplayedCacheStorages(cookies_model.get())); |
| 849 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 975 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 976 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 850 EXPECT_EQ(19, cookies_model->GetRoot()->GetTotalNodeCount()); | 977 EXPECT_EQ(19, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 851 } | 978 } |
| 979 | |
| 980 // fshost1 -> filesystem -> http://fshost1:1/ (3 objects) | |
| 852 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(5)); | 981 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(5)); |
| 853 { | 982 { |
| 854 SCOPED_TRACE("`fshost1` removed."); | 983 SCOPED_TRACE("`fshost1` removed."); |
| 855 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 984 EXPECT_STREQ("A,B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 856 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 985 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 857 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 986 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 858 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 987 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 859 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); | 988 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); |
| 860 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 989 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 861 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 990 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 862 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 991 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 863 GetDisplayedCacheStorages(cookies_model.get())); | 992 GetDisplayedCacheStorages(cookies_model.get())); |
| 864 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 993 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 994 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 865 EXPECT_EQ(16, cookies_model->GetRoot()->GetTotalNodeCount()); | 995 EXPECT_EQ(16, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 866 } | 996 } |
| 997 | |
| 998 // foo3 -> cookies -> c (3 objects) | |
| 867 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(4)); | 999 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(4)); |
| 868 { | 1000 { |
| 869 SCOPED_TRACE("`foo3` removed."); | 1001 SCOPED_TRACE("`foo3` removed."); |
| 870 EXPECT_STREQ("A,B", GetDisplayedCookies(cookies_model.get()).c_str()); | 1002 EXPECT_STREQ("A,B", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 871 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 1003 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 872 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 1004 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 873 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 1005 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 874 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); | 1006 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); |
| 875 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 1007 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 876 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 1008 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 877 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1009 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 878 GetDisplayedCacheStorages(cookies_model.get())); | 1010 GetDisplayedCacheStorages(cookies_model.get())); |
| 879 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 1011 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1012 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 880 EXPECT_EQ(13, cookies_model->GetRoot()->GetTotalNodeCount()); | 1013 EXPECT_EQ(13, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 881 } | 1014 } |
| 1015 | |
| 1016 // foo2 -> cookies -> b (3 objects) | |
| 882 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(3)); | 1017 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(3)); |
| 883 { | 1018 { |
| 884 SCOPED_TRACE("`foo2` removed."); | 1019 SCOPED_TRACE("`foo2` removed."); |
| 885 EXPECT_STREQ("A", GetDisplayedCookies(cookies_model.get()).c_str()); | 1020 EXPECT_STREQ("A", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 886 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 1021 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 887 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 1022 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 888 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 1023 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 889 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); | 1024 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); |
| 890 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 1025 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 891 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 1026 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 892 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1027 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 893 GetDisplayedCacheStorages(cookies_model.get())); | 1028 GetDisplayedCacheStorages(cookies_model.get())); |
| 894 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 1029 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1030 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 895 EXPECT_EQ(10, cookies_model->GetRoot()->GetTotalNodeCount()); | 1031 EXPECT_EQ(10, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 896 } | 1032 } |
| 1033 | |
| 1034 // foo1 -> cookies -> a (3 objects) | |
| 897 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(2)); | 1035 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(2)); |
| 898 { | 1036 { |
| 899 SCOPED_TRACE("`foo1` removed."); | 1037 SCOPED_TRACE("`foo1` removed."); |
| 900 EXPECT_STREQ("", GetDisplayedCookies(cookies_model.get()).c_str()); | 1038 EXPECT_STREQ("", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 901 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 1039 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 902 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 1040 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 903 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 1041 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 904 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); | 1042 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); |
| 905 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 1043 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 906 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 1044 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 907 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1045 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 908 GetDisplayedCacheStorages(cookies_model.get())); | 1046 GetDisplayedCacheStorages(cookies_model.get())); |
| 909 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 1047 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1048 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 910 EXPECT_EQ(7, cookies_model->GetRoot()->GetTotalNodeCount()); | 1049 EXPECT_EQ(7, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 911 } | 1050 } |
| 1051 | |
| 1052 // cshost2 -> cache storage -> https://cshost2:2/ (3 objects) | |
| 912 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(1)); | 1053 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(1)); |
| 913 { | 1054 { |
| 914 SCOPED_TRACE("`cshost2` removed."); | 1055 SCOPED_TRACE("`cshost2` removed."); |
| 915 EXPECT_STREQ("", GetDisplayedCookies(cookies_model.get()).c_str()); | 1056 EXPECT_STREQ("", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 916 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 1057 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 917 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 1058 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 918 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 1059 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 919 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); | 1060 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); |
| 920 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 1061 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 921 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 1062 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 922 EXPECT_EQ("https://cshost1:1/", | 1063 EXPECT_EQ("https://cshost1:1/", |
| 923 GetDisplayedCacheStorages(cookies_model.get())); | 1064 GetDisplayedCacheStorages(cookies_model.get())); |
| 924 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 1065 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1066 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 925 EXPECT_EQ(4, cookies_model->GetRoot()->GetTotalNodeCount()); | 1067 EXPECT_EQ(4, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 926 } | 1068 } |
| 1069 | |
| 1070 // cshost1 -> cache storage -> https://cshost1:1/ (3 objects) | |
| 927 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(0)); | 1071 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(0)); |
| 928 { | 1072 { |
| 929 SCOPED_TRACE("`cshost1` removed."); | 1073 SCOPED_TRACE("`cshost1` removed."); |
| 930 EXPECT_STREQ("", GetDisplayedCookies(cookies_model.get()).c_str()); | 1074 EXPECT_STREQ("", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 931 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); | 1075 EXPECT_EQ("", GetDisplayedDatabases(cookies_model.get())); |
| 932 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); | 1076 EXPECT_EQ("", GetDisplayedLocalStorages(cookies_model.get())); |
| 933 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); | 1077 EXPECT_EQ("", GetDisplayedSessionStorages(cookies_model.get())); |
| 934 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); | 1078 EXPECT_EQ("", GetDisplayedFileSystems(cookies_model.get())); |
| 935 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); | 1079 EXPECT_EQ("", GetDisplayedIndexedDBs(cookies_model.get())); |
| 936 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); | 1080 EXPECT_EQ("", GetDisplayedServiceWorkers(cookies_model.get())); |
| 937 EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); | 1081 EXPECT_EQ("", GetDisplayedCacheStorages(cookies_model.get())); |
| 938 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); | 1082 EXPECT_EQ("", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1083 EXPECT_EQ("", GetDisplayedMediaLicenses(cookies_model.get())); | |
| 939 EXPECT_EQ(1, cookies_model->GetRoot()->GetTotalNodeCount()); | 1084 EXPECT_EQ(1, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 940 } | 1085 } |
| 941 } | 1086 } |
| 942 | 1087 |
| 943 TEST_F(CookiesTreeModelTest, RemoveCookiesNode) { | 1088 TEST_F(CookiesTreeModelTest, RemoveCookiesNode) { |
| 944 std::unique_ptr<CookiesTreeModel> cookies_model( | 1089 std::unique_ptr<CookiesTreeModel> cookies_model( |
| 945 CreateCookiesTreeModelWithInitialSample()); | 1090 CreateCookiesTreeModelWithInitialSample()); |
| 946 | 1091 |
| 947 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(2)->GetChild(0)); | 1092 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(2)->GetChild(0)); |
| 948 { | 1093 { |
| 949 SCOPED_TRACE("First cookies origin removed"); | 1094 SCOPED_TRACE("First cookies origin removed"); |
| 950 EXPECT_STREQ("B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 1095 EXPECT_STREQ("B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 951 // 63 because in this case, the origin remains, although the COOKIES | 1096 // 69 because in this case, the origin remains, although the COOKIES |
| 952 // node beneath it has been deleted. | 1097 // node beneath it has been deleted. |
| 953 EXPECT_EQ(63, cookies_model->GetRoot()->GetTotalNodeCount()); | 1098 EXPECT_EQ(69, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 954 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 1099 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 955 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1100 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 956 GetDisplayedLocalStorages(cookies_model.get())); | 1101 GetDisplayedLocalStorages(cookies_model.get())); |
| 957 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1102 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 958 GetDisplayedSessionStorages(cookies_model.get())); | 1103 GetDisplayedSessionStorages(cookies_model.get())); |
| 959 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 1104 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 960 GetDisplayedIndexedDBs(cookies_model.get())); | 1105 GetDisplayedIndexedDBs(cookies_model.get())); |
| 961 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 1106 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 962 GetDisplayedFileSystems(cookies_model.get())); | 1107 GetDisplayedFileSystems(cookies_model.get())); |
| 963 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); | 1108 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); |
| 964 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); | 1109 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); |
| 965 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 1110 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 966 GetDisplayedServiceWorkers(cookies_model.get())); | 1111 GetDisplayedServiceWorkers(cookies_model.get())); |
| 967 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1112 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 968 GetDisplayedCacheStorages(cookies_model.get())); | 1113 GetDisplayedCacheStorages(cookies_model.get())); |
| 1114 EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); | |
| 1115 EXPECT_EQ("https://media1/,https://media2/", | |
| 1116 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 969 } | 1117 } |
| 970 | 1118 |
| 971 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(8)->GetChild(0)); | 1119 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(8)->GetChild(0)); |
| 972 { | 1120 { |
| 973 SCOPED_TRACE("First database origin removed"); | 1121 SCOPED_TRACE("First database origin removed"); |
| 974 EXPECT_STREQ("B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 1122 EXPECT_STREQ("B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 975 EXPECT_EQ("db2", GetDisplayedDatabases(cookies_model.get())); | 1123 EXPECT_EQ("db2", GetDisplayedDatabases(cookies_model.get())); |
| 976 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1124 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 977 GetDisplayedLocalStorages(cookies_model.get())); | 1125 GetDisplayedLocalStorages(cookies_model.get())); |
| 978 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1126 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 979 GetDisplayedSessionStorages(cookies_model.get())); | 1127 GetDisplayedSessionStorages(cookies_model.get())); |
| 980 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 1128 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 981 GetDisplayedIndexedDBs(cookies_model.get())); | 1129 GetDisplayedIndexedDBs(cookies_model.get())); |
| 982 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 1130 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 983 GetDisplayedFileSystems(cookies_model.get())); | 1131 GetDisplayedFileSystems(cookies_model.get())); |
| 984 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); | 1132 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); |
| 985 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); | 1133 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); |
| 986 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 1134 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 987 GetDisplayedServiceWorkers(cookies_model.get())); | 1135 GetDisplayedServiceWorkers(cookies_model.get())); |
| 988 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1136 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 989 GetDisplayedCacheStorages(cookies_model.get())); | 1137 GetDisplayedCacheStorages(cookies_model.get())); |
| 990 EXPECT_EQ(61, cookies_model->GetRoot()->GetTotalNodeCount()); | 1138 EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1139 EXPECT_EQ("https://media1/,https://media2/", | |
| 1140 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 1141 EXPECT_EQ(67, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 991 } | 1142 } |
| 992 | 1143 |
| 993 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(10)->GetChild(0)); | 1144 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(10)->GetChild(0)); |
| 994 { | 1145 { |
| 995 SCOPED_TRACE("First local storage origin removed"); | 1146 SCOPED_TRACE("First local storage origin removed"); |
| 996 EXPECT_STREQ("B,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 1147 EXPECT_STREQ("B,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 997 EXPECT_EQ("db2", GetDisplayedDatabases(cookies_model.get())); | 1148 EXPECT_EQ("db2", GetDisplayedDatabases(cookies_model.get())); |
| 998 EXPECT_EQ("http://host2:2/", | 1149 EXPECT_EQ("http://host2:2/", |
| 999 GetDisplayedLocalStorages(cookies_model.get())); | 1150 GetDisplayedLocalStorages(cookies_model.get())); |
| 1000 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1151 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 1001 GetDisplayedSessionStorages(cookies_model.get())); | 1152 GetDisplayedSessionStorages(cookies_model.get())); |
| 1002 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 1153 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 1003 GetDisplayedIndexedDBs(cookies_model.get())); | 1154 GetDisplayedIndexedDBs(cookies_model.get())); |
| 1004 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 1155 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 1005 GetDisplayedFileSystems(cookies_model.get())); | 1156 GetDisplayedFileSystems(cookies_model.get())); |
| 1006 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); | 1157 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); |
| 1007 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); | 1158 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); |
| 1008 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 1159 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 1009 GetDisplayedServiceWorkers(cookies_model.get())); | 1160 GetDisplayedServiceWorkers(cookies_model.get())); |
| 1010 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1161 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 1011 GetDisplayedCacheStorages(cookies_model.get())); | 1162 GetDisplayedCacheStorages(cookies_model.get())); |
| 1012 EXPECT_EQ(59, cookies_model->GetRoot()->GetTotalNodeCount()); | 1163 EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1164 EXPECT_EQ("https://media1/,https://media2/", | |
| 1165 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 1166 EXPECT_EQ(65, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 1013 } | 1167 } |
| 1014 } | 1168 } |
| 1015 | 1169 |
| 1016 TEST_F(CookiesTreeModelTest, RemoveCookieNode) { | 1170 TEST_F(CookiesTreeModelTest, RemoveCookieNode) { |
| 1017 std::unique_ptr<CookiesTreeModel> cookies_model( | 1171 std::unique_ptr<CookiesTreeModel> cookies_model( |
| 1018 CreateCookiesTreeModelWithInitialSample()); | 1172 CreateCookiesTreeModelWithInitialSample()); |
| 1019 | 1173 |
| 1020 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(3)->GetChild(0)); | 1174 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(3)->GetChild(0)); |
| 1021 { | 1175 { |
| 1022 SCOPED_TRACE("Second origin COOKIES node removed"); | 1176 SCOPED_TRACE("Second origin COOKIES node removed"); |
| 1023 EXPECT_STREQ("A,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 1177 EXPECT_STREQ("A,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 1024 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); | 1178 EXPECT_EQ("db1,db2", GetDisplayedDatabases(cookies_model.get())); |
| 1025 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1179 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 1026 GetDisplayedLocalStorages(cookies_model.get())); | 1180 GetDisplayedLocalStorages(cookies_model.get())); |
| 1027 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1181 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 1028 GetDisplayedSessionStorages(cookies_model.get())); | 1182 GetDisplayedSessionStorages(cookies_model.get())); |
| 1029 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 1183 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 1030 GetDisplayedIndexedDBs(cookies_model.get())); | 1184 GetDisplayedIndexedDBs(cookies_model.get())); |
| 1031 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 1185 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 1032 GetDisplayedFileSystems(cookies_model.get())); | 1186 GetDisplayedFileSystems(cookies_model.get())); |
| 1033 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); | 1187 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); |
| 1034 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); | 1188 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); |
| 1035 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 1189 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 1036 GetDisplayedServiceWorkers(cookies_model.get())); | 1190 GetDisplayedServiceWorkers(cookies_model.get())); |
| 1037 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1191 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 1038 GetDisplayedCacheStorages(cookies_model.get())); | 1192 GetDisplayedCacheStorages(cookies_model.get())); |
| 1039 // 63 because in this case, the origin remains, although the COOKIES | 1193 EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1194 EXPECT_EQ("https://media1/,https://media2/", | |
| 1195 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 1196 // 69 because in this case, the origin remains, although the COOKIES | |
| 1040 // node beneath it has been deleted. | 1197 // node beneath it has been deleted. |
| 1041 EXPECT_EQ(63, cookies_model->GetRoot()->GetTotalNodeCount()); | 1198 EXPECT_EQ(69, cookies_model->GetRoot()->GetTotalNodeCount()); |
| 1042 } | 1199 } |
| 1043 | 1200 |
| 1044 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(8)->GetChild(0)); | 1201 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(8)->GetChild(0)); |
| 1045 { | 1202 { |
| 1046 SCOPED_TRACE("First database origin removed"); | 1203 SCOPED_TRACE("First database origin removed"); |
| 1047 EXPECT_STREQ("A,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 1204 EXPECT_STREQ("A,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 1048 EXPECT_EQ("db2", GetDisplayedDatabases(cookies_model.get())); | 1205 EXPECT_EQ("db2", GetDisplayedDatabases(cookies_model.get())); |
| 1049 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1206 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 1050 GetDisplayedLocalStorages(cookies_model.get())); | 1207 GetDisplayedLocalStorages(cookies_model.get())); |
| 1051 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1208 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 1052 GetDisplayedSessionStorages(cookies_model.get())); | 1209 GetDisplayedSessionStorages(cookies_model.get())); |
| 1053 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 1210 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 1054 GetDisplayedIndexedDBs(cookies_model.get())); | 1211 GetDisplayedIndexedDBs(cookies_model.get())); |
| 1055 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 1212 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 1056 GetDisplayedFileSystems(cookies_model.get())); | 1213 GetDisplayedFileSystems(cookies_model.get())); |
| 1057 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); | 1214 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); |
| 1058 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); | 1215 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); |
| 1059 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 1216 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 1060 GetDisplayedServiceWorkers(cookies_model.get())); | 1217 GetDisplayedServiceWorkers(cookies_model.get())); |
| 1061 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1218 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 1062 GetDisplayedCacheStorages(cookies_model.get())); | 1219 GetDisplayedCacheStorages(cookies_model.get())); |
| 1063 EXPECT_EQ(61, cookies_model->GetRoot()->GetTotalNodeCount()); | 1220 EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1221 EXPECT_EQ("https://media1/,https://media2/", | |
| 1222 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 1223 EXPECT_EQ(67, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 1064 } | 1224 } |
| 1065 | 1225 |
| 1066 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(10)->GetChild(0)); | 1226 DeleteStoredObjects(cookies_model->GetRoot()->GetChild(10)->GetChild(0)); |
| 1067 { | 1227 { |
| 1068 SCOPED_TRACE("First local storage origin removed"); | 1228 SCOPED_TRACE("First local storage origin removed"); |
| 1069 EXPECT_STREQ("A,C", GetDisplayedCookies(cookies_model.get()).c_str()); | 1229 EXPECT_STREQ("A,C", GetDisplayedCookies(cookies_model.get()).c_str()); |
| 1070 EXPECT_EQ("db2", GetDisplayedDatabases(cookies_model.get())); | 1230 EXPECT_EQ("db2", GetDisplayedDatabases(cookies_model.get())); |
| 1071 EXPECT_EQ("http://host2:2/", | 1231 EXPECT_EQ("http://host2:2/", |
| 1072 GetDisplayedLocalStorages(cookies_model.get())); | 1232 GetDisplayedLocalStorages(cookies_model.get())); |
| 1073 EXPECT_EQ("http://host1:1/,http://host2:2/", | 1233 EXPECT_EQ("http://host1:1/,http://host2:2/", |
| 1074 GetDisplayedSessionStorages(cookies_model.get())); | 1234 GetDisplayedSessionStorages(cookies_model.get())); |
| 1075 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", | 1235 EXPECT_EQ("http://idbhost1:1/,http://idbhost2:2/", |
| 1076 GetDisplayedIndexedDBs(cookies_model.get())); | 1236 GetDisplayedIndexedDBs(cookies_model.get())); |
| 1077 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", | 1237 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", |
| 1078 GetDisplayedFileSystems(cookies_model.get())); | 1238 GetDisplayedFileSystems(cookies_model.get())); |
| 1079 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); | 1239 EXPECT_EQ("quotahost1,quotahost2", GetDisplayedQuotas(cookies_model.get())); |
| 1080 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); | 1240 EXPECT_EQ("sbc1,sbc2", GetDisplayedChannelIDs(cookies_model.get())); |
| 1081 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", | 1241 EXPECT_EQ("https://swhost1:1/,https://swhost2:2/", |
| 1082 GetDisplayedServiceWorkers(cookies_model.get())); | 1242 GetDisplayedServiceWorkers(cookies_model.get())); |
| 1083 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", | 1243 EXPECT_EQ("https://cshost1:1/,https://cshost2:2/", |
| 1084 GetDisplayedCacheStorages(cookies_model.get())); | 1244 GetDisplayedCacheStorages(cookies_model.get())); |
| 1085 EXPECT_EQ(59, cookies_model->GetRoot()->GetTotalNodeCount()); | 1245 EXPECT_EQ("xyz.com", GetDisplayedFlashLSOs(cookies_model.get())); |
| 1246 EXPECT_EQ("https://media1/,https://media2/", | |
| 1247 GetDisplayedMediaLicenses(cookies_model.get())); | |
| 1248 EXPECT_EQ(65, cookies_model->GetRoot()->GetTotalNodeCount()); | |
| 1086 } | 1249 } |
| 1087 } | 1250 } |
| 1088 | 1251 |
| 1089 TEST_F(CookiesTreeModelTest, RemoveSingleCookieNode) { | 1252 TEST_F(CookiesTreeModelTest, RemoveSingleCookieNode) { |
| 1090 LocalDataContainer* container = | 1253 LocalDataContainer* container = |
| 1091 new LocalDataContainer(mock_browsing_data_cookie_helper_.get(), | 1254 new LocalDataContainer(mock_browsing_data_cookie_helper_.get(), |
| 1092 mock_browsing_data_database_helper_.get(), | 1255 mock_browsing_data_database_helper_.get(), |
| 1093 mock_browsing_data_local_storage_helper_.get(), | 1256 mock_browsing_data_local_storage_helper_.get(), |
| 1094 mock_browsing_data_session_storage_helper_.get(), | 1257 mock_browsing_data_session_storage_helper_.get(), |
| 1095 mock_browsing_data_appcache_helper_.get(), | 1258 mock_browsing_data_appcache_helper_.get(), |
| 1096 mock_browsing_data_indexed_db_helper_.get(), | 1259 mock_browsing_data_indexed_db_helper_.get(), |
| 1097 mock_browsing_data_file_system_helper_.get(), | 1260 mock_browsing_data_file_system_helper_.get(), |
| 1098 mock_browsing_data_quota_helper_.get(), | 1261 mock_browsing_data_quota_helper_.get(), |
| 1099 mock_browsing_data_channel_id_helper_.get(), | 1262 mock_browsing_data_channel_id_helper_.get(), |
| 1100 mock_browsing_data_service_worker_helper_.get(), | 1263 mock_browsing_data_service_worker_helper_.get(), |
| 1101 mock_browsing_data_cache_storage_helper_.get(), | 1264 mock_browsing_data_cache_storage_helper_.get(), |
| 1102 mock_browsing_data_flash_lso_helper_.get()); | 1265 mock_browsing_data_flash_lso_helper_.get(), |
| 1266 mock_browsing_data_media_license_helper_.get()); | |
| 1103 CookiesTreeModel cookies_model(container, special_storage_policy()); | 1267 CookiesTreeModel cookies_model(container, special_storage_policy()); |
| 1104 | 1268 |
| 1105 mock_browsing_data_cookie_helper_-> | 1269 mock_browsing_data_cookie_helper_-> |
| 1106 AddCookieSamples(GURL("http://foo1"), "A=1"); | 1270 AddCookieSamples(GURL("http://foo1"), "A=1"); |
| 1107 mock_browsing_data_cookie_helper_-> | 1271 mock_browsing_data_cookie_helper_-> |
| 1108 AddCookieSamples(GURL("http://foo2"), "B=1"); | 1272 AddCookieSamples(GURL("http://foo2"), "B=1"); |
| 1109 mock_browsing_data_cookie_helper_-> | 1273 mock_browsing_data_cookie_helper_-> |
| 1110 AddCookieSamples(GURL("http://foo3"), "C=1"); | 1274 AddCookieSamples(GURL("http://foo3"), "C=1"); |
| 1111 mock_browsing_data_cookie_helper_-> | 1275 mock_browsing_data_cookie_helper_-> |
| 1112 AddCookieSamples(GURL("http://foo3"), "D=1"); | 1276 AddCookieSamples(GURL("http://foo3"), "D=1"); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1199 mock_browsing_data_database_helper_.get(), | 1363 mock_browsing_data_database_helper_.get(), |
| 1200 mock_browsing_data_local_storage_helper_.get(), | 1364 mock_browsing_data_local_storage_helper_.get(), |
| 1201 mock_browsing_data_session_storage_helper_.get(), | 1365 mock_browsing_data_session_storage_helper_.get(), |
| 1202 mock_browsing_data_appcache_helper_.get(), | 1366 mock_browsing_data_appcache_helper_.get(), |
| 1203 mock_browsing_data_indexed_db_helper_.get(), | 1367 mock_browsing_data_indexed_db_helper_.get(), |
| 1204 mock_browsing_data_file_system_helper_.get(), | 1368 mock_browsing_data_file_system_helper_.get(), |
| 1205 mock_browsing_data_quota_helper_.get(), | 1369 mock_browsing_data_quota_helper_.get(), |
| 1206 mock_browsing_data_channel_id_helper_.get(), | 1370 mock_browsing_data_channel_id_helper_.get(), |
| 1207 mock_browsing_data_service_worker_helper_.get(), | 1371 mock_browsing_data_service_worker_helper_.get(), |
| 1208 mock_browsing_data_cache_storage_helper_.get(), | 1372 mock_browsing_data_cache_storage_helper_.get(), |
| 1209 mock_browsing_data_flash_lso_helper_.get()); | 1373 mock_browsing_data_flash_lso_helper_.get(), |
| 1374 mock_browsing_data_media_license_helper_.get()); | |
| 1210 CookiesTreeModel cookies_model(container, special_storage_policy()); | 1375 CookiesTreeModel cookies_model(container, special_storage_policy()); |
| 1211 | 1376 |
| 1212 mock_browsing_data_cookie_helper_-> | 1377 mock_browsing_data_cookie_helper_-> |
| 1213 AddCookieSamples(GURL("http://foo1"), "A=1"); | 1378 AddCookieSamples(GURL("http://foo1"), "A=1"); |
| 1214 mock_browsing_data_cookie_helper_-> | 1379 mock_browsing_data_cookie_helper_-> |
| 1215 AddCookieSamples(GURL("http://foo2"), "B=1"); | 1380 AddCookieSamples(GURL("http://foo2"), "B=1"); |
| 1216 mock_browsing_data_cookie_helper_-> | 1381 mock_browsing_data_cookie_helper_-> |
| 1217 AddCookieSamples(GURL("http://foo3"), "C=1"); | 1382 AddCookieSamples(GURL("http://foo3"), "C=1"); |
| 1218 mock_browsing_data_cookie_helper_-> | 1383 mock_browsing_data_cookie_helper_-> |
| 1219 AddCookieSamples(GURL("http://foo3"), "D=1"); | 1384 AddCookieSamples(GURL("http://foo3"), "D=1"); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1309 mock_browsing_data_database_helper_.get(), | 1474 mock_browsing_data_database_helper_.get(), |
| 1310 mock_browsing_data_local_storage_helper_.get(), | 1475 mock_browsing_data_local_storage_helper_.get(), |
| 1311 mock_browsing_data_session_storage_helper_.get(), | 1476 mock_browsing_data_session_storage_helper_.get(), |
| 1312 mock_browsing_data_appcache_helper_.get(), | 1477 mock_browsing_data_appcache_helper_.get(), |
| 1313 mock_browsing_data_indexed_db_helper_.get(), | 1478 mock_browsing_data_indexed_db_helper_.get(), |
| 1314 mock_browsing_data_file_system_helper_.get(), | 1479 mock_browsing_data_file_system_helper_.get(), |
| 1315 mock_browsing_data_quota_helper_.get(), | 1480 mock_browsing_data_quota_helper_.get(), |
| 1316 mock_browsing_data_channel_id_helper_.get(), | 1481 mock_browsing_data_channel_id_helper_.get(), |
| 1317 mock_browsing_data_service_worker_helper_.get(), | 1482 mock_browsing_data_service_worker_helper_.get(), |
| 1318 mock_browsing_data_cache_storage_helper_.get(), | 1483 mock_browsing_data_cache_storage_helper_.get(), |
| 1319 mock_browsing_data_flash_lso_helper_.get()); | 1484 mock_browsing_data_flash_lso_helper_.get(), |
| 1485 mock_browsing_data_media_license_helper_.get()); | |
| 1320 CookiesTreeModel cookies_model(container, special_storage_policy()); | 1486 CookiesTreeModel cookies_model(container, special_storage_policy()); |
| 1321 | 1487 |
| 1322 mock_browsing_data_cookie_helper_-> | 1488 mock_browsing_data_cookie_helper_-> |
| 1323 AddCookieSamples(GURL("http://foo1"), "A=1"); | 1489 AddCookieSamples(GURL("http://foo1"), "A=1"); |
| 1324 mock_browsing_data_cookie_helper_-> | 1490 mock_browsing_data_cookie_helper_-> |
| 1325 AddCookieSamples(GURL("http://foo2"), "B=1"); | 1491 AddCookieSamples(GURL("http://foo2"), "B=1"); |
| 1326 mock_browsing_data_cookie_helper_-> | 1492 mock_browsing_data_cookie_helper_-> |
| 1327 AddCookieSamples(GURL("http://foo3"), "C=1"); | 1493 AddCookieSamples(GURL("http://foo3"), "C=1"); |
| 1328 mock_browsing_data_cookie_helper_-> | 1494 mock_browsing_data_cookie_helper_-> |
| 1329 AddCookieSamples(GURL("http://foo3"), "D=1"); | 1495 AddCookieSamples(GURL("http://foo3"), "D=1"); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 1353 mock_browsing_data_database_helper_.get(), | 1519 mock_browsing_data_database_helper_.get(), |
| 1354 mock_browsing_data_local_storage_helper_.get(), | 1520 mock_browsing_data_local_storage_helper_.get(), |
| 1355 mock_browsing_data_session_storage_helper_.get(), | 1521 mock_browsing_data_session_storage_helper_.get(), |
| 1356 mock_browsing_data_appcache_helper_.get(), | 1522 mock_browsing_data_appcache_helper_.get(), |
| 1357 mock_browsing_data_indexed_db_helper_.get(), | 1523 mock_browsing_data_indexed_db_helper_.get(), |
| 1358 mock_browsing_data_file_system_helper_.get(), | 1524 mock_browsing_data_file_system_helper_.get(), |
| 1359 mock_browsing_data_quota_helper_.get(), | 1525 mock_browsing_data_quota_helper_.get(), |
| 1360 mock_browsing_data_channel_id_helper_.get(), | 1526 mock_browsing_data_channel_id_helper_.get(), |
| 1361 mock_browsing_data_service_worker_helper_.get(), | 1527 mock_browsing_data_service_worker_helper_.get(), |
| 1362 mock_browsing_data_cache_storage_helper_.get(), | 1528 mock_browsing_data_cache_storage_helper_.get(), |
| 1363 mock_browsing_data_flash_lso_helper_.get()); | 1529 mock_browsing_data_flash_lso_helper_.get(), |
| 1530 mock_browsing_data_media_license_helper_.get()); | |
| 1364 CookiesTreeModel cookies_model(container, special_storage_policy()); | 1531 CookiesTreeModel cookies_model(container, special_storage_policy()); |
| 1365 | 1532 |
| 1366 mock_browsing_data_cookie_helper_-> | 1533 mock_browsing_data_cookie_helper_-> |
| 1367 AddCookieSamples(GURL("http://a.foo2.com"), "A=1"); | 1534 AddCookieSamples(GURL("http://a.foo2.com"), "A=1"); |
| 1368 mock_browsing_data_cookie_helper_-> | 1535 mock_browsing_data_cookie_helper_-> |
| 1369 AddCookieSamples(GURL("http://foo2.com"), "B=1"); | 1536 AddCookieSamples(GURL("http://foo2.com"), "B=1"); |
| 1370 mock_browsing_data_cookie_helper_-> | 1537 mock_browsing_data_cookie_helper_-> |
| 1371 AddCookieSamples(GURL("http://b.foo1.com"), "C=1"); | 1538 AddCookieSamples(GURL("http://b.foo1.com"), "C=1"); |
| 1372 // Leading dot on the foo4 | 1539 // Leading dot on the foo4 |
| 1373 mock_browsing_data_cookie_helper_->AddCookieSamples( | 1540 mock_browsing_data_cookie_helper_->AddCookieSamples( |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 1402 mock_browsing_data_database_helper_.get(), | 1569 mock_browsing_data_database_helper_.get(), |
| 1403 mock_browsing_data_local_storage_helper_.get(), | 1570 mock_browsing_data_local_storage_helper_.get(), |
| 1404 mock_browsing_data_session_storage_helper_.get(), | 1571 mock_browsing_data_session_storage_helper_.get(), |
| 1405 mock_browsing_data_appcache_helper_.get(), | 1572 mock_browsing_data_appcache_helper_.get(), |
| 1406 mock_browsing_data_indexed_db_helper_.get(), | 1573 mock_browsing_data_indexed_db_helper_.get(), |
| 1407 mock_browsing_data_file_system_helper_.get(), | 1574 mock_browsing_data_file_system_helper_.get(), |
| 1408 mock_browsing_data_quota_helper_.get(), | 1575 mock_browsing_data_quota_helper_.get(), |
| 1409 mock_browsing_data_channel_id_helper_.get(), | 1576 mock_browsing_data_channel_id_helper_.get(), |
| 1410 mock_browsing_data_service_worker_helper_.get(), | 1577 mock_browsing_data_service_worker_helper_.get(), |
| 1411 mock_browsing_data_cache_storage_helper_.get(), | 1578 mock_browsing_data_cache_storage_helper_.get(), |
| 1412 mock_browsing_data_flash_lso_helper_.get()); | 1579 mock_browsing_data_flash_lso_helper_.get(), |
| 1580 mock_browsing_data_media_license_helper_.get()); | |
| 1413 CookiesTreeModel cookies_model(container, special_storage_policy()); | 1581 CookiesTreeModel cookies_model(container, special_storage_policy()); |
| 1414 | 1582 |
| 1415 mock_browsing_data_cookie_helper_->AddCookieSamples(host, "A=1"); | 1583 mock_browsing_data_cookie_helper_->AddCookieSamples(host, "A=1"); |
| 1416 mock_browsing_data_cookie_helper_->Notify(); | 1584 mock_browsing_data_cookie_helper_->Notify(); |
| 1417 | 1585 |
| 1418 TestingProfile profile; | 1586 TestingProfile profile; |
| 1419 HostContentSettingsMap* content_settings = | 1587 HostContentSettingsMap* content_settings = |
| 1420 HostContentSettingsMapFactory::GetForProfile(&profile); | 1588 HostContentSettingsMapFactory::GetForProfile(&profile); |
| 1421 content_settings::CookieSettings* cookie_settings = | 1589 content_settings::CookieSettings* cookie_settings = |
| 1422 CookieSettingsFactory::GetForProfile(&profile).get(); | 1590 CookieSettingsFactory::GetForProfile(&profile).get(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1507 mock_browsing_data_database_helper_.get(), | 1675 mock_browsing_data_database_helper_.get(), |
| 1508 mock_browsing_data_local_storage_helper_.get(), | 1676 mock_browsing_data_local_storage_helper_.get(), |
| 1509 mock_browsing_data_session_storage_helper_.get(), | 1677 mock_browsing_data_session_storage_helper_.get(), |
| 1510 mock_browsing_data_appcache_helper_.get(), | 1678 mock_browsing_data_appcache_helper_.get(), |
| 1511 mock_browsing_data_indexed_db_helper_.get(), | 1679 mock_browsing_data_indexed_db_helper_.get(), |
| 1512 mock_browsing_data_file_system_helper_.get(), | 1680 mock_browsing_data_file_system_helper_.get(), |
| 1513 mock_browsing_data_quota_helper_.get(), | 1681 mock_browsing_data_quota_helper_.get(), |
| 1514 mock_browsing_data_channel_id_helper_.get(), | 1682 mock_browsing_data_channel_id_helper_.get(), |
| 1515 mock_browsing_data_service_worker_helper_.get(), | 1683 mock_browsing_data_service_worker_helper_.get(), |
| 1516 mock_browsing_data_cache_storage_helper_.get(), | 1684 mock_browsing_data_cache_storage_helper_.get(), |
| 1517 mock_browsing_data_flash_lso_helper_.get()); | 1685 mock_browsing_data_flash_lso_helper_.get(), |
| 1686 mock_browsing_data_media_license_helper_.get()); | |
| 1518 CookiesTreeModel cookies_model(container, special_storage_policy()); | 1687 CookiesTreeModel cookies_model(container, special_storage_policy()); |
| 1519 | 1688 |
| 1520 mock_browsing_data_cookie_helper_-> | 1689 mock_browsing_data_cookie_helper_-> |
| 1521 AddCookieSamples(GURL("http://123.com"), "A=1"); | 1690 AddCookieSamples(GURL("http://123.com"), "A=1"); |
| 1522 mock_browsing_data_cookie_helper_-> | 1691 mock_browsing_data_cookie_helper_-> |
| 1523 AddCookieSamples(GURL("http://foo1.com"), "B=1"); | 1692 AddCookieSamples(GURL("http://foo1.com"), "B=1"); |
| 1524 mock_browsing_data_cookie_helper_-> | 1693 mock_browsing_data_cookie_helper_-> |
| 1525 AddCookieSamples(GURL("http://foo2.com"), "C=1"); | 1694 AddCookieSamples(GURL("http://foo2.com"), "C=1"); |
| 1526 mock_browsing_data_cookie_helper_-> | 1695 mock_browsing_data_cookie_helper_-> |
| 1527 AddCookieSamples(GURL("http://foo3.com"), "D=1"); | 1696 AddCookieSamples(GURL("http://foo3.com"), "D=1"); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1549 mock_browsing_data_database_helper_.get(), | 1718 mock_browsing_data_database_helper_.get(), |
| 1550 mock_browsing_data_local_storage_helper_.get(), | 1719 mock_browsing_data_local_storage_helper_.get(), |
| 1551 mock_browsing_data_session_storage_helper_.get(), | 1720 mock_browsing_data_session_storage_helper_.get(), |
| 1552 mock_browsing_data_appcache_helper_.get(), | 1721 mock_browsing_data_appcache_helper_.get(), |
| 1553 mock_browsing_data_indexed_db_helper_.get(), | 1722 mock_browsing_data_indexed_db_helper_.get(), |
| 1554 mock_browsing_data_file_system_helper_.get(), | 1723 mock_browsing_data_file_system_helper_.get(), |
| 1555 mock_browsing_data_quota_helper_.get(), | 1724 mock_browsing_data_quota_helper_.get(), |
| 1556 mock_browsing_data_channel_id_helper_.get(), | 1725 mock_browsing_data_channel_id_helper_.get(), |
| 1557 mock_browsing_data_service_worker_helper_.get(), | 1726 mock_browsing_data_service_worker_helper_.get(), |
| 1558 mock_browsing_data_cache_storage_helper_.get(), | 1727 mock_browsing_data_cache_storage_helper_.get(), |
| 1559 mock_browsing_data_flash_lso_helper_.get()); | 1728 mock_browsing_data_flash_lso_helper_.get(), |
| 1729 mock_browsing_data_media_license_helper_.get()); | |
| 1560 CookiesTreeModel cookies_model(container, special_storage_policy()); | 1730 CookiesTreeModel cookies_model(container, special_storage_policy()); |
| 1561 | 1731 |
| 1562 mock_browsing_data_cookie_helper_->AddCookieSamples( | 1732 mock_browsing_data_cookie_helper_->AddCookieSamples( |
| 1563 GURL("file:///tmp/test.html"), "A=1"); | 1733 GURL("file:///tmp/test.html"), "A=1"); |
| 1564 mock_browsing_data_cookie_helper_->AddCookieSamples( | 1734 mock_browsing_data_cookie_helper_->AddCookieSamples( |
| 1565 GURL("http://example.com"), "B=1"); | 1735 GURL("http://example.com"), "B=1"); |
| 1566 mock_browsing_data_cookie_helper_->AddCookieSamples( | 1736 mock_browsing_data_cookie_helper_->AddCookieSamples( |
| 1567 GURL("http://example.com/"), "C=1"); | 1737 GURL("http://example.com/"), "C=1"); |
| 1568 mock_browsing_data_cookie_helper_->AddCookieSamples( | 1738 mock_browsing_data_cookie_helper_->AddCookieSamples( |
| 1569 GURL("http://example.com/test"), "D=1"); | 1739 GURL("http://example.com/test"), "D=1"); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1637 mock_browsing_data_database_helper_.get(), | 1807 mock_browsing_data_database_helper_.get(), |
| 1638 mock_browsing_data_local_storage_helper_.get(), | 1808 mock_browsing_data_local_storage_helper_.get(), |
| 1639 mock_browsing_data_session_storage_helper_.get(), | 1809 mock_browsing_data_session_storage_helper_.get(), |
| 1640 mock_browsing_data_appcache_helper_.get(), | 1810 mock_browsing_data_appcache_helper_.get(), |
| 1641 mock_browsing_data_indexed_db_helper_.get(), | 1811 mock_browsing_data_indexed_db_helper_.get(), |
| 1642 mock_browsing_data_file_system_helper_.get(), | 1812 mock_browsing_data_file_system_helper_.get(), |
| 1643 mock_browsing_data_quota_helper_.get(), | 1813 mock_browsing_data_quota_helper_.get(), |
| 1644 mock_browsing_data_channel_id_helper_.get(), | 1814 mock_browsing_data_channel_id_helper_.get(), |
| 1645 mock_browsing_data_service_worker_helper_.get(), | 1815 mock_browsing_data_service_worker_helper_.get(), |
| 1646 mock_browsing_data_cache_storage_helper_.get(), | 1816 mock_browsing_data_cache_storage_helper_.get(), |
| 1647 mock_browsing_data_flash_lso_helper_.get()); | 1817 mock_browsing_data_flash_lso_helper_.get(), |
| 1818 mock_browsing_data_media_license_helper_.get()); | |
| 1648 CookiesTreeModel cookies_model(container, special_storage_policy()); | 1819 CookiesTreeModel cookies_model(container, special_storage_policy()); |
| 1649 | 1820 |
| 1650 mock_browsing_data_cookie_helper_-> | 1821 mock_browsing_data_cookie_helper_-> |
| 1651 AddCookieSamples(GURL(), "A=1"); | 1822 AddCookieSamples(GURL(), "A=1"); |
| 1652 mock_browsing_data_cookie_helper_->Notify(); | 1823 mock_browsing_data_cookie_helper_->Notify(); |
| 1653 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model)); | 1824 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model)); |
| 1654 } | 1825 } |
| 1655 | 1826 |
| 1656 } // namespace | 1827 } // namespace |
| OLD | NEW |