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

Unified Diff: tools/json_schema_compiler/test/choices_unittest.cc

Issue 2911033002: Remove raw base::DictionaryValue::Set (Closed)
Patch Set: Proper Windows Fix Created 3 years, 6 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
Index: tools/json_schema_compiler/test/choices_unittest.cc
diff --git a/tools/json_schema_compiler/test/choices_unittest.cc b/tools/json_schema_compiler/test/choices_unittest.cc
index 708c90053ba8d84f67b74d50b7a19488ed2b9320..081d2eee3c92136b7833afdba174613eb7330644 100644
--- a/tools/json_schema_compiler/test/choices_unittest.cc
+++ b/tools/json_schema_compiler/test/choices_unittest.cc
@@ -112,13 +112,13 @@ TEST(JsonSchemaCompilerChoicesTest, PopulateChoiceType) {
std::string("of"),
std::string("strings"));
- base::ListValue* strings_value = new base::ListValue();
+ auto strings_value = base::MakeUnique<base::ListValue>();
for (size_t i = 0; i < strings.size(); ++i)
strings_value->AppendString(strings[i]);
base::DictionaryValue value;
value.SetInteger("integers", 4);
- value.Set("strings", strings_value);
+ value.Set("strings", std::move(strings_value));
ChoiceType out;
ASSERT_TRUE(ChoiceType::Populate(value, &out));
@@ -132,14 +132,14 @@ TEST(JsonSchemaCompilerChoicesTest, PopulateChoiceType) {
}
TEST(JsonSchemaCompilerChoicesTest, ChoiceTypeToValue) {
- base::ListValue* strings_value = new base::ListValue();
+ auto strings_value = base::MakeUnique<base::ListValue>();
strings_value->AppendString("list");
strings_value->AppendString("of");
strings_value->AppendString("strings");
base::DictionaryValue value;
value.SetInteger("integers", 5);
- value.Set("strings", strings_value);
+ value.Set("strings", std::move(strings_value));
ChoiceType out;
ASSERT_TRUE(ChoiceType::Populate(value, &out));
« no previous file with comments | « tools/json_schema_compiler/test/arrays_unittest.cc ('k') | tools/json_schema_compiler/test/crossref_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698