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

Unified Diff: components/prefs/pref_value_map_unittest.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « components/prefs/pref_value_map.cc ('k') | components/prefs/testing_pref_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/prefs/pref_value_map_unittest.cc
diff --git a/components/prefs/pref_value_map_unittest.cc b/components/prefs/pref_value_map_unittest.cc
index f6912da88168a78708388b28f20f10e591a12cba..0ad8cd1ef70f1c97d0f15ce85c8bee3801b1d5c3 100644
--- a/components/prefs/pref_value_map_unittest.cc
+++ b/components/prefs/pref_value_map_unittest.cc
@@ -17,12 +17,12 @@ TEST(PrefValueMapTest, SetValue) {
EXPECT_FALSE(map.GetValue("key", &result));
EXPECT_FALSE(result);
- EXPECT_TRUE(map.SetValue("key", base::MakeUnique<StringValue>("test")));
- EXPECT_FALSE(map.SetValue("key", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(map.SetValue("key", base::MakeUnique<StringValue>("hi mom!")));
+ EXPECT_TRUE(map.SetValue("key", base::MakeUnique<Value>("test")));
+ EXPECT_FALSE(map.SetValue("key", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(map.SetValue("key", base::MakeUnique<Value>("hi mom!")));
EXPECT_TRUE(map.GetValue("key", &result));
- EXPECT_TRUE(StringValue("hi mom!").Equals(result));
+ EXPECT_TRUE(Value("hi mom!").Equals(result));
}
TEST(PrefValueMapTest, GetAndSetIntegerValue) {
@@ -53,7 +53,7 @@ TEST(PrefValueMapTest, RemoveValue) {
PrefValueMap map;
EXPECT_FALSE(map.RemoveValue("key"));
- EXPECT_TRUE(map.SetValue("key", base::MakeUnique<StringValue>("test")));
+ EXPECT_TRUE(map.SetValue("key", base::MakeUnique<Value>("test")));
EXPECT_TRUE(map.GetValue("key", NULL));
EXPECT_TRUE(map.RemoveValue("key"));
@@ -64,7 +64,7 @@ TEST(PrefValueMapTest, RemoveValue) {
TEST(PrefValueMapTest, Clear) {
PrefValueMap map;
- EXPECT_TRUE(map.SetValue("key", base::MakeUnique<StringValue>("test")));
+ EXPECT_TRUE(map.SetValue("key", base::MakeUnique<Value>("test")));
EXPECT_TRUE(map.GetValue("key", NULL));
map.Clear();
@@ -74,9 +74,9 @@ TEST(PrefValueMapTest, Clear) {
TEST(PrefValueMapTest, GetDifferingKeys) {
PrefValueMap reference;
- EXPECT_TRUE(reference.SetValue("b", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(reference.SetValue("c", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(reference.SetValue("e", base::MakeUnique<StringValue>("test")));
+ EXPECT_TRUE(reference.SetValue("b", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(reference.SetValue("c", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(reference.SetValue("e", base::MakeUnique<Value>("test")));
PrefValueMap check;
std::vector<std::string> differing_paths;
@@ -88,9 +88,9 @@ TEST(PrefValueMapTest, GetDifferingKeys) {
expected_differing_paths.push_back("e");
EXPECT_EQ(expected_differing_paths, differing_paths);
- EXPECT_TRUE(check.SetValue("a", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(check.SetValue("c", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(check.SetValue("d", base::MakeUnique<StringValue>("test")));
+ EXPECT_TRUE(check.SetValue("a", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(check.SetValue("c", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(check.SetValue("d", base::MakeUnique<Value>("test")));
reference.GetDifferingKeys(&check, &differing_paths);
expected_differing_paths.clear();
@@ -103,14 +103,14 @@ TEST(PrefValueMapTest, GetDifferingKeys) {
TEST(PrefValueMapTest, SwapTwoMaps) {
PrefValueMap first_map;
- EXPECT_TRUE(first_map.SetValue("a", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(first_map.SetValue("b", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(first_map.SetValue("c", base::MakeUnique<StringValue>("test")));
+ EXPECT_TRUE(first_map.SetValue("a", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(first_map.SetValue("b", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(first_map.SetValue("c", base::MakeUnique<Value>("test")));
PrefValueMap second_map;
- EXPECT_TRUE(second_map.SetValue("d", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(second_map.SetValue("e", base::MakeUnique<StringValue>("test")));
- EXPECT_TRUE(second_map.SetValue("f", base::MakeUnique<StringValue>("test")));
+ EXPECT_TRUE(second_map.SetValue("d", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(second_map.SetValue("e", base::MakeUnique<Value>("test")));
+ EXPECT_TRUE(second_map.SetValue("f", base::MakeUnique<Value>("test")));
first_map.Swap(&second_map);
« no previous file with comments | « components/prefs/pref_value_map.cc ('k') | components/prefs/testing_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698