summaryrefslogtreecommitdiffstats
path: root/extensions/browser/value_store
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 21:25:45 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 21:25:45 +0000
commit04be9805637fc59cf954c9c4f5ff0588a70d7479 (patch)
tree6f0166a3d7e8e82fd3484dc04b927bfcf5a58288 /extensions/browser/value_store
parent434a6e8d165a0de16aff328af7ec988ec11928ff (diff)
downloadchromium_src-04be9805637fc59cf954c9c4f5ff0588a70d7479.zip
chromium_src-04be9805637fc59cf954c9c4f5ff0588a70d7479.tar.gz
chromium_src-04be9805637fc59cf954c9c4f5ff0588a70d7479.tar.bz2
Get rid of the rest of CreateStringValue
BUG=160586 Review URL: https://codereview.chromium.org/388963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser/value_store')
-rw-r--r--extensions/browser/value_store/leveldb_value_store_unittest.cc6
-rw-r--r--extensions/browser/value_store/value_store_change_unittest.cc18
-rw-r--r--extensions/browser/value_store/value_store_frontend_unittest.cc3
-rw-r--r--extensions/browser/value_store/value_store_unittest.cc6
4 files changed, 15 insertions, 18 deletions
diff --git a/extensions/browser/value_store/leveldb_value_store_unittest.cc b/extensions/browser/value_store/leveldb_value_store_unittest.cc
index c278b54..ddcedb2 100644
--- a/extensions/browser/value_store/leveldb_value_store_unittest.cc
+++ b/extensions/browser/value_store/leveldb_value_store_unittest.cc
@@ -66,7 +66,7 @@ TEST_F(LeveldbValueStoreUnitTest, RestoreKeyTest) {
const char kValue[] = "value";
// Insert a valid pair.
- scoped_ptr<base::Value> value(base::Value::CreateStringValue(kValue));
+ scoped_ptr<base::Value> value(new base::StringValue(kValue));
ASSERT_FALSE(
store()->Set(ValueStore::DEFAULTS, kNotCorruptKey, *value)->HasError());
@@ -107,7 +107,7 @@ TEST_F(LeveldbValueStoreUnitTest, RestoreDoesMinimumNecessary) {
const char kCorruptValue[] = "[{(.*+\"\'\\";
// Insert a collection of non-corrupted pairs.
- scoped_ptr<base::Value> value(base::Value::CreateStringValue(kValue));
+ scoped_ptr<base::Value> value(new base::StringValue(kValue));
for (size_t i = 0; i < kNotCorruptKeysSize; ++i) {
ASSERT_FALSE(store()
->Set(ValueStore::DEFAULTS, kNotCorruptKeys[i], *value)
@@ -152,7 +152,7 @@ TEST_F(LeveldbValueStoreUnitTest, RestoreFullDatabase) {
const char kValue[] = "value";
// Generate a database.
- scoped_ptr<base::Value> value(base::Value::CreateStringValue(kValue));
+ scoped_ptr<base::Value> value(new base::StringValue(kValue));
for (size_t i = 0; i < kNotCorruptKeysSize; ++i) {
ASSERT_FALSE(store()
->Set(ValueStore::DEFAULTS, kNotCorruptKeys[i], *value)
diff --git a/extensions/browser/value_store/value_store_change_unittest.cc b/extensions/browser/value_store/value_store_change_unittest.cc
index 5fb75b7..9da1f64 100644
--- a/extensions/browser/value_store/value_store_change_unittest.cc
+++ b/extensions/browser/value_store/value_store_change_unittest.cc
@@ -18,22 +18,22 @@ using extensions::ListBuilder;
namespace {
TEST(ValueStoreChangeTest, NullOldValue) {
- ValueStoreChange change("key", NULL, base::Value::CreateStringValue("value"));
+ ValueStoreChange change("key", NULL, new base::StringValue("value"));
EXPECT_EQ("key", change.key());
EXPECT_EQ(NULL, change.old_value());
{
- scoped_ptr<base::Value> expected(base::Value::CreateStringValue("value"));
+ scoped_ptr<base::Value> expected(new base::StringValue("value"));
EXPECT_TRUE(change.new_value()->Equals(expected.get()));
}
}
TEST(ValueStoreChangeTest, NullNewValue) {
- ValueStoreChange change("key", base::Value::CreateStringValue("value"), NULL);
+ ValueStoreChange change("key", new base::StringValue("value"), NULL);
EXPECT_EQ("key", change.key());
{
- scoped_ptr<base::Value> expected(base::Value::CreateStringValue("value"));
+ scoped_ptr<base::Value> expected(new base::StringValue("value"));
EXPECT_TRUE(change.old_value()->Equals(expected.get()));
}
EXPECT_EQ(NULL, change.new_value());
@@ -41,18 +41,16 @@ TEST(ValueStoreChangeTest, NullNewValue) {
TEST(ValueStoreChangeTest, NonNullValues) {
ValueStoreChange change("key",
- base::Value::CreateStringValue("old_value"),
- base::Value::CreateStringValue("new_value"));
+ new base::StringValue("old_value"),
+ new base::StringValue("new_value"));
EXPECT_EQ("key", change.key());
{
- scoped_ptr<base::Value> expected(
- base::Value::CreateStringValue("old_value"));
+ scoped_ptr<base::Value> expected(new base::StringValue("old_value"));
EXPECT_TRUE(change.old_value()->Equals(expected.get()));
}
{
- scoped_ptr<base::Value> expected(
- base::Value::CreateStringValue("new_value"));
+ scoped_ptr<base::Value> expected(new base::StringValue("new_value"));
EXPECT_TRUE(change.new_value()->Equals(expected.get()));
}
}
diff --git a/extensions/browser/value_store/value_store_frontend_unittest.cc b/extensions/browser/value_store/value_store_frontend_unittest.cc
index 3d81a1d..82c24ce 100644
--- a/extensions/browser/value_store/value_store_frontend_unittest.cc
+++ b/extensions/browser/value_store/value_store_frontend_unittest.cc
@@ -88,8 +88,7 @@ TEST_F(ValueStoreFrontendTest, GetExistingData) {
TEST_F(ValueStoreFrontendTest, ChangesPersistAfterReload) {
storage_->Set("key0",
scoped_ptr<base::Value>(base::Value::CreateIntegerValue(0)));
- storage_->Set("key1",
- scoped_ptr<base::Value>(base::Value::CreateStringValue("new1")));
+ storage_->Set("key1", scoped_ptr<base::Value>(new base::StringValue("new1")));
storage_->Remove("key2");
// Reload the DB and test our changes.
diff --git a/extensions/browser/value_store/value_store_unittest.cc b/extensions/browser/value_store/value_store_unittest.cc
index a859570..4293459 100644
--- a/extensions/browser/value_store/value_store_unittest.cc
+++ b/extensions/browser/value_store/value_store_unittest.cc
@@ -135,9 +135,9 @@ ValueStoreTest::ValueStoreTest()
dict123_(new base::DictionaryValue()),
ui_thread_(BrowserThread::UI, base::MessageLoop::current()),
file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {
- val1_.reset(base::Value::CreateStringValue(key1_ + "Value"));
- val2_.reset(base::Value::CreateStringValue(key2_ + "Value"));
- val3_.reset(base::Value::CreateStringValue(key3_ + "Value"));
+ val1_.reset(new base::StringValue(key1_ + "Value"));
+ val2_.reset(new base::StringValue(key2_ + "Value"));
+ val3_.reset(new base::StringValue(key3_ + "Value"));
list1_.push_back(key1_);
list2_.push_back(key2_);