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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 10 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_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 da06595ea4811b3f43f7c52c0d6c88ec69725b38..d6d43b25d7d36e8949f775b5c9f499a5dafec38e 100644
--- a/chrome/browser/content_settings/content_settings_default_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_default_provider_unittest.cc
@@ -43,12 +43,10 @@ TEST_F(DefaultProviderTest, DefaultValues) {
TestUtils::GetContentSetting(&provider_, GURL(), GURL(),
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(), false));
- provider_.SetWebsiteSetting(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- new base::FundamentalValue(CONTENT_SETTING_BLOCK));
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_COOKIES, std::string(),
+ new base::Value(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
TestUtils::GetContentSetting(&provider_, GURL(), GURL(),
CONTENT_SETTINGS_TYPE_COOKIES,
@@ -58,12 +56,10 @@ TEST_F(DefaultProviderTest, DefaultValues) {
TestUtils::GetContentSetting(&provider_, GURL(), GURL(),
CONTENT_SETTINGS_TYPE_GEOLOCATION,
std::string(), false));
- provider_.SetWebsiteSetting(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- new base::FundamentalValue(CONTENT_SETTING_BLOCK));
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string(),
+ new base::Value(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
TestUtils::GetContentSetting(&provider_, GURL(), GURL(),
CONTENT_SETTINGS_TYPE_GEOLOCATION,
@@ -83,8 +79,7 @@ TEST_F(DefaultProviderTest, IgnoreNonDefaultSettings) {
TestUtils::GetContentSetting(&provider_, primary_url, secondary_url,
CONTENT_SETTINGS_TYPE_COOKIES,
std::string(), false));
- std::unique_ptr<base::Value> value(
- new base::FundamentalValue(CONTENT_SETTING_BLOCK));
+ std::unique_ptr<base::Value> value(new base::Value(CONTENT_SETTING_BLOCK));
bool owned = provider_.SetWebsiteSetting(
ContentSettingsPattern::FromURL(primary_url),
ContentSettingsPattern::FromURL(secondary_url),
@@ -104,34 +99,28 @@ TEST_F(DefaultProviderTest, Observer) {
OnContentSettingChanged(
_, _, CONTENT_SETTINGS_TYPE_COOKIES, ""));
provider_.AddObserver(&mock_observer);
- provider_.SetWebsiteSetting(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- new base::FundamentalValue(CONTENT_SETTING_BLOCK));
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_COOKIES, std::string(),
+ new base::Value(CONTENT_SETTING_BLOCK));
EXPECT_CALL(mock_observer,
OnContentSettingChanged(
_, _, CONTENT_SETTINGS_TYPE_GEOLOCATION, ""));
- provider_.SetWebsiteSetting(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- new base::FundamentalValue(CONTENT_SETTING_BLOCK));
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string(),
+ new base::Value(CONTENT_SETTING_BLOCK));
}
TEST_F(DefaultProviderTest, ObservePref) {
PrefService* prefs = profile_.GetPrefs();
- provider_.SetWebsiteSetting(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- new base::FundamentalValue(CONTENT_SETTING_BLOCK));
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_COOKIES, std::string(),
+ new base::Value(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
TestUtils::GetContentSetting(&provider_, GURL(), GURL(),
CONTENT_SETTINGS_TYPE_COOKIES,
@@ -198,12 +187,10 @@ TEST_F(DefaultProviderTest, OffTheRecord) {
// Changing content settings on the main provider should also affect the
// incognito map.
- provider_.SetWebsiteSetting(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_COOKIES,
- std::string(),
- new base::FundamentalValue(CONTENT_SETTING_BLOCK));
+ provider_.SetWebsiteSetting(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_COOKIES, std::string(),
+ new base::Value(CONTENT_SETTING_BLOCK));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
TestUtils::GetContentSetting(
&provider_, GURL(), GURL(), CONTENT_SETTINGS_TYPE_COOKIES,
@@ -215,8 +202,7 @@ TEST_F(DefaultProviderTest, OffTheRecord) {
std::string(), true /* include_incognito */));
// Changing content settings on the incognito provider should be ignored.
- std::unique_ptr<base::Value> value(
- new base::FundamentalValue(CONTENT_SETTING_ALLOW));
+ std::unique_ptr<base::Value> value(new base::Value(CONTENT_SETTING_ALLOW));
bool owned = otr_provider.SetWebsiteSetting(
ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),

Powered by Google App Engine
This is Rietveld 408576698