OLD | NEW |
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 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 using namespace test::api::simple_api; | 9 using namespace test::api::simple_api; |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 static std::unique_ptr<base::DictionaryValue> CreateTestTypeDictionary() { | 13 static std::unique_ptr<base::DictionaryValue> CreateTestTypeDictionary() { |
14 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 14 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
15 value->SetWithoutPathExpansion("number", new base::FundamentalValue(1.1)); | 15 value->SetWithoutPathExpansion("number", new base::Value(1.1)); |
16 value->SetWithoutPathExpansion("integer", new base::FundamentalValue(4)); | 16 value->SetWithoutPathExpansion("integer", new base::Value(4)); |
17 value->SetWithoutPathExpansion("string", new base::StringValue("bling")); | 17 value->SetWithoutPathExpansion("string", new base::StringValue("bling")); |
18 value->SetWithoutPathExpansion("boolean", new base::FundamentalValue(true)); | 18 value->SetWithoutPathExpansion("boolean", new base::Value(true)); |
19 return value; | 19 return value; |
20 } | 20 } |
21 | 21 |
22 } // namespace | 22 } // namespace |
23 | 23 |
24 TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerResultCreate) { | 24 TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerResultCreate) { |
25 std::unique_ptr<base::ListValue> results = | 25 std::unique_ptr<base::ListValue> results = |
26 IncrementInteger::Results::Create(5); | 26 IncrementInteger::Results::Create(5); |
27 base::ListValue expected; | 27 base::ListValue expected; |
28 expected.AppendInteger(5); | 28 expected.AppendInteger(5); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 ASSERT_TRUE(expected->GetInteger("integer", &some_test_type.integer)); | 175 ASSERT_TRUE(expected->GetInteger("integer", &some_test_type.integer)); |
176 ASSERT_TRUE(expected->GetBoolean("boolean", &some_test_type.boolean)); | 176 ASSERT_TRUE(expected->GetBoolean("boolean", &some_test_type.boolean)); |
177 | 177 |
178 std::unique_ptr<base::ListValue> results( | 178 std::unique_ptr<base::ListValue> results( |
179 OnTestTypeFired::Create(some_test_type)); | 179 OnTestTypeFired::Create(some_test_type)); |
180 base::DictionaryValue* result = NULL; | 180 base::DictionaryValue* result = NULL; |
181 results->GetDictionary(0, &result); | 181 results->GetDictionary(0, &result); |
182 EXPECT_TRUE(result->Equals(expected.get())); | 182 EXPECT_TRUE(result->Equals(expected.get())); |
183 } | 183 } |
184 } | 184 } |
OLD | NEW |