OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/error_generation.h" | 5 #include "tools/json_schema_compiler/test/error_generation.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "tools/json_schema_compiler/test/test_util.h" | 11 #include "tools/json_schema_compiler/test/test_util.h" |
12 | 12 |
13 using namespace test::api::error_generation; | 13 using namespace test::api::error_generation; |
14 using base::FundamentalValue; | 14 using base::Value; |
15 using json_schema_compiler::test_util::Dictionary; | 15 using json_schema_compiler::test_util::Dictionary; |
16 using json_schema_compiler::test_util::List; | 16 using json_schema_compiler::test_util::List; |
17 | 17 |
18 template <typename T> | 18 template <typename T> |
19 base::string16 GetPopulateError(const base::Value& value) { | 19 base::string16 GetPopulateError(const base::Value& value) { |
20 base::string16 error; | 20 base::string16 error; |
21 T test_type; | 21 T test_type; |
22 T::Populate(value, &test_type, &error); | 22 T::Populate(value, &test_type, &error); |
23 return error; | 23 return error; |
24 } | 24 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 EXPECT_TRUE(EqualsUtf16("expected integers or integer, got binary", | 57 EXPECT_TRUE(EqualsUtf16("expected integers or integer, got binary", |
58 GetPopulateError<ChoiceType::Integers>(*value))); | 58 GetPopulateError<ChoiceType::Integers>(*value))); |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 // GenerateTypePopulateProperty errors | 62 // GenerateTypePopulateProperty errors |
63 | 63 |
64 TEST(JsonSchemaCompilerErrorTest, TypeIsRequired) { | 64 TEST(JsonSchemaCompilerErrorTest, TypeIsRequired) { |
65 { | 65 { |
66 std::unique_ptr<base::DictionaryValue> value = | 66 std::unique_ptr<base::DictionaryValue> value = |
67 Dictionary("integers", new FundamentalValue(5)); | 67 Dictionary("integers", new Value(5)); |
68 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ChoiceType>(*value))); | 68 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ChoiceType>(*value))); |
69 } | 69 } |
70 { | 70 { |
71 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 71 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
72 EXPECT_TRUE(EqualsUtf16("'integers' is required", | 72 EXPECT_TRUE(EqualsUtf16("'integers' is required", |
73 GetPopulateError<ChoiceType>(*value))); | 73 GetPopulateError<ChoiceType>(*value))); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 // GenerateParamsCheck errors | 77 // GenerateParamsCheck errors |
78 | 78 |
79 TEST(JsonSchemaCompilerErrorTest, TooManyParameters) { | 79 TEST(JsonSchemaCompilerErrorTest, TooManyParameters) { |
80 { | 80 { |
81 std::unique_ptr<base::ListValue> params_value = | 81 std::unique_ptr<base::ListValue> params_value = List(new Value(5)); |
82 List(new FundamentalValue(5)); | |
83 base::string16 error; | 82 base::string16 error; |
84 EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error)); | 83 EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error)); |
85 } | 84 } |
86 { | 85 { |
87 std::unique_ptr<base::ListValue> params_value = | 86 std::unique_ptr<base::ListValue> params_value = |
88 List(new FundamentalValue(5), new FundamentalValue(5)); | 87 List(new Value(5), new Value(5)); |
89 base::string16 error; | 88 base::string16 error; |
90 EXPECT_FALSE(TestFunction::Params::Create(*params_value, &error)); | 89 EXPECT_FALSE(TestFunction::Params::Create(*params_value, &error)); |
91 EXPECT_TRUE(EqualsUtf16("expected 1 arguments, got 2", error)); | 90 EXPECT_TRUE(EqualsUtf16("expected 1 arguments, got 2", error)); |
92 } | 91 } |
93 } | 92 } |
94 | 93 |
95 // GenerateFunctionParamsCreate errors | 94 // GenerateFunctionParamsCreate errors |
96 | 95 |
97 TEST(JsonSchemaCompilerErrorTest, ParamIsRequired) { | 96 TEST(JsonSchemaCompilerErrorTest, ParamIsRequired) { |
98 { | 97 { |
99 std::unique_ptr<base::ListValue> params_value = | 98 std::unique_ptr<base::ListValue> params_value = List(new Value(5)); |
100 List(new FundamentalValue(5)); | |
101 base::string16 error; | 99 base::string16 error; |
102 EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error)); | 100 EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error)); |
103 } | 101 } |
104 { | 102 { |
105 std::unique_ptr<base::ListValue> params_value = | 103 std::unique_ptr<base::ListValue> params_value = |
106 List(base::Value::CreateNullValue().release()); | 104 List(base::Value::CreateNullValue().release()); |
107 base::string16 error; | 105 base::string16 error; |
108 EXPECT_FALSE(TestFunction::Params::Create(*params_value, &error)); | 106 EXPECT_FALSE(TestFunction::Params::Create(*params_value, &error)); |
109 EXPECT_TRUE(EqualsUtf16("'num' is required", error)); | 107 EXPECT_TRUE(EqualsUtf16("'num' is required", error)); |
110 } | 108 } |
111 } | 109 } |
112 | 110 |
113 // GeneratePopulateVariableFromValue errors | 111 // GeneratePopulateVariableFromValue errors |
114 | 112 |
115 TEST(JsonSchemaCompilerErrorTest, WrongPropertyValueType) { | 113 TEST(JsonSchemaCompilerErrorTest, WrongPropertyValueType) { |
116 { | 114 { |
117 std::unique_ptr<base::DictionaryValue> value = | 115 std::unique_ptr<base::DictionaryValue> value = |
118 Dictionary("string", new base::StringValue("yes")); | 116 Dictionary("string", new base::StringValue("yes")); |
119 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<TestType>(*value))); | 117 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<TestType>(*value))); |
120 } | 118 } |
121 { | 119 { |
122 std::unique_ptr<base::DictionaryValue> value = | 120 std::unique_ptr<base::DictionaryValue> value = |
123 Dictionary("string", new FundamentalValue(1.1)); | 121 Dictionary("string", new Value(1.1)); |
124 EXPECT_TRUE(EqualsUtf16("'string': expected string, got double", | 122 EXPECT_TRUE(EqualsUtf16("'string': expected string, got double", |
125 GetPopulateError<TestType>(*value))); | 123 GetPopulateError<TestType>(*value))); |
126 } | 124 } |
127 } | 125 } |
128 | 126 |
129 TEST(JsonSchemaCompilerErrorTest, WrongParameterCreationType) { | 127 TEST(JsonSchemaCompilerErrorTest, WrongParameterCreationType) { |
130 { | 128 { |
131 base::string16 error; | 129 base::string16 error; |
132 std::unique_ptr<base::ListValue> params_value = | 130 std::unique_ptr<base::ListValue> params_value = |
133 List(new base::StringValue("Yeah!")); | 131 List(new base::StringValue("Yeah!")); |
134 EXPECT_TRUE(TestString::Params::Create(*params_value, &error)); | 132 EXPECT_TRUE(TestString::Params::Create(*params_value, &error)); |
135 } | 133 } |
136 { | 134 { |
137 std::unique_ptr<base::ListValue> params_value = | 135 std::unique_ptr<base::ListValue> params_value = List(new Value(5)); |
138 List(new FundamentalValue(5)); | |
139 base::string16 error; | 136 base::string16 error; |
140 EXPECT_FALSE(TestTypeInObject::Params::Create(*params_value, &error)); | 137 EXPECT_FALSE(TestTypeInObject::Params::Create(*params_value, &error)); |
141 EXPECT_TRUE(EqualsUtf16("'paramObject': expected dictionary, got integer", | 138 EXPECT_TRUE(EqualsUtf16("'paramObject': expected dictionary, got integer", |
142 error)); | 139 error)); |
143 } | 140 } |
144 } | 141 } |
145 | 142 |
146 TEST(JsonSchemaCompilerErrorTest, WrongTypeValueType) { | 143 TEST(JsonSchemaCompilerErrorTest, WrongTypeValueType) { |
147 { | 144 { |
148 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 145 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
149 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ObjectType>(*value))); | 146 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ObjectType>(*value))); |
150 } | 147 } |
151 { | 148 { |
152 std::unique_ptr<base::DictionaryValue> value = | 149 std::unique_ptr<base::DictionaryValue> value = |
153 Dictionary("otherType", new FundamentalValue(1.1)); | 150 Dictionary("otherType", new Value(1.1)); |
154 ObjectType out; | 151 ObjectType out; |
155 base::string16 error; | 152 base::string16 error; |
156 EXPECT_TRUE(ObjectType::Populate(*value, &out, &error)); | 153 EXPECT_TRUE(ObjectType::Populate(*value, &out, &error)); |
157 EXPECT_TRUE(EqualsUtf16("'otherType': expected dictionary, got double", | 154 EXPECT_TRUE(EqualsUtf16("'otherType': expected dictionary, got double", |
158 error)); | 155 error)); |
159 EXPECT_EQ(NULL, out.other_type.get()); | 156 EXPECT_EQ(NULL, out.other_type.get()); |
160 } | 157 } |
161 } | 158 } |
162 | 159 |
163 TEST(JsonSchemaCompilerErrorTest, UnableToPopulateArray) { | 160 TEST(JsonSchemaCompilerErrorTest, UnableToPopulateArray) { |
164 { | 161 { |
165 std::unique_ptr<base::ListValue> params_value = | 162 std::unique_ptr<base::ListValue> params_value = List(new Value(5)); |
166 List(new FundamentalValue(5)); | |
167 EXPECT_TRUE(EqualsUtf16("", | 163 EXPECT_TRUE(EqualsUtf16("", |
168 GetPopulateError<ChoiceType::Integers>(*params_value))); | 164 GetPopulateError<ChoiceType::Integers>(*params_value))); |
169 } | 165 } |
170 { | 166 { |
171 std::unique_ptr<base::ListValue> params_value = | 167 std::unique_ptr<base::ListValue> params_value = |
172 List(new FundamentalValue(5), new FundamentalValue(false)); | 168 List(new Value(5), new Value(false)); |
173 EXPECT_TRUE(EqualsUtf16( | 169 EXPECT_TRUE(EqualsUtf16( |
174 "expected integer, got boolean; unable to populate array 'integers'", | 170 "expected integer, got boolean; unable to populate array 'integers'", |
175 GetPopulateError<ChoiceType::Integers>(*params_value))); | 171 GetPopulateError<ChoiceType::Integers>(*params_value))); |
176 } | 172 } |
177 } | 173 } |
178 | 174 |
179 TEST(JsonSchemaCompilerErrorTest, BinaryTypeExpected) { | 175 TEST(JsonSchemaCompilerErrorTest, BinaryTypeExpected) { |
180 { | 176 { |
181 std::unique_ptr<base::DictionaryValue> value = | 177 std::unique_ptr<base::DictionaryValue> value = |
182 Dictionary("data", new base::Value(base::Value::Type::BINARY)); | 178 Dictionary("data", new base::Value(base::Value::Type::BINARY)); |
183 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<BinaryData>(*value))); | 179 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<BinaryData>(*value))); |
184 } | 180 } |
185 { | 181 { |
186 std::unique_ptr<base::DictionaryValue> value = | 182 std::unique_ptr<base::DictionaryValue> value = |
187 Dictionary("data", new FundamentalValue(1.1)); | 183 Dictionary("data", new Value(1.1)); |
188 EXPECT_TRUE(EqualsUtf16("'data': expected binary, got double", | 184 EXPECT_TRUE(EqualsUtf16("'data': expected binary, got double", |
189 GetPopulateError<BinaryData>(*value))); | 185 GetPopulateError<BinaryData>(*value))); |
190 } | 186 } |
191 } | 187 } |
192 | 188 |
193 TEST(JsonSchemaCompilerErrorTest, ListExpected) { | 189 TEST(JsonSchemaCompilerErrorTest, ListExpected) { |
194 { | 190 { |
195 std::unique_ptr<base::DictionaryValue> value = | 191 std::unique_ptr<base::DictionaryValue> value = |
196 Dictionary("TheArray", new base::ListValue()); | 192 Dictionary("TheArray", new base::ListValue()); |
197 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ArrayObject>(*value))); | 193 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ArrayObject>(*value))); |
198 } | 194 } |
199 { | 195 { |
200 std::unique_ptr<base::DictionaryValue> value = | 196 std::unique_ptr<base::DictionaryValue> value = |
201 Dictionary("TheArray", new FundamentalValue(5)); | 197 Dictionary("TheArray", new Value(5)); |
202 EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer", | 198 EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer", |
203 GetPopulateError<ArrayObject>(*value))); | 199 GetPopulateError<ArrayObject>(*value))); |
204 } | 200 } |
205 } | 201 } |
206 | 202 |
207 // GenerateStringToEnumConversion errors | 203 // GenerateStringToEnumConversion errors |
208 | 204 |
209 TEST(JsonSchemaCompilerErrorTest, BadEnumValue) { | 205 TEST(JsonSchemaCompilerErrorTest, BadEnumValue) { |
210 { | 206 { |
211 std::unique_ptr<base::DictionaryValue> value = | 207 std::unique_ptr<base::DictionaryValue> value = |
(...skipping 12 matching lines...) Expand all Loading... |
224 // Warn but don't fail out errors | 220 // Warn but don't fail out errors |
225 | 221 |
226 TEST(JsonSchemaCompilerErrorTest, WarnOnOptionalFailure) { | 222 TEST(JsonSchemaCompilerErrorTest, WarnOnOptionalFailure) { |
227 { | 223 { |
228 std::unique_ptr<base::DictionaryValue> value = | 224 std::unique_ptr<base::DictionaryValue> value = |
229 Dictionary("string", new base::StringValue("bling")); | 225 Dictionary("string", new base::StringValue("bling")); |
230 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<OptionalTestType>(*value))); | 226 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<OptionalTestType>(*value))); |
231 } | 227 } |
232 { | 228 { |
233 std::unique_ptr<base::DictionaryValue> value = | 229 std::unique_ptr<base::DictionaryValue> value = |
234 Dictionary("string", new base::FundamentalValue(1)); | 230 Dictionary("string", new base::Value(1)); |
235 | 231 |
236 OptionalTestType out; | 232 OptionalTestType out; |
237 base::string16 error; | 233 base::string16 error; |
238 EXPECT_TRUE(OptionalTestType::Populate(*value, &out, &error)); | 234 EXPECT_TRUE(OptionalTestType::Populate(*value, &out, &error)); |
239 EXPECT_TRUE(EqualsUtf16("'string': expected string, got integer", | 235 EXPECT_TRUE(EqualsUtf16("'string': expected string, got integer", |
240 error)); | 236 error)); |
241 EXPECT_EQ(NULL, out.string.get()); | 237 EXPECT_EQ(NULL, out.string.get()); |
242 } | 238 } |
243 } | 239 } |
244 | 240 |
245 TEST(JsonSchemaCompilerErrorTest, OptionalBinaryTypeFailure) { | 241 TEST(JsonSchemaCompilerErrorTest, OptionalBinaryTypeFailure) { |
246 { | 242 { |
247 std::unique_ptr<base::DictionaryValue> value = | 243 std::unique_ptr<base::DictionaryValue> value = |
248 Dictionary("data", new base::Value(base::Value::Type::BINARY)); | 244 Dictionary("data", new base::Value(base::Value::Type::BINARY)); |
249 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<OptionalBinaryData>(*value))); | 245 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<OptionalBinaryData>(*value))); |
250 } | 246 } |
251 { | 247 { |
252 // There's a bug with silent failures if the key doesn't exist. | 248 // There's a bug with silent failures if the key doesn't exist. |
253 std::unique_ptr<base::DictionaryValue> value = | 249 std::unique_ptr<base::DictionaryValue> value = |
254 Dictionary("data", new base::FundamentalValue(1)); | 250 Dictionary("data", new base::Value(1)); |
255 | 251 |
256 OptionalBinaryData out; | 252 OptionalBinaryData out; |
257 base::string16 error; | 253 base::string16 error; |
258 EXPECT_TRUE(OptionalBinaryData::Populate(*value, &out, &error)); | 254 EXPECT_TRUE(OptionalBinaryData::Populate(*value, &out, &error)); |
259 EXPECT_TRUE(EqualsUtf16("'data': expected binary, got integer", | 255 EXPECT_TRUE(EqualsUtf16("'data': expected binary, got integer", |
260 error)); | 256 error)); |
261 EXPECT_EQ(NULL, out.data.get()); | 257 EXPECT_EQ(NULL, out.data.get()); |
262 } | 258 } |
263 } | 259 } |
264 | 260 |
265 TEST(JsonSchemaCompilerErrorTest, OptionalArrayTypeFailure) { | 261 TEST(JsonSchemaCompilerErrorTest, OptionalArrayTypeFailure) { |
266 { | 262 { |
267 std::unique_ptr<base::DictionaryValue> value = | 263 std::unique_ptr<base::DictionaryValue> value = |
268 Dictionary("TheArray", new base::ListValue()); | 264 Dictionary("TheArray", new base::ListValue()); |
269 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ArrayObject>(*value))); | 265 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ArrayObject>(*value))); |
270 } | 266 } |
271 { | 267 { |
272 std::unique_ptr<base::DictionaryValue> value = | 268 std::unique_ptr<base::DictionaryValue> value = |
273 Dictionary("TheArray", new FundamentalValue(5)); | 269 Dictionary("TheArray", new Value(5)); |
274 ArrayObject out; | 270 ArrayObject out; |
275 base::string16 error; | 271 base::string16 error; |
276 EXPECT_TRUE(ArrayObject::Populate(*value, &out, &error)); | 272 EXPECT_TRUE(ArrayObject::Populate(*value, &out, &error)); |
277 EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer", | 273 EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer", |
278 error)); | 274 error)); |
279 EXPECT_EQ(NULL, out.the_array.get()); | 275 EXPECT_EQ(NULL, out.the_array.get()); |
280 } | 276 } |
281 } | 277 } |
282 | 278 |
283 TEST(JsonSchemaCompilerErrorTest, OptionalUnableToPopulateArray) { | 279 TEST(JsonSchemaCompilerErrorTest, OptionalUnableToPopulateArray) { |
284 { | 280 { |
285 std::unique_ptr<base::ListValue> params_value = | 281 std::unique_ptr<base::ListValue> params_value = List(new Value(5)); |
286 List(new FundamentalValue(5)); | |
287 EXPECT_TRUE(EqualsUtf16("", | 282 EXPECT_TRUE(EqualsUtf16("", |
288 GetPopulateError<OptionalChoiceType::Integers>(*params_value))); | 283 GetPopulateError<OptionalChoiceType::Integers>(*params_value))); |
289 } | 284 } |
290 { | 285 { |
291 std::unique_ptr<base::ListValue> params_value = | 286 std::unique_ptr<base::ListValue> params_value = |
292 List(new FundamentalValue(5), new FundamentalValue(false)); | 287 List(new Value(5), new Value(false)); |
293 OptionalChoiceType::Integers out; | 288 OptionalChoiceType::Integers out; |
294 base::string16 error; | 289 base::string16 error; |
295 EXPECT_TRUE(OptionalChoiceType::Integers::Populate(*params_value, &out, | 290 EXPECT_TRUE(OptionalChoiceType::Integers::Populate(*params_value, &out, |
296 &error)); | 291 &error)); |
297 EXPECT_TRUE(EqualsUtf16( | 292 EXPECT_TRUE(EqualsUtf16( |
298 "expected integer, got boolean; unable to populate array 'integers'", | 293 "expected integer, got boolean; unable to populate array 'integers'", |
299 error)); | 294 error)); |
300 EXPECT_EQ(NULL, out.as_integer.get()); | 295 EXPECT_EQ(NULL, out.as_integer.get()); |
301 } | 296 } |
302 } | 297 } |
303 | 298 |
304 TEST(JsonSchemaCompilerErrorTest, MultiplePopulationErrors) { | 299 TEST(JsonSchemaCompilerErrorTest, MultiplePopulationErrors) { |
305 { | 300 { |
306 std::unique_ptr<base::DictionaryValue> value = | 301 std::unique_ptr<base::DictionaryValue> value = |
307 Dictionary("TheArray", new FundamentalValue(5)); | 302 Dictionary("TheArray", new Value(5)); |
308 ArrayObject out; | 303 ArrayObject out; |
309 base::string16 error; | 304 base::string16 error; |
310 EXPECT_TRUE(ArrayObject::Populate(*value, &out, &error)); | 305 EXPECT_TRUE(ArrayObject::Populate(*value, &out, &error)); |
311 EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer", | 306 EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer", |
312 error)); | 307 error)); |
313 EXPECT_EQ(NULL, out.the_array.get()); | 308 EXPECT_EQ(NULL, out.the_array.get()); |
314 | 309 |
315 EXPECT_TRUE(ArrayObject::Populate(*value, &out, &error)); | 310 EXPECT_TRUE(ArrayObject::Populate(*value, &out, &error)); |
316 EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer; " | 311 EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer; " |
317 "'TheArray': expected list, got integer", | 312 "'TheArray': expected list, got integer", |
318 error)); | 313 error)); |
319 EXPECT_EQ(NULL, out.the_array.get()); | 314 EXPECT_EQ(NULL, out.the_array.get()); |
320 } | 315 } |
321 } | 316 } |
322 | 317 |
323 TEST(JsonSchemaCompilerErrorTest, TooManyKeys) { | 318 TEST(JsonSchemaCompilerErrorTest, TooManyKeys) { |
324 { | 319 { |
325 std::unique_ptr<base::DictionaryValue> value = | 320 std::unique_ptr<base::DictionaryValue> value = |
326 Dictionary("string", new base::StringValue("yes")); | 321 Dictionary("string", new base::StringValue("yes")); |
327 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<TestType>(*value))); | 322 EXPECT_TRUE(EqualsUtf16("", GetPopulateError<TestType>(*value))); |
328 } | 323 } |
329 { | 324 { |
330 std::unique_ptr<base::DictionaryValue> value = | 325 std::unique_ptr<base::DictionaryValue> value = |
331 Dictionary("string", new base::StringValue("yes"), "ohno", | 326 Dictionary("string", new base::StringValue("yes"), "ohno", |
332 new base::StringValue("many values")); | 327 new base::StringValue("many values")); |
333 EXPECT_TRUE(EqualsUtf16("found unexpected key 'ohno'", | 328 EXPECT_TRUE(EqualsUtf16("found unexpected key 'ohno'", |
334 GetPopulateError<TestType>(*value))); | 329 GetPopulateError<TestType>(*value))); |
335 } | 330 } |
336 } | 331 } |
OLD | NEW |