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

Unified Diff: components/prefs/json_pref_store_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/default_pref_store_unittest.cc ('k') | components/prefs/pref_change_registrar_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/prefs/json_pref_store_unittest.cc
diff --git a/components/prefs/json_pref_store_unittest.cc b/components/prefs/json_pref_store_unittest.cc
index f404d2a03980ab8f76720688ecceecced638e28e..0164ad65880df13c5f5386334213ead478ee043c 100644
--- a/components/prefs/json_pref_store_unittest.cc
+++ b/components/prefs/json_pref_store_unittest.cc
@@ -229,7 +229,7 @@ void RunBasicJsonPrefStoreTest(JsonPrefStore* pref_store,
base::FilePath some_path(FILE_PATH_LITERAL("/usr/sbin/"));
pref_store->SetValue(kSomeDirectory,
- base::MakeUnique<StringValue>(some_path.value()),
+ base::MakeUnique<Value>(some_path.value()),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
EXPECT_TRUE(pref_store->GetValue(kSomeDirectory, &actual));
EXPECT_TRUE(actual->GetAsString(&path));
@@ -257,9 +257,10 @@ void RunBasicJsonPrefStoreTest(JsonPrefStore* pref_store,
EXPECT_TRUE(actual->GetAsInteger(&integer));
EXPECT_EQ(10, integer);
- pref_store->SetValue(kLongIntPref, base::MakeUnique<StringValue>(
- base::Int64ToString(214748364842LL)),
- WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
+ pref_store->SetValue(
+ kLongIntPref,
+ base::MakeUnique<Value>(base::Int64ToString(214748364842LL)),
+ WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
EXPECT_TRUE(pref_store->GetValue(kLongIntPref, &actual));
EXPECT_TRUE(actual->GetAsString(&string_value));
int64_t value;
@@ -872,7 +873,7 @@ TEST_F(JsonPrefStoreLossyWriteTest, LossyWriteBasic) {
// Set a normal pref and check that it gets scheduled to be written.
ASSERT_FALSE(file_writer->HasPendingWrite());
- pref_store->SetValue("normal", base::MakeUnique<base::StringValue>("normal"),
+ pref_store->SetValue("normal", base::MakeUnique<base::Value>("normal"),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
ASSERT_TRUE(file_writer->HasPendingWrite());
file_writer->DoScheduledWrite();
@@ -881,15 +882,14 @@ TEST_F(JsonPrefStoreLossyWriteTest, LossyWriteBasic) {
// Set a lossy pref and check that it is not scheduled to be written.
// SetValue/RemoveValue.
- pref_store->SetValue("lossy", base::MakeUnique<base::StringValue>("lossy"),
+ pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
ASSERT_FALSE(file_writer->HasPendingWrite());
pref_store->RemoveValue("lossy", WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
ASSERT_FALSE(file_writer->HasPendingWrite());
// SetValueSilently/RemoveValueSilently.
- pref_store->SetValueSilently("lossy",
- base::MakeUnique<base::StringValue>("lossy"),
+ pref_store->SetValueSilently("lossy", base::MakeUnique<base::Value>("lossy"),
WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
ASSERT_FALSE(file_writer->HasPendingWrite());
pref_store->RemoveValueSilently("lossy",
@@ -897,7 +897,7 @@ TEST_F(JsonPrefStoreLossyWriteTest, LossyWriteBasic) {
ASSERT_FALSE(file_writer->HasPendingWrite());
// ReportValueChanged.
- pref_store->SetValue("lossy", base::MakeUnique<base::StringValue>("lossy"),
+ pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
ASSERT_FALSE(file_writer->HasPendingWrite());
pref_store->ReportValueChanged("lossy",
@@ -918,12 +918,12 @@ TEST_F(JsonPrefStoreLossyWriteTest, LossyWriteMixedLossyFirst) {
// Set a lossy pref and check that it is not scheduled to be written.
ASSERT_FALSE(file_writer->HasPendingWrite());
- pref_store->SetValue("lossy", base::MakeUnique<base::StringValue>("lossy"),
+ pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
ASSERT_FALSE(file_writer->HasPendingWrite());
// Set a normal pref and check that it is scheduled to be written.
- pref_store->SetValue("normal", base::MakeUnique<base::StringValue>("normal"),
+ pref_store->SetValue("normal", base::MakeUnique<base::Value>("normal"),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
ASSERT_TRUE(file_writer->HasPendingWrite());
@@ -940,12 +940,12 @@ TEST_F(JsonPrefStoreLossyWriteTest, LossyWriteMixedLossySecond) {
// Set a normal pref and check that it is scheduled to be written.
ASSERT_FALSE(file_writer->HasPendingWrite());
- pref_store->SetValue("normal", base::MakeUnique<base::StringValue>("normal"),
+ pref_store->SetValue("normal", base::MakeUnique<base::Value>("normal"),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
ASSERT_TRUE(file_writer->HasPendingWrite());
// Set a lossy pref and check that the write is still scheduled.
- pref_store->SetValue("lossy", base::MakeUnique<base::StringValue>("lossy"),
+ pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
ASSERT_TRUE(file_writer->HasPendingWrite());
@@ -961,7 +961,7 @@ TEST_F(JsonPrefStoreLossyWriteTest, ScheduleLossyWrite) {
ImportantFileWriter* file_writer = GetImportantFileWriter(pref_store.get());
// Set a lossy pref and check that it is not scheduled to be written.
- pref_store->SetValue("lossy", base::MakeUnique<base::StringValue>("lossy"),
+ pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
ASSERT_FALSE(file_writer->HasPendingWrite());
@@ -1125,7 +1125,7 @@ TEST_F(JsonPrefStoreCallbackTest, TestSerializeDataCallbacks) {
EXPECT_EQ(NOT_CALLED,
write_callback_observer_.GetAndResetPostWriteObservationState());
- pref_store->SetValue("normal", base::MakeUnique<base::StringValue>("normal"),
+ pref_store->SetValue("normal", base::MakeUnique<base::Value>("normal"),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
file_writer->DoScheduledWrite();
« no previous file with comments | « components/prefs/default_pref_store_unittest.cc ('k') | components/prefs/pref_change_registrar_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698