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

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

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Tested GetAllPossibleParameterLists better. Created 8 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
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/simple_api.h" 5 #include "tools/json_schema_compiler/test/simple_api.h"
6 #include "tools/json_schema_compiler/test/crossref.h" 6 #include "tools/json_schema_compiler/test/crossref.h"
7 7
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 using namespace test::api::crossref; 10 using namespace test::api::crossref;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 TestTypeOptionalParam::Params::Create(*params_value)); 53 TestTypeOptionalParam::Params::Create(*params_value));
54 EXPECT_FALSE(params.get()); 54 EXPECT_FALSE(params.get());
55 } 55 }
56 56
57 TEST(JsonSchemaCompilerCrossrefTest, GetTestType) { 57 TEST(JsonSchemaCompilerCrossrefTest, GetTestType) {
58 scoped_ptr<DictionaryValue> value = CreateTestTypeDictionary(); 58 scoped_ptr<DictionaryValue> value = CreateTestTypeDictionary();
59 scoped_ptr<test::api::simple_api::TestType> test_type( 59 scoped_ptr<test::api::simple_api::TestType> test_type(
60 new test::api::simple_api::TestType()); 60 new test::api::simple_api::TestType());
61 EXPECT_TRUE( 61 EXPECT_TRUE(
62 test::api::simple_api::TestType::Populate(*value, test_type.get())); 62 test::api::simple_api::TestType::Populate(*value, test_type.get()));
63 scoped_ptr<Value> result(GetTestType::Result::Create(*test_type)); 63
64 EXPECT_TRUE(value->Equals(result.get())); 64 scoped_ptr<ListValue> results(GetTestType::Result::Create(*test_type));
65 DictionaryValue* result = NULL;
66 ASSERT_TRUE(results->GetDictionary(0, &result));
67 EXPECT_TRUE(value->Equals(result));
65 } 68 }
66 69
67 TEST(JsonSchemaCompilerCrossrefTest, TestTypeInObjectParamsCreate) { 70 TEST(JsonSchemaCompilerCrossrefTest, TestTypeInObjectParamsCreate) {
68 { 71 {
69 scoped_ptr<ListValue> params_value(new ListValue()); 72 scoped_ptr<ListValue> params_value(new ListValue());
70 scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue()); 73 scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue());
71 param_object_value->Set("testType", CreateTestTypeDictionary().release()); 74 param_object_value->Set("testType", CreateTestTypeDictionary().release());
72 param_object_value->Set("boolean", Value::CreateBooleanValue(true)); 75 param_object_value->Set("boolean", Value::CreateBooleanValue(true));
73 params_value->Append(param_object_value.release()); 76 params_value->Append(param_object_value.release());
74 scoped_ptr<TestTypeInObject::Params> params( 77 scoped_ptr<TestTypeInObject::Params> params(
(...skipping 28 matching lines...) Expand all
103 { 106 {
104 scoped_ptr<ListValue> params_value(new ListValue()); 107 scoped_ptr<ListValue> params_value(new ListValue());
105 scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue()); 108 scoped_ptr<DictionaryValue> param_object_value(new DictionaryValue());
106 param_object_value->Set("testType", CreateTestTypeDictionary().release()); 109 param_object_value->Set("testType", CreateTestTypeDictionary().release());
107 params_value->Append(param_object_value.release()); 110 params_value->Append(param_object_value.release());
108 scoped_ptr<TestTypeInObject::Params> params( 111 scoped_ptr<TestTypeInObject::Params> params(
109 TestTypeInObject::Params::Create(*params_value)); 112 TestTypeInObject::Params::Create(*params_value));
110 EXPECT_FALSE(params.get()); 113 EXPECT_FALSE(params.get());
111 } 114 }
112 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698