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

Side by Side Diff: tools/json_schema_compiler/test/additional_properties_unittest.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 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 unified diff | Download patch
« no previous file with comments | « pdf/pdfium/pdfium_page.cc ('k') | tools/json_schema_compiler/test/arrays_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/json_schema_compiler/test/additional_properties.h" 5 #include "tools/json_schema_compiler/test/additional_properties.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility>
8 9
9 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
10 11
11 using namespace test::api::additional_properties; 12 using namespace test::api::additional_properties;
12 13
13 TEST(JsonSchemaCompilerAdditionalPropertiesTest, 14 TEST(JsonSchemaCompilerAdditionalPropertiesTest,
14 AdditionalPropertiesTypePopulate) { 15 AdditionalPropertiesTypePopulate) {
15 { 16 {
16 std::unique_ptr<base::ListValue> list_value(new base::ListValue()); 17 std::unique_ptr<base::ListValue> list_value(new base::ListValue());
17 list_value->AppendString("asdf"); 18 list_value->AppendString("asdf");
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 53 }
53 54
54 TEST(JsonSchemaCompilerAdditionalPropertiesTest, 55 TEST(JsonSchemaCompilerAdditionalPropertiesTest,
55 ReturnAdditionalPropertiesResultCreate) { 56 ReturnAdditionalPropertiesResultCreate) {
56 ReturnAdditionalProperties::Results::ResultObject result_object; 57 ReturnAdditionalProperties::Results::ResultObject result_object;
57 result_object.integer = 5; 58 result_object.integer = 5;
58 result_object.additional_properties["key"] = "value"; 59 result_object.additional_properties["key"] = "value";
59 60
60 base::ListValue expected; 61 base::ListValue expected;
61 { 62 {
62 base::DictionaryValue* dict = new base::DictionaryValue(); 63 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
63 dict->SetInteger("integer", 5); 64 dict->SetInteger("integer", 5);
64 dict->SetString("key", "value"); 65 dict->SetString("key", "value");
65 expected.Append(dict); 66 expected.Append(std::move(dict));
66 } 67 }
67 68
68 EXPECT_TRUE(base::Value::Equals( 69 EXPECT_TRUE(base::Value::Equals(
69 ReturnAdditionalProperties::Results::Create(result_object).get(), 70 ReturnAdditionalProperties::Results::Create(result_object).get(),
70 &expected)); 71 &expected));
71 } 72 }
OLDNEW
« no previous file with comments | « pdf/pdfium/pdfium_page.cc ('k') | tools/json_schema_compiler/test/arrays_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698