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

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

Issue 10701012: JSON Schema Compiler: Added event compilation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Synced. 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
Index: tools/json_schema_compiler/test/objects_unittest.cc
diff --git a/tools/json_schema_compiler/test/objects_unittest.cc b/tools/json_schema_compiler/test/objects_unittest.cc
index b0ed54f1ceaf32d22635701e086d1dd7b514e933..7db6f7ad9aad79cf3e7f310a80ead50ee2fcea1b 100644
--- a/tools/json_schema_compiler/test/objects_unittest.cc
+++ b/tools/json_schema_compiler/test/objects_unittest.cc
@@ -52,8 +52,20 @@ TEST(JsonSchemaCompilerObjectsTest, ReturnsObjectResultCreate) {
scoped_ptr<Value> result_value(
ReturnsObject::Result::Create(*info));
DictionaryValue* result_dict = NULL;
- EXPECT_TRUE(result_value->GetAsDictionary(&result_dict));
+ ASSERT_TRUE(result_value->GetAsDictionary(&result_dict));
std::string state;
EXPECT_TRUE(result_dict->GetString("state", &state));
EXPECT_EQ("foo", state);
}
+
+TEST(JsonSchemaCompilerObjectsTest, OnObjectFiredCreate) {
+ OnObjectFired::SomeObject object;
+ object.state = OnObjectFired::SomeObject::STATE_BAR;
+ scoped_ptr<Value> result_value(OnObjectFired::Create(object));
+
+ DictionaryValue* result_dict = NULL;
+ ASSERT_TRUE(result_value->GetAsDictionary(&result_dict));
+ std::string state;
+ EXPECT_TRUE(result_dict->GetString("state", &state));
+ EXPECT_EQ("bar", state);
not at google - send to devlin 2012/07/03 14:21:39 Another alternative to this is to build up the exp
+}

Powered by Google App Engine
This is Rietveld 408576698