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 "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "chrome/browser/content_settings/content_settings_details.h" | 9 #include "chrome/browser/content_settings/content_settings_details.h" |
10 #include "chrome/browser/content_settings/cookie_settings.h" | 10 #include "chrome/browser/content_settings/cookie_settings.h" |
11 #include "chrome/browser/content_settings/host_content_settings_map.h" | 11 #include "chrome/browser/content_settings/host_content_settings_map.h" |
12 #include "chrome/browser/content_settings/mock_settings_observer.h" | 12 #include "chrome/browser/content_settings/mock_settings_observer.h" |
13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
14 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 14 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
18 #include "chrome/test/base/testing_pref_service.h" | 18 #include "chrome/test/base/testing_pref_service.h" |
19 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
20 #include "content/test/test_browser_thread.h" | 20 #include "content/test/test_browser_thread.h" |
21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
22 #include "net/base/static_cookie_policy.h" | 22 #include "net/base/static_cookie_policy.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 | 24 |
| 25 using content::BrowserThread; |
| 26 |
25 using ::testing::_; | 27 using ::testing::_; |
26 | 28 |
27 namespace { | 29 namespace { |
28 | 30 |
29 bool SettingsEqual(const ContentSettings& settings1, | 31 bool SettingsEqual(const ContentSettings& settings1, |
30 const ContentSettings& settings2) { | 32 const ContentSettings& settings2) { |
31 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 33 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
32 if (settings1.settings[i] != settings2.settings[i]) { | 34 if (settings1.settings[i] != settings2.settings[i]) { |
33 LOG(ERROR) << "type: " << i | 35 LOG(ERROR) << "type: " << i |
34 << " [expected: " << settings1.settings[i] | 36 << " [expected: " << settings1.settings[i] |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK); | 1058 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK); |
1057 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 1059 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
1058 host_content_settings_map->GetDefaultContentSetting( | 1060 host_content_settings_map->GetDefaultContentSetting( |
1059 CONTENT_SETTINGS_TYPE_PLUGINS, NULL)); | 1061 CONTENT_SETTINGS_TYPE_PLUGINS, NULL)); |
1060 | 1062 |
1061 prefs->RemoveManagedPref(prefs::kManagedDefaultPluginsSetting); | 1063 prefs->RemoveManagedPref(prefs::kManagedDefaultPluginsSetting); |
1062 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 1064 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
1063 host_content_settings_map->GetDefaultContentSetting( | 1065 host_content_settings_map->GetDefaultContentSetting( |
1064 CONTENT_SETTINGS_TYPE_PLUGINS, NULL)); | 1066 CONTENT_SETTINGS_TYPE_PLUGINS, NULL)); |
1065 } | 1067 } |
OLD | NEW |