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

Unified Diff: base/values_unittest.cc

Issue 1129083003: More base::Values-related bare pointer -> scoped_ptr conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 years, 7 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 | « base/values.cc ('k') | cc/debug/invalidation_benchmark.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values_unittest.cc
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index b365a2244cde9b73c7f7df7e35317db6890d471f..6466a962554d3b0ba1e2cae0df95c53f21619968 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -320,9 +320,8 @@ TEST(ValuesTest, DictionaryRemoval) {
TEST(ValuesTest, DictionaryWithoutPathExpansion) {
DictionaryValue dict;
- dict.Set("this.is.expanded", make_scoped_ptr(Value::CreateNullValue()));
- dict.SetWithoutPathExpansion("this.isnt.expanded",
- make_scoped_ptr(Value::CreateNullValue()));
+ dict.Set("this.is.expanded", Value::CreateNullValue());
+ dict.SetWithoutPathExpansion("this.isnt.expanded", Value::CreateNullValue());
EXPECT_FALSE(dict.HasKey("this.is.expanded"));
EXPECT_TRUE(dict.HasKey("this"));
@@ -392,7 +391,7 @@ TEST(ValuesTest, DictionaryRemovePath) {
TEST(ValuesTest, DeepCopy) {
DictionaryValue original_dict;
- scoped_ptr<Value> scoped_null(Value::CreateNullValue());
+ scoped_ptr<Value> scoped_null = Value::CreateNullValue();
Value* original_null = scoped_null.get();
original_dict.Set("null", scoped_null.Pass());
scoped_ptr<FundamentalValue> scoped_bool(new FundamentalValue(true));
@@ -549,8 +548,8 @@ TEST(ValuesTest, Equals) {
EXPECT_NE(null1.get(), null2.get());
EXPECT_TRUE(null1->Equals(null2.get()));
- scoped_ptr<Value> boolean(new FundamentalValue(false));
- EXPECT_FALSE(null1->Equals(boolean.get()));
+ FundamentalValue boolean(false);
+ EXPECT_FALSE(null1->Equals(&boolean));
DictionaryValue dv;
dv.SetBoolean("a", false);
@@ -558,14 +557,14 @@ TEST(ValuesTest, Equals) {
dv.SetDouble("c", 2.5);
dv.SetString("d1", "string");
dv.SetString("d2", ASCIIToUTF16("http://google.com"));
- dv.Set("e", make_scoped_ptr(Value::CreateNullValue()));
+ dv.Set("e", Value::CreateNullValue());
scoped_ptr<DictionaryValue> copy = dv.CreateDeepCopy();
EXPECT_TRUE(dv.Equals(copy.get()));
scoped_ptr<ListValue> list(new ListValue);
ListValue* original_list = list.get();
- list->Append(make_scoped_ptr(Value::CreateNullValue()));
+ list->Append(Value::CreateNullValue());
list->Append(make_scoped_ptr(new DictionaryValue));
scoped_ptr<Value> list_copy(list->CreateDeepCopy());
« no previous file with comments | « base/values.cc ('k') | cc/debug/invalidation_benchmark.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698