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

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

Issue 2084633002: json_schema_compiler: Don't use deprecated ListValue::Append(Value*) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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/arrays.h" 5 #include "tools/json_schema_compiler/test/arrays.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 23 matching lines...) Expand all
34 booleans_value->AppendBoolean(true); 34 booleans_value->AppendBoolean(true);
35 base::ListValue* numbers_value = new base::ListValue(); 35 base::ListValue* numbers_value = new base::ListValue();
36 numbers_value->AppendDouble(6.1); 36 numbers_value->AppendDouble(6.1);
37 value->Set("numbers", numbers_value); 37 value->Set("numbers", numbers_value);
38 value->Set("booleans", booleans_value); 38 value->Set("booleans", booleans_value);
39 value->Set("strings", strings_value); 39 value->Set("strings", strings_value);
40 value->Set("integers", integers_value); 40 value->Set("integers", integers_value);
41 return value; 41 return value;
42 } 42 }
43 43
44 static base::Value* CreateItemValue(int val) { 44 static std::unique_ptr<base::DictionaryValue> CreateItemValue(int val) {
Devlin 2016/06/20 17:14:40 optional nitty nit: remove static, since this is a
dcheng 2016/06/20 17:24:29 Done.
45 base::DictionaryValue* value(new base::DictionaryValue()); 45 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
46 value->Set("val", new base::FundamentalValue(val)); 46 value->Set("val", new base::FundamentalValue(val));
47 return value; 47 return value;
48 } 48 }
49 49
50 } // namespace 50 } // namespace
51 51
52 TEST(JsonSchemaCompilerArrayTest, BasicArrayType) { 52 TEST(JsonSchemaCompilerArrayTest, BasicArrayType) {
53 { 53 {
54 std::unique_ptr<base::DictionaryValue> value = 54 std::unique_ptr<base::DictionaryValue> value =
55 CreateBasicArrayTypeDictionary(); 55 CreateBasicArrayTypeDictionary();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 std::unique_ptr<base::ListValue> expected_argument(new base::ListValue()); 269 std::unique_ptr<base::ListValue> expected_argument(new base::ListValue());
270 std::unique_ptr<base::DictionaryValue> first(new base::DictionaryValue()); 270 std::unique_ptr<base::DictionaryValue> first(new base::DictionaryValue());
271 first->SetInteger("val", 1); 271 first->SetInteger("val", 1);
272 expected_argument->Append(std::move(first)); 272 expected_argument->Append(std::move(first));
273 std::unique_ptr<base::DictionaryValue> second(new base::DictionaryValue()); 273 std::unique_ptr<base::DictionaryValue> second(new base::DictionaryValue());
274 second->SetInteger("val", 2); 274 second->SetInteger("val", 2);
275 expected_argument->Append(std::move(second)); 275 expected_argument->Append(std::move(second));
276 expected.Append(std::move(expected_argument)); 276 expected.Append(std::move(expected_argument));
277 EXPECT_TRUE(results->Equals(&expected)); 277 EXPECT_TRUE(results->Equals(&expected));
278 } 278 }
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/any_unittest.cc ('k') | tools/json_schema_compiler/test/functions_on_types_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698