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

Unified Diff: chrome/browser/content_settings/content_settings_policy_provider_unittest.cc

Issue 7831004: Add a method to the content_settings::ProviderInterface to return the content settings Value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Created 9 years, 4 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: chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
diff --git a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
index 71807276d6b13ac2e2dbcf631257ba3e0a8ad374..89ecacde2ee46f46b7d2108390167a66f9455fbe 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
@@ -155,7 +155,7 @@ class PolicyProviderTest : public testing::Test {
BrowserThread ui_thread_;
};
-TEST_F(PolicyProviderTest, Default) {
+TEST_F(PolicyProviderTest, GettingManagedContentSettings) {
TestingProfile profile;
TestingPrefService* prefs = profile.GetTestingPrefService();
@@ -174,10 +174,22 @@ TEST_F(PolicyProviderTest, Default) {
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
provider.GetContentSetting(
youtube_url, youtube_url, CONTENT_SETTINGS_TYPE_COOKIES, ""));
+ EXPECT_EQ(NULL,
+ provider.GetContentSettingValue(
+ youtube_url, youtube_url, CONTENT_SETTINGS_TYPE_COOKIES, ""));
+
EXPECT_EQ(CONTENT_SETTING_BLOCK,
provider.GetContentSetting(
google_url, google_url, CONTENT_SETTINGS_TYPE_IMAGES, ""));
+ scoped_ptr<Value> value_ptr(provider.GetContentSettingValue(
+ google_url, google_url, CONTENT_SETTINGS_TYPE_IMAGES, ""));
+ int int_value = -1;
+ value_ptr->GetAsInteger(&int_value);
+ EXPECT_EQ(CONTENT_SETTING_BLOCK, IntToContentSetting(int_value));
+ // The PolicyProvider does not allow setting content settings as they are
+ // enforced via policies and not set by the user or extension. So a call to
+ // SetContentSetting does nothing.
provider.SetContentSetting(
yt_url_pattern,
yt_url_pattern,

Powered by Google App Engine
This is Rietveld 408576698