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

Unified Diff: base/values_unittest.cc

Issue 1150863002: Make DictionaryValue::DeepCopyWithoutEmptyChildren return a scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove semicolons 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') | chrome/browser/chromeos/extensions/echo_private_api.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 6466a962554d3b0ba1e2cae0df95c53f21619968..37ed7cecb7e723223fa45f015b20e80f1ff83cee 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -672,25 +672,25 @@ TEST(ValuesTest, RemoveEmptyChildren) {
root->Set("empty_list", make_scoped_ptr(new ListValue));
root->SetWithoutPathExpansion("a.b.c.d.e",
make_scoped_ptr(new DictionaryValue));
- root.reset(root->DeepCopyWithoutEmptyChildren());
+ root = root->DeepCopyWithoutEmptyChildren();
EXPECT_TRUE(root->empty());
// Make sure we don't prune too much.
root->SetBoolean("bool", true);
root->Set("empty_dict", make_scoped_ptr(new DictionaryValue));
root->SetString("empty_string", std::string());
- root.reset(root->DeepCopyWithoutEmptyChildren());
+ root = root->DeepCopyWithoutEmptyChildren();
EXPECT_EQ(2U, root->size());
// Should do nothing.
- root.reset(root->DeepCopyWithoutEmptyChildren());
+ root = root->DeepCopyWithoutEmptyChildren();
EXPECT_EQ(2U, root->size());
// Nested test cases. These should all reduce back to the bool and string
// set above.
{
root->Set("a.b.c.d.e", make_scoped_ptr(new DictionaryValue));
- root.reset(root->DeepCopyWithoutEmptyChildren());
+ root = root->DeepCopyWithoutEmptyChildren();
EXPECT_EQ(2U, root->size());
}
{
@@ -698,7 +698,7 @@ TEST(ValuesTest, RemoveEmptyChildren) {
inner->Set("empty_dict", make_scoped_ptr(new DictionaryValue));
inner->Set("empty_list", make_scoped_ptr(new ListValue));
root->Set("dict_with_empty_children", inner.Pass());
- root.reset(root->DeepCopyWithoutEmptyChildren());
+ root = root->DeepCopyWithoutEmptyChildren();
EXPECT_EQ(2U, root->size());
}
{
@@ -706,7 +706,7 @@ TEST(ValuesTest, RemoveEmptyChildren) {
inner->Append(make_scoped_ptr(new DictionaryValue));
inner->Append(make_scoped_ptr(new ListValue));
root->Set("list_with_empty_children", inner.Pass());
- root.reset(root->DeepCopyWithoutEmptyChildren());
+ root = root->DeepCopyWithoutEmptyChildren();
EXPECT_EQ(2U, root->size());
}
@@ -720,7 +720,7 @@ TEST(ValuesTest, RemoveEmptyChildren) {
inner2->Set("empty_dict", make_scoped_ptr(new DictionaryValue));
inner2->Set("empty_list", make_scoped_ptr(new ListValue));
root->Set("dict_with_empty_children", inner2.Pass());
- root.reset(root->DeepCopyWithoutEmptyChildren());
+ root = root->DeepCopyWithoutEmptyChildren();
EXPECT_EQ(2U, root->size());
}
@@ -732,7 +732,7 @@ TEST(ValuesTest, RemoveEmptyChildren) {
inner->Append(make_scoped_ptr(new DictionaryValue));
inner->Append(inner2.Pass());
root->Set("list_with_empty_children", inner.Pass());
- root.reset(root->DeepCopyWithoutEmptyChildren());
+ root = root->DeepCopyWithoutEmptyChildren();
EXPECT_EQ(3U, root->size());
ListValue* inner_value, *inner_value2;
« no previous file with comments | « base/values.cc ('k') | chrome/browser/chromeos/extensions/echo_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698