| Index: tools/json_schema_compiler/test/objects_unittest.cc
|
| diff --git a/tools/json_schema_compiler/test/objects_unittest.cc b/tools/json_schema_compiler/test/objects_unittest.cc
|
| index b0ed54f1ceaf32d22635701e086d1dd7b514e933..95c3f0d96ac31aa5828cbdeb0abf3cdf6015647e 100644
|
| --- a/tools/json_schema_compiler/test/objects_unittest.cc
|
| +++ b/tools/json_schema_compiler/test/objects_unittest.cc
|
| @@ -46,14 +46,25 @@ TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
|
| }
|
|
|
| TEST(JsonSchemaCompilerObjectsTest, ReturnsObjectResultCreate) {
|
| - scoped_ptr<ReturnsObject::Result::Info> info(
|
| - new ReturnsObject::Result::Info());
|
| - info->state = ReturnsObject::Result::Info::STATE_FOO;
|
| - scoped_ptr<Value> result_value(
|
| - ReturnsObject::Result::Create(*info));
|
| - DictionaryValue* result_dict = NULL;
|
| - EXPECT_TRUE(result_value->GetAsDictionary(&result_dict));
|
| - std::string state;
|
| - EXPECT_TRUE(result_dict->GetString("state", &state));
|
| - EXPECT_EQ("foo", state);
|
| + ReturnsObject::Results::Info info;
|
| + info.state = ReturnsObject::Results::Info::STATE_FOO;
|
| + scoped_ptr<ListValue> results = ReturnsObject::Results::Create(info);
|
| +
|
| + DictionaryValue expected;
|
| + expected.SetString("state", "foo");
|
| + DictionaryValue* result = NULL;
|
| + ASSERT_TRUE(results->GetDictionary(0, &result));
|
| + ASSERT_TRUE(result->Equals(&expected));
|
| +}
|
| +
|
| +TEST(JsonSchemaCompilerObjectsTest, OnObjectFiredCreate) {
|
| + OnObjectFired::SomeObject object;
|
| + object.state = OnObjectFired::SomeObject::STATE_BAR;
|
| + scoped_ptr<ListValue> results(OnObjectFired::Create(object));
|
| +
|
| + DictionaryValue expected;
|
| + expected.SetString("state", "bar");
|
| + DictionaryValue* result = NULL;
|
| + ASSERT_TRUE(results->GetDictionary(0, &result));
|
| + ASSERT_TRUE(result->Equals(&expected));
|
| }
|
|
|