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

Side by Side Diff: components/content_settings/core/browser/cookie_settings_unittest.cc

Issue 2078893002: Add callback list to PrefModelAssociator after sync data is loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_domain_scoped_settings
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/content_settings/core/browser/cookie_settings.h" 5 #include "components/content_settings/core/browser/cookie_settings.h"
6 6
7 #include "components/content_settings/core/browser/host_content_settings_map.h" 7 #include "components/content_settings/core/browser/host_content_settings_map.h"
8 #include "components/content_settings/core/common/content_settings_pattern.h" 8 #include "components/content_settings/core/common/content_settings_pattern.h"
9 #include "components/content_settings/core/common/pref_names.h" 9 #include "components/content_settings/core/common/pref_names.h"
10 #include "components/pref_registry/testing_pref_service_syncable.h" 10 #include "components/pref_registry/testing_pref_service_syncable.h"
(...skipping 11 matching lines...) Expand all
22 kAllowedSite("http://good.allays.com"), 22 kAllowedSite("http://good.allays.com"),
23 kFirstPartySite("http://cool.things.com"), 23 kFirstPartySite("http://cool.things.com"),
24 kChromeURL("chrome://foo"), 24 kChromeURL("chrome://foo"),
25 kExtensionURL("chrome-extension://deadbeef"), 25 kExtensionURL("chrome-extension://deadbeef"),
26 kHttpSite("http://example.com"), 26 kHttpSite("http://example.com"),
27 kHttpsSite("https://example.com"), 27 kHttpsSite("https://example.com"),
28 kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) { 28 kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) {
29 CookieSettings::RegisterProfilePrefs(prefs_.registry()); 29 CookieSettings::RegisterProfilePrefs(prefs_.registry());
30 HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); 30 HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry());
31 settings_map_ = new HostContentSettingsMap( 31 settings_map_ = new HostContentSettingsMap(
32 &prefs_, false /* incognito_profile */, false /* guest_profile */); 32 &prefs_, false /* incognito_profile */, false /* guest_profile */,
33 nullptr /* PrefServiceSyncable* */);
raymes 2016/06/29 03:50:01 nit: same here
lshang 2016/06/30 05:03:35 We've changed to not pass in the pointer, so no ne
33 cookie_settings_ = 34 cookie_settings_ =
34 new CookieSettings(settings_map_.get(), &prefs_, "chrome-extension"); 35 new CookieSettings(settings_map_.get(), &prefs_, "chrome-extension");
35 } 36 }
36 37
37 ~CookieSettingsTest() override { settings_map_->ShutdownOnUIThread(); } 38 ~CookieSettingsTest() override { settings_map_->ShutdownOnUIThread(); }
38 39
39 protected: 40 protected:
40 user_prefs::TestingPrefServiceSyncable prefs_; 41 user_prefs::TestingPrefServiceSyncable prefs_;
41 scoped_refptr<HostContentSettingsMap> settings_map_; 42 scoped_refptr<HostContentSettingsMap> settings_map_;
42 scoped_refptr<CookieSettings> cookie_settings_; 43 scoped_refptr<CookieSettings> cookie_settings_;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 230
230 // XHRs stemming from extensions are exempt from third-party cookie blocking 231 // XHRs stemming from extensions are exempt from third-party cookie blocking
231 // rules (as the first party is always the extension's security origin). 232 // rules (as the first party is always the extension's security origin).
232 EXPECT_TRUE( 233 EXPECT_TRUE(
233 cookie_settings_->IsSettingCookieAllowed(kBlockedSite, kExtensionURL)); 234 cookie_settings_->IsSettingCookieAllowed(kBlockedSite, kExtensionURL));
234 } 235 }
235 236
236 } // namespace 237 } // namespace
237 238
238 } // namespace content_settings 239 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698