| 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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/content_settings/cookie_settings.h" | 9 #include "chrome/browser/content_settings/cookie_settings.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 kBlockedSite("http://ads.thirdparty.com"), | 28 kBlockedSite("http://ads.thirdparty.com"), |
| 29 kAllowedSite("http://good.allays.com"), | 29 kAllowedSite("http://good.allays.com"), |
| 30 kFirstPartySite("http://cool.things.com"), | 30 kFirstPartySite("http://cool.things.com"), |
| 31 kBlockedFirstPartySite("http://no.thirdparties.com"), | 31 kBlockedFirstPartySite("http://no.thirdparties.com"), |
| 32 kExtensionURL("chrome-extension://deadbeef"), | 32 kExtensionURL("chrome-extension://deadbeef"), |
| 33 kHttpsSite("https://example.com"), | 33 kHttpsSite("https://example.com"), |
| 34 kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) { | 34 kAllHttpsSitesPattern(ContentSettingsPattern::FromString("https://*")) { |
| 35 } | 35 } |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 MessageLoop message_loop_; | 38 base::MessageLoop message_loop_; |
| 39 content::TestBrowserThread ui_thread_; | 39 content::TestBrowserThread ui_thread_; |
| 40 TestingProfile profile_; | 40 TestingProfile profile_; |
| 41 CookieSettings* cookie_settings_; | 41 CookieSettings* cookie_settings_; |
| 42 const GURL kBlockedSite; | 42 const GURL kBlockedSite; |
| 43 const GURL kAllowedSite; | 43 const GURL kAllowedSite; |
| 44 const GURL kFirstPartySite; | 44 const GURL kFirstPartySite; |
| 45 const GURL kBlockedFirstPartySite; | 45 const GURL kBlockedFirstPartySite; |
| 46 const GURL kExtensionURL; | 46 const GURL kExtensionURL; |
| 47 const GURL kHttpsSite; | 47 const GURL kHttpsSite; |
| 48 ContentSettingsPattern kAllHttpsSitesPattern; | 48 ContentSettingsPattern kAllHttpsSitesPattern; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 TEST_F(CookieSettingsTest, ExtensionsThirdParty) { | 284 TEST_F(CookieSettingsTest, ExtensionsThirdParty) { |
| 285 profile_.GetPrefs()->SetBoolean(prefs::kBlockThirdPartyCookies, true); | 285 profile_.GetPrefs()->SetBoolean(prefs::kBlockThirdPartyCookies, true); |
| 286 | 286 |
| 287 // XHRs stemming from extensions are exempt from third-party cookie blocking | 287 // XHRs stemming from extensions are exempt from third-party cookie blocking |
| 288 // rules (as the first party is always the extension's security origin). | 288 // rules (as the first party is always the extension's security origin). |
| 289 EXPECT_TRUE(cookie_settings_->IsSettingCookieAllowed( | 289 EXPECT_TRUE(cookie_settings_->IsSettingCookieAllowed( |
| 290 kBlockedSite, kExtensionURL)); | 290 kBlockedSite, kExtensionURL)); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace | 293 } // namespace |
| OLD | NEW |