| 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/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/content_settings/cookie_settings.h" | 8 #include "chrome/browser/content_settings/cookie_settings.h" |
| 9 #include "chrome/common/content_settings_pattern.h" | |
| 10 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 11 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| 11 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 12 #include "content/public/test/test_browser_thread.h" | 12 #include "content/public/test/test_browser_thread.h" |
| 13 #include "net/base/static_cookie_policy.h" | 13 #include "net/base/static_cookie_policy.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 using content::BrowserThread; | 17 using content::BrowserThread; |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 class CookieSettingsTest : public testing::Test { | 21 class CookieSettingsTest : public testing::Test { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 TEST_F(CookieSettingsTest, ExtensionsThirdParty) { | 274 TEST_F(CookieSettingsTest, ExtensionsThirdParty) { |
| 275 profile_.GetPrefs()->SetBoolean(prefs::kBlockThirdPartyCookies, true); | 275 profile_.GetPrefs()->SetBoolean(prefs::kBlockThirdPartyCookies, true); |
| 276 | 276 |
| 277 // XHRs stemming from extensions are exempt from third-party cookie blocking | 277 // XHRs stemming from extensions are exempt from third-party cookie blocking |
| 278 // rules (as the first party is always the extension's security origin). | 278 // rules (as the first party is always the extension's security origin). |
| 279 EXPECT_TRUE(cookie_settings_->IsSettingCookieAllowed( | 279 EXPECT_TRUE(cookie_settings_->IsSettingCookieAllowed( |
| 280 kBlockedSite, kExtensionURL)); | 280 kBlockedSite, kExtensionURL)); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace | 283 } // namespace |
| OLD | NEW |