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

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

Issue 1442083002: Stop inheriting push notification permissions from regular to incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review nits Created 5 years 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_pref_provider_unittest.cc
diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
index c5a75b7f9b7c07c670311d3c8d80f9eba74810d7..98e861aa753c8c06d748b999bbbd66a7ff06e8c3 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
@@ -180,20 +180,14 @@ TEST_F(PrefProviderTest, Incognito) {
GURL host("http://example.com/");
// The value should of course be visible in the regular PrefProvider.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
- GetContentSetting(&pref_content_settings_provider,
- host,
- host,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host,
+ host, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
// And also in the OTR version.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
- GetContentSetting(&pref_content_settings_provider_incognito,
- host,
- host,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(
+ &pref_content_settings_provider_incognito, host, host,
+ CONTENT_SETTINGS_TYPE_IMAGES, std::string(), false));
const WebsiteSettingsInfo* info =
WebsiteSettingsRegistry::GetInstance()->Get(CONTENT_SETTINGS_TYPE_IMAGES);
// But the value should not be overridden in the OTR user prefs accidentally.
@@ -212,20 +206,13 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
ContentSettingsPattern::FromString("[*.]example.com");
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
-
- EXPECT_EQ(NULL,
- GetContentSettingValue(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
+
+ EXPECT_EQ(NULL, TestUtils::GetContentSettingValue(
+ &provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, std::string(), false));
provider.SetWebsiteSetting(primary_pattern,
primary_pattern,
@@ -233,19 +220,12 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
std::string(),
new base::FundamentalValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
- scoped_ptr<base::Value> value_ptr(
- GetContentSettingValue(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
+ scoped_ptr<base::Value> value_ptr(TestUtils::GetContentSettingValue(
+ &provider, primary_url, primary_url, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
int int_value = -1;
value_ptr->GetAsInteger(&int_value);
EXPECT_EQ(CONTENT_SETTING_BLOCK, IntToContentSetting(int_value));
@@ -255,13 +235,9 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
CONTENT_SETTINGS_TYPE_IMAGES,
std::string(),
NULL);
- EXPECT_EQ(NULL,
- GetContentSettingValue(&provider,
- primary_url,
- primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ EXPECT_EQ(NULL, TestUtils::GetContentSettingValue(
+ &provider, primary_url, primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES, std::string(), false));
provider.ShutdownOnUIThread();
}
@@ -282,12 +258,9 @@ TEST_F(PrefProviderTest, Patterns) {
ContentSettingsPattern::FromString("file:///tmp/test.html");
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&pref_content_settings_provider,
- host1,
- host1,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host1,
+ host1, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
pref_content_settings_provider.SetWebsiteSetting(
pattern1,
pattern1,
@@ -295,27 +268,18 @@ TEST_F(PrefProviderTest, Patterns) {
std::string(),
new base::FundamentalValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&pref_content_settings_provider,
- host1,
- host1,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host1,
+ host1, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&pref_content_settings_provider,
- host2,
- host2,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host2,
+ host2, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&pref_content_settings_provider,
- host3,
- host3,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host3,
+ host3, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
pref_content_settings_provider.SetWebsiteSetting(
pattern2,
pattern2,
@@ -323,20 +287,14 @@ TEST_F(PrefProviderTest, Patterns) {
std::string(),
new base::FundamentalValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&pref_content_settings_provider,
- host3,
- host3,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host3,
+ host3, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&pref_content_settings_provider,
- host4,
- host4,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host4,
+ host4, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
pref_content_settings_provider.SetWebsiteSetting(
pattern3,
pattern3,
@@ -344,12 +302,9 @@ TEST_F(PrefProviderTest, Patterns) {
std::string(),
new base::FundamentalValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&pref_content_settings_provider,
- host4,
- host4,
- CONTENT_SETTINGS_TYPE_IMAGES,
- std::string(),
- false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host4,
+ host4, CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(), false));
pref_content_settings_provider.ShutdownOnUIThread();
}
@@ -366,10 +321,9 @@ TEST_F(PrefProviderTest, ResourceIdentifier) {
std::string resource2("otherplugin");
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(
- &pref_content_settings_provider,
- host, host, CONTENT_SETTINGS_TYPE_PLUGINS,
- resource1, false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host,
+ host, CONTENT_SETTINGS_TYPE_PLUGINS,
+ resource1, false));
pref_content_settings_provider.SetWebsiteSetting(
pattern,
pattern,
@@ -377,15 +331,13 @@ TEST_F(PrefProviderTest, ResourceIdentifier) {
resource1,
new base::FundamentalValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(
- &pref_content_settings_provider,
- host, host, CONTENT_SETTINGS_TYPE_PLUGINS,
- resource1, false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host,
+ host, CONTENT_SETTINGS_TYPE_PLUGINS,
+ resource1, false));
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(
- &pref_content_settings_provider,
- host, host, CONTENT_SETTINGS_TYPE_PLUGINS,
- resource2, false));
+ TestUtils::GetContentSetting(&pref_content_settings_provider, host,
+ host, CONTENT_SETTINGS_TYPE_PLUGINS,
+ resource2, false));
pref_content_settings_provider.ShutdownOnUIThread();
}

Powered by Google App Engine
This is Rietveld 408576698