Remove base::StringValue
As a follow-up to typedeffing base::StringValue to base::Value in
http://crrev.com/2516363005 this change replaces all references to
base::StringValue by base::Value.
[email protected]
BUG=646113
Review-Url: https://codereview.chromium.org/2664753002
Cr-Commit-Position: refs/heads/master@{#454848}
diff --git a/components/prefs/pref_service_unittest.cc b/components/prefs/pref_service_unittest.cc
index 8c97e5e..55d3ccc 100644
--- a/components/prefs/pref_service_unittest.cc
+++ b/components/prefs/pref_service_unittest.cc
@@ -38,7 +38,7 @@
registrar.Add(pref_name, obs.GetCallback());
// This should fire the checks in MockPrefChangeCallback::OnPreferenceChanged.
- const base::StringValue expected_value(new_pref_value);
+ const base::Value expected_value(new_pref_value);
obs.Expect(pref_name, &expected_value);
prefs.SetString(pref_name, new_pref_value);
Mock::VerifyAndClearExpectations(&obs);
@@ -50,7 +50,7 @@
Mock::VerifyAndClearExpectations(&obs);
// Clearing the pref should cause the pref to fire.
- const base::StringValue expected_default_value((std::string()));
+ const base::Value expected_default_value((std::string()));
obs.Expect(pref_name, &expected_default_value);
prefs.ClearPref(pref_name);
Mock::VerifyAndClearExpectations(&obs);
@@ -83,12 +83,11 @@
const char pref_name[] = "homepage";
TestingPrefServiceSimple prefs;
- prefs.SetUserPref(pref_name,
- new base::StringValue("http://www.cnn.com"));
+ prefs.SetUserPref(pref_name, new base::Value("http://www.cnn.com"));
prefs.registry()->RegisterStringPref(pref_name, std::string());
const char new_pref_value[] = "http://www.google.com/";
- const base::StringValue expected_new_pref_value(new_pref_value);
+ const base::Value expected_new_pref_value(new_pref_value);
MockPrefChangeCallback obs(&prefs);
PrefChangeRegistrar registrar;
registrar.Init(&prefs);
@@ -104,7 +103,7 @@
// Now try adding a second pref observer.
const char new_pref_value2[] = "http://www.youtube.com/";
- const base::StringValue expected_new_pref_value2(new_pref_value2);
+ const base::Value expected_new_pref_value2(new_pref_value2);
MockPrefChangeCallback obs2(&prefs);
obs.Expect(pref_name, &expected_new_pref_value2);
obs2.Expect(pref_name, &expected_new_pref_value2);
@@ -115,7 +114,7 @@
Mock::VerifyAndClearExpectations(&obs2);
// Set a recommended value.
- const base::StringValue recommended_pref_value("http://www.gmail.com/");
+ const base::Value recommended_pref_value("http://www.gmail.com/");
obs.Expect(pref_name, &expected_new_pref_value2);
obs2.Expect(pref_name, &expected_new_pref_value2);
// This should fire the checks in obs and obs2 but with an unchanged value
@@ -142,8 +141,7 @@
prefs.registry()->RegisterIntegerPref(kPrefName, kTestValue);
// Check falling back to a recommended value.
- prefs.SetUserPref(kPrefName,
- new base::StringValue("not an integer"));
+ prefs.SetUserPref(kPrefName, new base::Value("not an integer"));
const PrefService::Preference* pref = prefs.FindPreference(kPrefName);
ASSERT_TRUE(pref);
const base::Value* value = pref->GetValue();
@@ -354,7 +352,7 @@
TEST_F(PrefServiceSetValueTest, SetStringValue) {
const char default_string[] = "default";
- const base::StringValue default_value(default_string);
+ const base::Value default_value(default_string);
prefs_.registry()->RegisterStringPref(kName, default_string);
PrefChangeRegistrar registrar;
@@ -370,7 +368,7 @@
prefs_.Set(kName, default_value);
Mock::VerifyAndClearExpectations(&observer_);
- base::StringValue new_value(kValue);
+ base::Value new_value(kValue);
observer_.Expect(kName, &new_value);
prefs_.Set(kName, new_value);
Mock::VerifyAndClearExpectations(&observer_);