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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 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: 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 f9518294b07646f32852c5a7c74b220501d1d07d..1ddc6d092632e48228eed233b0ba28d38660768f 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
@@ -121,7 +121,7 @@ TEST_F(PrefProviderTest, Observer) {
pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_IMAGES,
- "",
+ std::string(),
Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
pref_content_settings_provider.ShutdownOnUIThread();
@@ -166,20 +166,26 @@ TEST_F(PrefProviderTest, Incognito) {
pattern,
pattern,
CONTENT_SETTINGS_TYPE_IMAGES,
- "",
+ std::string(),
Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
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, "", false));
+ 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, "", false));
+ GetContentSetting(&pref_content_settings_provider_incognito,
+ host,
+ host,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
+ false));
// But the value should not be overridden in the OTR user prefs accidentally.
EXPECT_FALSE(otr_user_prefs->IsSetInOverlay(
prefs::kContentSettingsPatternPairs));
@@ -197,26 +203,40 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
ContentSettingsPattern::FromString("[*.]example.com");
EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- GetContentSetting(&provider, primary_url, primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES, "", false));
+ 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, "", false));
+ GetContentSettingValue(&provider,
+ primary_url,
+ primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
+ false));
- provider.SetWebsiteSetting(
- primary_pattern,
- primary_pattern,
- CONTENT_SETTINGS_TYPE_IMAGES,
- "",
- Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
+ provider.SetWebsiteSetting(primary_pattern,
+ primary_pattern,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
+ Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(&provider, primary_url, primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES, "", false));
+ GetContentSetting(&provider,
+ primary_url,
+ primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
+ false));
scoped_ptr<Value> value_ptr(
- GetContentSettingValue(&provider, primary_url, primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES, "", false));
+ 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));
@@ -224,12 +244,15 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
provider.SetWebsiteSetting(primary_pattern,
primary_pattern,
CONTENT_SETTINGS_TYPE_IMAGES,
- "",
+ std::string(),
NULL);
EXPECT_EQ(NULL,
- GetContentSettingValue(
- &provider, primary_url, primary_url,
- CONTENT_SETTINGS_TYPE_IMAGES, "", false));
+ GetContentSettingValue(&provider,
+ primary_url,
+ primary_url,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
+ false));
provider.ShutdownOnUIThread();
}
@@ -250,53 +273,74 @@ 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, "", false));
+ GetContentSetting(&pref_content_settings_provider,
+ host1,
+ host1,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
+ false));
pref_content_settings_provider.SetWebsiteSetting(
pattern1,
pattern1,
CONTENT_SETTINGS_TYPE_IMAGES,
- "",
+ std::string(),
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(
- &pref_content_settings_provider,
- host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
+ 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, "", false));
+ 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, "", false));
+ GetContentSetting(&pref_content_settings_provider,
+ host3,
+ host3,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
+ false));
pref_content_settings_provider.SetWebsiteSetting(
pattern2,
pattern2,
CONTENT_SETTINGS_TYPE_IMAGES,
- "",
+ std::string(),
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(
- &pref_content_settings_provider,
- host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
+ 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, "",
+ host4,
+ host4,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
false));
pref_content_settings_provider.SetWebsiteSetting(
pattern3,
pattern3,
CONTENT_SETTINGS_TYPE_IMAGES,
- "",
+ std::string(),
Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
- GetContentSetting(
- &pref_content_settings_provider,
- host4, host4, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
+ GetContentSetting(&pref_content_settings_provider,
+ host4,
+ host4,
+ CONTENT_SETTINGS_TYPE_IMAGES,
+ std::string(),
+ false));
pref_content_settings_provider.ShutdownOnUIThread();
}

Powered by Google App Engine
This is Rietveld 408576698