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

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

Issue 9456007: Add wider support to json_schema_compiler (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: reupload Created 8 years, 10 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/objects_unittest.cc ('k') | tools/json_schema_compiler/util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/test/simple_api_unittest.cc
diff --git a/tools/json_schema_compiler/test/simple_api_unittest.cc b/tools/json_schema_compiler/test/simple_api_unittest.cc
index b88232ba9ca402f3f54978723da20c9c2896a20d..6cc2832b9aa3d4b430b65b04a781dc0253802a60 100644
--- a/tools/json_schema_compiler/test/simple_api_unittest.cc
+++ b/tools/json_schema_compiler/test/simple_api_unittest.cc
@@ -37,6 +37,23 @@ TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerParamsCreate) {
EXPECT_EQ(6, params->num);
}
+TEST(JsonSchemaCompilerSimpleTest, NumberOfParams) {
+ {
+ scoped_ptr<ListValue> params_value(new ListValue());
+ params_value->Append(Value::CreateStringValue("text"));
+ params_value->Append(Value::CreateStringValue("text"));
+ scoped_ptr<OptionalString::Params> params(
+ OptionalString::Params::Create(*params_value));
+ EXPECT_FALSE(params.get());
+ }
+ {
+ scoped_ptr<ListValue> params_value(new ListValue());
+ scoped_ptr<IncrementInteger::Params> params(
+ IncrementInteger::Params::Create(*params_value));
+ EXPECT_FALSE(params.get());
+ }
+}
+
TEST(JsonSchemaCompilerSimpleTest, OptionalStringParamsCreate) {
{
scoped_ptr<ListValue> params_value(new ListValue());
@@ -97,7 +114,7 @@ TEST(JsonSchemaCompilerSimpleTest, TestTypePopulate) {
{
scoped_ptr<TestType> test_type(new TestType());
scoped_ptr<DictionaryValue> value = CreateTestTypeDictionary();
- value->RemoveWithoutPathExpansion("number", NULL);
+ value->Remove("number", NULL);
EXPECT_FALSE(TestType::Populate(*value, test_type.get()));
}
}
« no previous file with comments | « tools/json_schema_compiler/test/objects_unittest.cc ('k') | tools/json_schema_compiler/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698