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

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

Issue 388963002: Get rid of the rest of CreateStringValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad rebase 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/json_schema_compiler/test/any.h" 6 #include "tools/json_schema_compiler/test/any.h"
7 7
8 using namespace test::api::any; 8 using namespace test::api::any;
9 9
10 TEST(JsonSchemaCompilerAnyTest, AnyTypePopulate) { 10 TEST(JsonSchemaCompilerAnyTest, AnyTypePopulate) {
(...skipping 20 matching lines...) Expand all
31 TEST(JsonSchemaCompilerAnyTest, OptionalAnyParamsCreate) { 31 TEST(JsonSchemaCompilerAnyTest, OptionalAnyParamsCreate) {
32 { 32 {
33 scoped_ptr<base::ListValue> params_value(new base::ListValue()); 33 scoped_ptr<base::ListValue> params_value(new base::ListValue());
34 scoped_ptr<OptionalAny::Params> params( 34 scoped_ptr<OptionalAny::Params> params(
35 OptionalAny::Params::Create(*params_value)); 35 OptionalAny::Params::Create(*params_value));
36 EXPECT_TRUE(params.get()); 36 EXPECT_TRUE(params.get());
37 EXPECT_FALSE(params->any_name.get()); 37 EXPECT_FALSE(params->any_name.get());
38 } 38 }
39 { 39 {
40 scoped_ptr<base::ListValue> params_value(new base::ListValue()); 40 scoped_ptr<base::ListValue> params_value(new base::ListValue());
41 scoped_ptr<base::Value> param(base::Value::CreateStringValue("asdf")); 41 scoped_ptr<base::Value> param(new base::StringValue("asdf"));
42 params_value->Append(param->DeepCopy()); 42 params_value->Append(param->DeepCopy());
43 scoped_ptr<OptionalAny::Params> params( 43 scoped_ptr<OptionalAny::Params> params(
44 OptionalAny::Params::Create(*params_value)); 44 OptionalAny::Params::Create(*params_value));
45 ASSERT_TRUE(params); 45 ASSERT_TRUE(params);
46 ASSERT_TRUE(params->any_name); 46 ASSERT_TRUE(params->any_name);
47 EXPECT_TRUE(params->any_name->Equals(param.get())); 47 EXPECT_TRUE(params->any_name->Equals(param.get()));
48 } 48 }
49 { 49 {
50 scoped_ptr<base::ListValue> params_value(new base::ListValue()); 50 scoped_ptr<base::ListValue> params_value(new base::ListValue());
51 scoped_ptr<base::Value> param(new base::FundamentalValue(true)); 51 scoped_ptr<base::Value> param(new base::FundamentalValue(true));
52 params_value->Append(param->DeepCopy()); 52 params_value->Append(param->DeepCopy());
53 scoped_ptr<OptionalAny::Params> params( 53 scoped_ptr<OptionalAny::Params> params(
54 OptionalAny::Params::Create(*params_value)); 54 OptionalAny::Params::Create(*params_value));
55 ASSERT_TRUE(params); 55 ASSERT_TRUE(params);
56 ASSERT_TRUE(params->any_name); 56 ASSERT_TRUE(params->any_name);
57 EXPECT_TRUE(params->any_name->Equals(param.get())); 57 EXPECT_TRUE(params->any_name->Equals(param.get()));
58 } 58 }
59 } 59 }
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/additional_properties_unittest.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