Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5110)

Unified Diff: chrome/browser/profile_resetter/profile_resetter_unittest.cc

Issue 1318083005: Remove HostContentSettingsMap::ContentTypeHasCompoundValue function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-num-types-enum-3
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/content_settings/core/browser/content_settings_pref.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile_resetter/profile_resetter_unittest.cc
diff --git a/chrome/browser/profile_resetter/profile_resetter_unittest.cc b/chrome/browser/profile_resetter/profile_resetter_unittest.cc
index 3ad6bba27948f6887558f1767bb452e13735b46e..1d7f32f373fbcabdfa9004e7f2eea1feb2f6a177 100644
--- a/chrome/browser/profile_resetter/profile_resetter_unittest.cc
+++ b/chrome/browser/profile_resetter/profile_resetter_unittest.cc
@@ -25,9 +25,10 @@
#include "chrome/browser/web_data_service_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/browser_with_test_window_test.h"
+#include "components/content_settings/core/browser/content_settings_info.h"
+#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/browser/website_settings_info.h"
-#include "components/content_settings/core/browser/website_settings_registry.h"
#include "components/search_engines/template_url_service.h"
#include "components/search_engines/template_url_service_client.h"
#include "content/public/browser/web_contents.h"
@@ -491,12 +492,11 @@ TEST_F(ProfileResetterTest, ResetContentSettings) {
// TODO(raymes): Clean up this test so that we don't have such ugly iteration
// over the content settings.
- content_settings::WebsiteSettingsRegistry* registry =
- content_settings::WebsiteSettingsRegistry::GetInstance();
- for (const content_settings::WebsiteSettingsInfo* info : *registry) {
- ContentSettingsType content_type = info->type();
- if (content_type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE ||
- content_type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT ||
+ content_settings::ContentSettingsRegistry* registry =
+ content_settings::ContentSettingsRegistry::GetInstance();
+ for (const content_settings::ContentSettingsInfo* info : *registry) {
engedy 2015/09/29 12:26:18 This changes behavior locally for three (non-conte
msramek 2015/09/29 12:48:53 I agree with your assessment. Filed crbug.com/5371
raymes 2015/09/30 00:42:46 I agree with you too. Hopefully these changes are
+ ContentSettingsType content_type = info->website_settings_info()->type();
+ if (content_type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT ||
content_type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) {
// These types are excluded because one can't call
// GetDefaultContentSetting() for them.
@@ -520,8 +520,7 @@ TEST_F(ProfileResetterTest, ResetContentSettings) {
host_content_settings_map->SetDefaultContentSetting(content_type,
wildcard_setting);
}
- if (!HostContentSettingsMap::ContentTypeHasCompoundValue(content_type) &&
- HostContentSettingsMap::IsSettingAllowedForType(
+ if (HostContentSettingsMap::IsSettingAllowedForType(
profile()->GetPrefs(), site_setting, content_type)) {
host_content_settings_map->SetContentSetting(
pattern, ContentSettingsPattern::Wildcard(), content_type,
@@ -535,11 +534,9 @@ TEST_F(ProfileResetterTest, ResetContentSettings) {
ResetAndWait(ProfileResetter::CONTENT_SETTINGS);
- for (const content_settings::WebsiteSettingsInfo* info : *registry) {
- ContentSettingsType content_type = info->type();
- if (HostContentSettingsMap::ContentTypeHasCompoundValue(content_type) ||
- content_type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE ||
- content_type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT ||
+ for (const content_settings::ContentSettingsInfo* info : *registry) {
+ ContentSettingsType content_type = info->website_settings_info()->type();
+ if (content_type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT ||
content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM ||
content_type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS)
continue;
@@ -548,15 +545,9 @@ TEST_F(ProfileResetterTest, ResetContentSettings) {
NULL);
EXPECT_TRUE(default_settings.count(content_type));
EXPECT_EQ(default_settings[content_type], default_setting);
- if (!HostContentSettingsMap::ContentTypeHasCompoundValue(content_type)) {
- ContentSetting site_setting =
- host_content_settings_map->GetContentSetting(
- GURL("example.org"),
- GURL(),
- content_type,
- std::string());
- EXPECT_EQ(default_setting, site_setting);
- }
+ ContentSetting site_setting = host_content_settings_map->GetContentSetting(
+ GURL("example.org"), GURL(), content_type, std::string());
+ EXPECT_EQ(default_setting, site_setting);
ContentSettingsForOneType host_settings;
host_content_settings_map->GetSettingsForOneType(
« no previous file with comments | « no previous file | components/content_settings/core/browser/content_settings_pref.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698