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

Unified Diff: tools/json_schema_compiler/test/enums_unittest.cc

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added more testing for event compilation. Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/json_schema_compiler/test/enums.json ('k') | tools/json_schema_compiler/test/objects.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/test/enums_unittest.cc
diff --git a/tools/json_schema_compiler/test/enums_unittest.cc b/tools/json_schema_compiler/test/enums_unittest.cc
index 14eece27c1dbfb587de45bf3be88953460945765..2b0657a079a9774934744d1f87ef1b0cd682d518 100644
--- a/tools/json_schema_compiler/test/enums_unittest.cc
+++ b/tools/json_schema_compiler/test/enums_unittest.cc
@@ -25,6 +25,23 @@ TEST(JsonSchemaCompilerEnumsTest, EnumTypePopulate) {
}
}
+TEST(JsonSchemaCompilerEnumsTest, ReturnsEnumCreate) {
+ {
+ ReturnsEnum::Result::State state = ReturnsEnum::Result::STATE_FOO;
+ scoped_ptr<Value> state_value = ReturnsEnum::Result::CreateEnumValue(state);
+ std::string result;
+ state_value->GetAsString(&result);
+ EXPECT_EQ("foo", result);
+ }
+ {
+ ReturnsEnum::Result::State state = ReturnsEnum::Result::STATE_FOO;
+ scoped_ptr<Value> state_value(ReturnsEnum::Result::Create(state));
+ std::string result;
+ state_value->GetAsString(&result);
+ EXPECT_EQ("foo", result);
+ }
+}
+
TEST(JsonSchemaCompilerEnumsTest, OptionalEnumTypePopulate) {
{
scoped_ptr<OptionalEnumType> enum_type(new OptionalEnumType());
@@ -129,3 +146,8 @@ TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) {
EXPECT_FALSE(params.get());
}
}
+
+TEST(JsonSchemaCompilerEnumsTest, OnEnumFiredCreate) {
Matt Tytel 2012/06/29 01:15:52 Erp. Fixing.
+ {
+ }
+}
« no previous file with comments | « tools/json_schema_compiler/test/enums.json ('k') | tools/json_schema_compiler/test/objects.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698