| 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/array.h" | 5 #include "tools/json_schema_compiler/test/arrays.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::array; | 9 using namespace test::api::arrays; |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 // TODO(calamity): Change to AppendString etc once kalman's patch goes through | 13 // TODO(calamity): Change to AppendString etc once kalman's patch goes through |
| 14 static scoped_ptr<DictionaryValue> CreateBasicArrayTypeDictionary() { | 14 static scoped_ptr<DictionaryValue> CreateBasicArrayTypeDictionary() { |
| 15 DictionaryValue* value = new DictionaryValue(); | 15 DictionaryValue* value = new DictionaryValue(); |
| 16 ListValue* strings_value = new ListValue(); | 16 ListValue* strings_value = new ListValue(); |
| 17 strings_value->Append(Value::CreateStringValue("a")); | 17 strings_value->Append(Value::CreateStringValue("a")); |
| 18 strings_value->Append(Value::CreateStringValue("b")); | 18 strings_value->Append(Value::CreateStringValue("b")); |
| 19 strings_value->Append(Value::CreateStringValue("c")); | 19 strings_value->Append(Value::CreateStringValue("c")); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 EXPECT_EQ(2UL, list->GetSize()); | 134 EXPECT_EQ(2UL, list->GetSize()); |
| 135 DictionaryValue* item_value = NULL; | 135 DictionaryValue* item_value = NULL; |
| 136 int temp; | 136 int temp; |
| 137 EXPECT_TRUE(list->GetDictionary(0, &item_value)); | 137 EXPECT_TRUE(list->GetDictionary(0, &item_value)); |
| 138 EXPECT_TRUE(item_value->GetInteger("val", &temp)); | 138 EXPECT_TRUE(item_value->GetInteger("val", &temp)); |
| 139 EXPECT_EQ(1, temp); | 139 EXPECT_EQ(1, temp); |
| 140 EXPECT_TRUE(list->GetDictionary(1, &item_value)); | 140 EXPECT_TRUE(list->GetDictionary(1, &item_value)); |
| 141 EXPECT_TRUE(item_value->GetInteger("val", &temp)); | 141 EXPECT_TRUE(item_value->GetInteger("val", &temp)); |
| 142 EXPECT_EQ(2, temp); | 142 EXPECT_EQ(2, temp); |
| 143 } | 143 } |
| OLD | NEW |