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

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

Issue 8539004: Replace SetContentSetting method of the content_settings::Provider interface with GetWebsiteSetting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 1 month 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_default_provider_unittest.cc
diff --git a/chrome/browser/content_settings/content_settings_default_provider_unittest.cc b/chrome/browser/content_settings/content_settings_default_provider_unittest.cc
index 21f0ff7d75a566b893092ade42fb9ecda1cc9ca5..3b31451aa9b190da86d39a800a42b99ffbcff899 100644
--- a/chrome/browser/content_settings/content_settings_default_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_default_provider_unittest.cc
@@ -22,6 +22,8 @@ class DefaultProviderTest : public testing::Test {
DefaultProviderTest()
: ui_thread_(BrowserThread::UI, &message_loop_),
provider_(profile_.GetPrefs(), false) {
+ value_allow.reset(Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
+ value_block.reset(Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
}
~DefaultProviderTest() {
provider_.ShutdownOnUIThread();
@@ -32,6 +34,8 @@ class DefaultProviderTest : public testing::Test {
content::TestBrowserThread ui_thread_;
TestingProfile profile_;
content_settings::DefaultProvider provider_;
+ scoped_ptr<base::Value> value_allow;
Bernhard Bauer 2011/11/11 14:00:40 Class member names should end with an underscore.
markusheintz_ 2011/11/14 11:15:10 Yeah so true :( . But I don't need this any more.
+ scoped_ptr<base::Value> value_block;
};
TEST_F(DefaultProviderTest, DefaultValues) {
@@ -43,11 +47,11 @@ TEST_F(DefaultProviderTest, DefaultValues) {
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(),
false));
- provider_.SetContentSetting(ContentSettingsPattern::Wildcard(),
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(),
- CONTENT_SETTING_BLOCK);
+ value_block.get());
EXPECT_EQ(CONTENT_SETTING_BLOCK,
GetContentSetting(&provider_,
GURL(),
@@ -63,11 +67,11 @@ TEST_F(DefaultProviderTest, DefaultValues) {
CONTENT_SETTINGS_TYPE_GEOLOCATION,
std::string(),
false));
- provider_.SetContentSetting(ContentSettingsPattern::Wildcard(),
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_GEOLOCATION,
std::string(),
- CONTENT_SETTING_BLOCK);
+ value_block.get());
EXPECT_EQ(CONTENT_SETTING_BLOCK,
GetContentSetting(&provider_,
GURL(),
@@ -88,11 +92,11 @@ TEST_F(DefaultProviderTest, IgnoreNonDefaultSettings) {
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(),
false));
- provider_.SetContentSetting(ContentSettingsPattern::FromURL(primary_url),
+ provider_.SetWebsiteSetting(ContentSettingsPattern::FromURL(primary_url),
ContentSettingsPattern::FromURL(secondary_url),
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(),
- CONTENT_SETTING_BLOCK);
+ value_block.get());
EXPECT_EQ(CONTENT_SETTING_ALLOW,
GetContentSetting(&provider_,
primary_url,
@@ -108,20 +112,20 @@ TEST_F(DefaultProviderTest, Observer) {
OnContentSettingChanged(
_, _, CONTENT_SETTINGS_TYPE_IMAGES, ""));
provider_.AddObserver(&mock_observer);
- provider_.SetContentSetting(ContentSettingsPattern::Wildcard(),
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_IMAGES,
std::string(),
- CONTENT_SETTING_BLOCK);
+ value_block.get());
EXPECT_CALL(mock_observer,
OnContentSettingChanged(
_, _, CONTENT_SETTINGS_TYPE_GEOLOCATION, ""));
- provider_.SetContentSetting(ContentSettingsPattern::Wildcard(),
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_GEOLOCATION,
std::string(),
- CONTENT_SETTING_BLOCK);
+ value_block.get());
}
@@ -132,11 +136,11 @@ TEST_F(DefaultProviderTest, ObserveDefaultPref) {
scoped_ptr<Value> default_value(prefs->FindPreference(
prefs::kDefaultContentSettings)->GetValue()->DeepCopy());
- provider_.SetContentSetting(ContentSettingsPattern::Wildcard(),
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(),
- CONTENT_SETTING_BLOCK);
+ value_block.get());
EXPECT_EQ(CONTENT_SETTING_BLOCK,
GetContentSetting(&provider_,
GURL(),
@@ -189,11 +193,11 @@ TEST_F(DefaultProviderTest, OffTheRecord) {
// Changing content settings on the main provider should also affect the
// incognito map.
- provider_.SetContentSetting(ContentSettingsPattern::Wildcard(),
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(),
- CONTENT_SETTING_BLOCK);
+ value_block.get());
EXPECT_EQ(CONTENT_SETTING_BLOCK,
GetContentSetting(&provider_,
GURL(),
@@ -211,11 +215,11 @@ TEST_F(DefaultProviderTest, OffTheRecord) {
true));
// Changing content settings on the incognito provider should be ignored.
- otr_provider.SetContentSetting(ContentSettingsPattern::Wildcard(),
+ otr_provider.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(),
- CONTENT_SETTING_ALLOW);
+ value_allow.get());
EXPECT_EQ(CONTENT_SETTING_BLOCK,
GetContentSetting(&provider_,
GURL(),

Powered by Google App Engine
This is Rietveld 408576698