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

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

Issue 397793002: Eliminate CreateBooleanValue from test files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad merge Created 6 years, 5 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 | Annotate | Revision Log
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 "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "tools/json_schema_compiler/test/enums.h" 8 #include "tools/json_schema_compiler/test/enums.h"
9 9
10 using namespace test::api::arrays; 10 using namespace test::api::arrays;
11 11
12 namespace { 12 namespace {
13 13
14 // TODO(calamity): Change to AppendString etc once kalman's patch goes through 14 // TODO(calamity): Change to AppendString etc once kalman's patch goes through
15 static scoped_ptr<base::DictionaryValue> CreateBasicArrayTypeDictionary() { 15 static scoped_ptr<base::DictionaryValue> CreateBasicArrayTypeDictionary() {
16 base::DictionaryValue* value = new base::DictionaryValue(); 16 base::DictionaryValue* value = new base::DictionaryValue();
17 base::ListValue* strings_value = new base::ListValue(); 17 base::ListValue* strings_value = new base::ListValue();
18 strings_value->Append(base::Value::CreateStringValue("a")); 18 strings_value->Append(base::Value::CreateStringValue("a"));
19 strings_value->Append(base::Value::CreateStringValue("b")); 19 strings_value->Append(base::Value::CreateStringValue("b"));
20 strings_value->Append(base::Value::CreateStringValue("c")); 20 strings_value->Append(base::Value::CreateStringValue("c"));
21 strings_value->Append(base::Value::CreateStringValue("it's easy as")); 21 strings_value->Append(base::Value::CreateStringValue("it's easy as"));
22 base::ListValue* integers_value = new base::ListValue(); 22 base::ListValue* integers_value = new base::ListValue();
23 integers_value->Append(new base::FundamentalValue(1)); 23 integers_value->Append(new base::FundamentalValue(1));
24 integers_value->Append(new base::FundamentalValue(2)); 24 integers_value->Append(new base::FundamentalValue(2));
25 integers_value->Append(new base::FundamentalValue(3)); 25 integers_value->Append(new base::FundamentalValue(3));
26 base::ListValue* booleans_value = new base::ListValue(); 26 base::ListValue* booleans_value = new base::ListValue();
27 booleans_value->Append(base::Value::CreateBooleanValue(false)); 27 booleans_value->Append(new base::FundamentalValue(false));
28 booleans_value->Append(base::Value::CreateBooleanValue(true)); 28 booleans_value->Append(new base::FundamentalValue(true));
29 base::ListValue* numbers_value = new base::ListValue(); 29 base::ListValue* numbers_value = new base::ListValue();
30 numbers_value->Append(base::Value::CreateDoubleValue(6.1)); 30 numbers_value->Append(base::Value::CreateDoubleValue(6.1));
31 value->Set("numbers", numbers_value); 31 value->Set("numbers", numbers_value);
32 value->Set("booleans", booleans_value); 32 value->Set("booleans", booleans_value);
33 value->Set("strings", strings_value); 33 value->Set("strings", strings_value);
34 value->Set("integers", integers_value); 34 value->Set("integers", integers_value);
35 return scoped_ptr<base::DictionaryValue>(value); 35 return scoped_ptr<base::DictionaryValue>(value);
36 } 36 }
37 37
38 static base::Value* CreateItemValue(int val) { 38 static base::Value* CreateItemValue(int val) {
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 base::ListValue* expected_argument = new base::ListValue(); 308 base::ListValue* expected_argument = new base::ListValue();
309 base::DictionaryValue* first = new base::DictionaryValue(); 309 base::DictionaryValue* first = new base::DictionaryValue();
310 first->SetInteger("val", 1); 310 first->SetInteger("val", 1);
311 expected_argument->Append(first); 311 expected_argument->Append(first);
312 base::DictionaryValue* second = new base::DictionaryValue(); 312 base::DictionaryValue* second = new base::DictionaryValue();
313 second->SetInteger("val", 2); 313 second->SetInteger("val", 2);
314 expected_argument->Append(second); 314 expected_argument->Append(second);
315 expected.Append(expected_argument); 315 expected.Append(expected_argument);
316 EXPECT_TRUE(results->Equals(&expected)); 316 EXPECT_TRUE(results->Equals(&expected));
317 } 317 }
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/any_unittest.cc ('k') | tools/json_schema_compiler/test/choices_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698