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

Unified Diff: tools/json_schema_compiler/test/additional_properties_unittest.cc

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reworked Create functions and lots of tests. 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 side-by-side diff with in-line comments
Download patch
Index: tools/json_schema_compiler/test/additional_properties_unittest.cc
diff --git a/tools/json_schema_compiler/test/additional_properties_unittest.cc b/tools/json_schema_compiler/test/additional_properties_unittest.cc
index ef0ab296eec650c9b29211f50170745b67f18cbf..28e782c9423c1ad5de2859fe4713ccaa5d3a5954 100644
--- a/tools/json_schema_compiler/test/additional_properties_unittest.cc
+++ b/tools/json_schema_compiler/test/additional_properties_unittest.cc
@@ -48,17 +48,15 @@ TEST(JsonSchemaCompilerAdditionalPropertiesTest,
TEST(JsonSchemaCompilerAdditionalPropertiesTest,
ReturnAdditionalPropertiesResultCreate) {
- scoped_ptr<DictionaryValue> result_object_value(new DictionaryValue());
- result_object_value->SetString("key", "value");
- scoped_ptr<ReturnAdditionalProperties::Result::ResultObject> result_object(
- new ReturnAdditionalProperties::Result::ResultObject());
- result_object->integer = 5;
- result_object->additional_properties.MergeDictionary(
- result_object_value.get());
- scoped_ptr<Value> result(
- ReturnAdditionalProperties::Result::Create(*result_object));
+ DictionaryValue additional;
+ additional.SetString("key", "value");
+ ReturnAdditionalProperties::Result::ResultObject result_object;
+ result_object.integer = 5;
+ result_object.additional_properties.MergeDictionary(&additional);
+ scoped_ptr<ListValue> results(
+ ReturnAdditionalProperties::Result::Create(result_object));
DictionaryValue* result_dict = NULL;
- EXPECT_TRUE(result->GetAsDictionary(&result_dict));
+ EXPECT_TRUE(results->GetDictionary(0, &result_dict));
Value* int_temp_value_out = NULL;
int int_temp = 0;
@@ -67,5 +65,5 @@ TEST(JsonSchemaCompilerAdditionalPropertiesTest,
EXPECT_TRUE(int_temp_value->GetAsInteger(&int_temp));
EXPECT_EQ(5, int_temp);
- EXPECT_TRUE(result_dict->Equals(result_object_value.get()));
+ EXPECT_TRUE(result_dict->Equals(&additional));
}

Powered by Google App Engine
This is Rietveld 408576698