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

Unified Diff: components/content_settings/core/test/content_settings_test_utils.cc

Issue 1865803002: [Policy Experimental] Add policies to allow Cookies and Pop-ups exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync; compile fix in PolicyProvider::GetUserExceptionsUsageSettingForType(). Created 4 years, 8 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
Index: components/content_settings/core/test/content_settings_test_utils.cc
diff --git a/components/content_settings/core/test/content_settings_test_utils.cc b/components/content_settings/core/test/content_settings_test_utils.cc
index 87207195f02851e5e1be9073e4bb820b42c65eb3..989663b2b5be8374d0cf37c3cae78f714bd0b116 100644
--- a/components/content_settings/core/test/content_settings_test_utils.cc
+++ b/components/content_settings/core/test/content_settings_test_utils.cc
@@ -4,7 +4,10 @@
#include "components/content_settings/core/test/content_settings_test_utils.h"
+#include "components/content_settings/core/browser/content_settings_policy_provider.h"
+#include "components/content_settings/core/browser/content_settings_pref_provider.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
+#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_types.h"
namespace content_settings {
@@ -48,4 +51,16 @@ scoped_ptr<base::Value> TestUtils::GetContentSettingValueAndPatterns(
secondary_pattern);
}
+// static
+bool TestUtils::AddPrefException(const std::string& pattern_string,
+ ContentSettingsType content_type,
+ ContentSetting setting,
+ HostContentSettingsMap* settings_map) {
+ ContentSettingsPattern pattern =
+ ContentSettingsPattern::FromString(pattern_string);
+ base::Value* value = new base::FundamentalValue(setting);
+ return settings_map->GetPrefProvider()->SetWebsiteSetting(
+ pattern, pattern, content_type, std::string(), value);
+}
+
} // namespace content_settings
« no previous file with comments | « components/content_settings/core/test/content_settings_test_utils.h ('k') | components/policy/resources/policy_templates.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698