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

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

Issue 1605453003: Ensure content settings aren't persisted in the guest profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 kBlockedFirstPartySite("http://no.thirdparties.com"), 24 kBlockedFirstPartySite("http://no.thirdparties.com"),
25 kChromeURL("chrome://foo"), 25 kChromeURL("chrome://foo"),
26 kExtensionURL("chrome-extension://deadbeef"), 26 kExtensionURL("chrome-extension://deadbeef"),
27 kHttpSite("http://example.com"), 27 kHttpSite("http://example.com"),
28 kHttpsSite("https://example.com"), 28 kHttpsSite("https://example.com"),
29 kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) { 29 kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) {
30 CookieSettings::RegisterProfilePrefs(prefs_.registry()); 30 CookieSettings::RegisterProfilePrefs(prefs_.registry());
31 HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); 31 HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry());
32 settings_map_ = new HostContentSettingsMap(&prefs_, false); 32 settings_map_ = new HostContentSettingsMap(
33 &prefs_, false /* incognito_profile */, false /* guest_profile */);
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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 289
289 // XHRs stemming from extensions are exempt from third-party cookie blocking 290 // XHRs stemming from extensions are exempt from third-party cookie blocking
290 // rules (as the first party is always the extension's security origin). 291 // rules (as the first party is always the extension's security origin).
291 EXPECT_TRUE( 292 EXPECT_TRUE(
292 cookie_settings_->IsSettingCookieAllowed(kBlockedSite, kExtensionURL)); 293 cookie_settings_->IsSettingCookieAllowed(kBlockedSite, kExtensionURL));
293 } 294 }
294 295
295 } // namespace 296 } // namespace
296 297
297 } // namespace content_settings 298 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698