OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/content_settings/cookie_settings.h" | 7 #include "chrome/browser/content_settings/cookie_settings.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/common/content_settings_pattern.h" | 10 #include "chrome/common/content_settings_pattern.h" |
11 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
12 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
13 #include "content/test/test_browser_thread.h" | 13 #include "content/test/test_browser_thread.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "net/base/static_cookie_policy.h" | 15 #include "net/base/static_cookie_policy.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
| 18 using content::BrowserThread; |
| 19 |
18 namespace { | 20 namespace { |
19 | 21 |
20 class CookieSettingsTest : public testing::Test { | 22 class CookieSettingsTest : public testing::Test { |
21 public: | 23 public: |
22 CookieSettingsTest() : | 24 CookieSettingsTest() : |
23 ui_thread_(BrowserThread::UI, &message_loop_), | 25 ui_thread_(BrowserThread::UI, &message_loop_), |
24 kBlockedSite("http://ads.thirdparty.com"), | 26 kBlockedSite("http://ads.thirdparty.com"), |
25 kAllowedSite("http://good.allays.com"), | 27 kAllowedSite("http://good.allays.com"), |
26 kFirstPartySite("http://cool.things.com"), | 28 kFirstPartySite("http://cool.things.com"), |
27 kBlockedFirstPartySite("http://no.thirdparties.com"), | 29 kBlockedFirstPartySite("http://no.thirdparties.com"), |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 ContentSettingsPattern::FromURL(kAllowedSite), | 227 ContentSettingsPattern::FromURL(kAllowedSite), |
226 ContentSettingsPattern::FromURL(kFirstPartySite)); | 228 ContentSettingsPattern::FromURL(kFirstPartySite)); |
227 | 229 |
228 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed( | 230 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed( |
229 kAllowedSite, kFirstPartySite)); | 231 kAllowedSite, kFirstPartySite)); |
230 EXPECT_FALSE(cookie_settings->IsSettingCookieAllowed( | 232 EXPECT_FALSE(cookie_settings->IsSettingCookieAllowed( |
231 kAllowedSite, kFirstPartySite)); | 233 kAllowedSite, kFirstPartySite)); |
232 } | 234 } |
233 | 235 |
234 } // namespace | 236 } // namespace |
OLD | NEW |