Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: tools/json_schema_compiler/test/enums_unittest.cc

Issue 10907151: Extensions Docs Server: Enum values do not show up if enum is a type (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/enums.h" 5 #include "tools/json_schema_compiler/test/enums.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::enums; 9 using namespace test::api::enums;
10 10
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) { 28 TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) {
29 { 29 {
30 ListValue args; 30 ListValue args;
31 args.Append(Value::CreateStringValue("one")); 31 args.Append(Value::CreateStringValue("one"));
32 32
33 scoped_ptr<TakesEnumAsType::Params> params( 33 scoped_ptr<TakesEnumAsType::Params> params(
34 TakesEnumAsType::Params::Create(args)); 34 TakesEnumAsType::Params::Create(args));
35 ASSERT_TRUE(params.get()); 35 ASSERT_TRUE(params.get());
36 EXPECT_EQ(ENUMERATION_ONE, params->enumeration); 36 EXPECT_EQ(ENUMS_ENUMERATION_ONE, params->enumeration);
37 37
38 EXPECT_TRUE(args.Equals(ReturnsEnumAsType::Results::Create( 38 EXPECT_TRUE(args.Equals(ReturnsEnumAsType::Results::Create(
39 ENUMERATION_ONE).get())); 39 ENUMS_ENUMERATION_ONE).get()));
40 } 40 }
41 { 41 {
42 HasEnumeration enumeration; 42 HasEnumeration enumeration;
43 DictionaryValue value; 43 DictionaryValue value;
44 ASSERT_FALSE(HasEnumeration::Populate(value, &enumeration)); 44 ASSERT_FALSE(HasEnumeration::Populate(value, &enumeration));
45 45
46 value.Set("enumeration", Value::CreateStringValue("one")); 46 value.Set("enumeration", Value::CreateStringValue("one"));
47 ASSERT_TRUE(HasEnumeration::Populate(value, &enumeration)); 47 ASSERT_TRUE(HasEnumeration::Populate(value, &enumeration));
48 EXPECT_TRUE(value.Equals(enumeration.ToValue().get())); 48 EXPECT_TRUE(value.Equals(enumeration.ToValue().get()));
49 49
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 { 206 {
207 scoped_ptr<Value> results(OnTwoEnumsFired::Create( 207 scoped_ptr<Value> results(OnTwoEnumsFired::Create(
208 OnTwoEnumsFired::FIRST_ENUM_FOO, 208 OnTwoEnumsFired::FIRST_ENUM_FOO,
209 OnTwoEnumsFired::SECOND_ENUM_HAM)); 209 OnTwoEnumsFired::SECOND_ENUM_HAM));
210 ListValue expected; 210 ListValue expected;
211 expected.Append(Value::CreateStringValue("foo")); 211 expected.Append(Value::CreateStringValue("foo"));
212 expected.Append(Value::CreateStringValue("ham")); 212 expected.Append(Value::CreateStringValue("ham"));
213 EXPECT_TRUE(results->Equals(&expected)); 213 EXPECT_TRUE(results->Equals(&expected));
214 } 214 }
215 } 215 }
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/enums.json ('k') | tools/json_schema_compiler/test/font_settings.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698