| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "tools/json_schema_compiler/test/objects.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 using namespace test::api::callbacks; |
| 10 |
| 11 TEST(JsonSchemaCompilerObjectsTest, ReturnsObjectResultCreate) { |
| 12 ReturnsObject::Result::SomeObject some_object; |
| 13 some_object.state = ReturnsObject::Result::Info::STATE_FOO; |
| 14 scoped_ptr<Value> result_value(ReturnsObject::Result::Create(some_object)); |
| 15 |
| 16 DictionaryValue* result_dict = NULL; |
| 17 EXPECT_TRUE(result_value->GetAsDictionary(&result_dict)); |
| 18 std::string state; |
| 19 EXPECT_TRUE(result_dict->GetString("state", &state)); |
| 20 EXPECT_EQ("foo", state); |
| 21 } |
| 22 |
| 23 TEST(JsonSchemaCompilerObjectsTest, ReturnsMultipleResultCreate) { |
| 24 ReturnsMultiple::Result::Info some_object; |
| 25 some_object.state = ReturnsMultiple::Result::Info::STATE_FOO; |
| 26 scoped_ptr<Value> result_value(ReturnsObject::Result::Create(some_object)); |
| 27 |
| 28 DictionaryValue* result_dict = NULL; |
| 29 EXPECT_TRUE(result_value->GetAsDictionary(&result_dict)); |
| 30 std::string state; |
| 31 EXPECT_TRUE(result_dict->GetString("state", &state)); |
| 32 EXPECT_EQ("foo", state); |
| 33 } |
| OLD | NEW |