| 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 "components/content_settings/core/browser/cookie_settings.h" | 5 #include "components/content_settings/core/browser/cookie_settings.h" | 
| 6 | 6 | 
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" | 
| 8 #include "components/content_settings/core/browser/host_content_settings_map.h" | 8 #include "components/content_settings/core/browser/host_content_settings_map.h" | 
| 9 #include "components/content_settings/core/common/content_settings_pattern.h" | 9 #include "components/content_settings/core/common/content_settings_pattern.h" | 
| 10 #include "components/content_settings/core/common/pref_names.h" | 10 #include "components/content_settings/core/common/pref_names.h" | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 24         kAllowedSite("http://good.allays.com"), | 24         kAllowedSite("http://good.allays.com"), | 
| 25         kFirstPartySite("http://cool.things.com"), | 25         kFirstPartySite("http://cool.things.com"), | 
| 26         kChromeURL("chrome://foo"), | 26         kChromeURL("chrome://foo"), | 
| 27         kExtensionURL("chrome-extension://deadbeef"), | 27         kExtensionURL("chrome-extension://deadbeef"), | 
| 28         kHttpSite("http://example.com"), | 28         kHttpSite("http://example.com"), | 
| 29         kHttpsSite("https://example.com"), | 29         kHttpsSite("https://example.com"), | 
| 30         kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) { | 30         kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) { | 
| 31     CookieSettings::RegisterProfilePrefs(prefs_.registry()); | 31     CookieSettings::RegisterProfilePrefs(prefs_.registry()); | 
| 32     HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); | 32     HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); | 
| 33     settings_map_ = new HostContentSettingsMap( | 33     settings_map_ = new HostContentSettingsMap( | 
| 34         &prefs_, false /* incognito_profile */, false /* guest_profile */); | 34         &prefs_, false /* incognito_profile */, false /* guest_profile */, | 
|  | 35         false /* store_last_modified */); | 
| 35     cookie_settings_ = | 36     cookie_settings_ = | 
| 36         new CookieSettings(settings_map_.get(), &prefs_, "chrome-extension"); | 37         new CookieSettings(settings_map_.get(), &prefs_, "chrome-extension"); | 
| 37   } | 38   } | 
| 38 | 39 | 
| 39   ~CookieSettingsTest() override { settings_map_->ShutdownOnUIThread(); } | 40   ~CookieSettingsTest() override { settings_map_->ShutdownOnUIThread(); } | 
| 40 | 41 | 
| 41  protected: | 42  protected: | 
| 42   // There must be a valid ThreadTaskRunnerHandle in HostContentSettingsMap's | 43   // There must be a valid ThreadTaskRunnerHandle in HostContentSettingsMap's | 
| 43   // scope. | 44   // scope. | 
| 44   base::MessageLoop message_loop_; | 45   base::MessageLoop message_loop_; | 
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 204 | 205 | 
| 205   // XHRs stemming from extensions are exempt from third-party cookie blocking | 206   // XHRs stemming from extensions are exempt from third-party cookie blocking | 
| 206   // rules (as the first party is always the extension's security origin). | 207   // rules (as the first party is always the extension's security origin). | 
| 207   EXPECT_TRUE( | 208   EXPECT_TRUE( | 
| 208       cookie_settings_->IsCookieAccessAllowed(kBlockedSite, kExtensionURL)); | 209       cookie_settings_->IsCookieAccessAllowed(kBlockedSite, kExtensionURL)); | 
| 209 } | 210 } | 
| 210 | 211 | 
| 211 }  // namespace | 212 }  // namespace | 
| 212 | 213 | 
| 213 }  // namespace content_settings | 214 }  // namespace content_settings | 
| OLD | NEW | 
|---|