| Index: tools/json_schema_compiler/test/error_generation_unittest.cc
|
| diff --git a/tools/json_schema_compiler/test/error_generation_unittest.cc b/tools/json_schema_compiler/test/error_generation_unittest.cc
|
| index 5c3f1b800e344aed7e526e0875b03e74a8d8c469..ec8f3c426154fcca5ea8e1cd9886ed1eb80629b2 100644
|
| --- a/tools/json_schema_compiler/test/error_generation_unittest.cc
|
| +++ b/tools/json_schema_compiler/test/error_generation_unittest.cc
|
| @@ -10,7 +10,7 @@
|
| #include "tools/json_schema_compiler/test/test_util.h"
|
|
|
| using namespace test::api::error_generation;
|
| -using base::FundamentalValue;
|
| +using base::Value;
|
| using json_schema_compiler::test_util::Dictionary;
|
| using json_schema_compiler::test_util::List;
|
|
|
| @@ -63,7 +63,7 @@ TEST(JsonSchemaCompilerErrorTest, UnexpectedTypePopulation) {
|
| TEST(JsonSchemaCompilerErrorTest, TypeIsRequired) {
|
| {
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("integers", new FundamentalValue(5));
|
| + Dictionary("integers", new Value(5));
|
| EXPECT_TRUE(EqualsUtf16("", GetPopulateError<ChoiceType>(*value)));
|
| }
|
| {
|
| @@ -78,13 +78,13 @@ TEST(JsonSchemaCompilerErrorTest, TypeIsRequired) {
|
| TEST(JsonSchemaCompilerErrorTest, TooManyParameters) {
|
| {
|
| std::unique_ptr<base::ListValue> params_value =
|
| - List(new FundamentalValue(5));
|
| + List(new Value(5));
|
| base::string16 error;
|
| EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error));
|
| }
|
| {
|
| std::unique_ptr<base::ListValue> params_value =
|
| - List(new FundamentalValue(5), new FundamentalValue(5));
|
| + List(new Value(5), new Value(5));
|
| base::string16 error;
|
| EXPECT_FALSE(TestFunction::Params::Create(*params_value, &error));
|
| EXPECT_TRUE(EqualsUtf16("expected 1 arguments, got 2", error));
|
| @@ -96,7 +96,7 @@ TEST(JsonSchemaCompilerErrorTest, TooManyParameters) {
|
| TEST(JsonSchemaCompilerErrorTest, ParamIsRequired) {
|
| {
|
| std::unique_ptr<base::ListValue> params_value =
|
| - List(new FundamentalValue(5));
|
| + List(new Value(5));
|
| base::string16 error;
|
| EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error));
|
| }
|
| @@ -119,7 +119,7 @@ TEST(JsonSchemaCompilerErrorTest, WrongPropertyValueType) {
|
| }
|
| {
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("string", new FundamentalValue(1.1));
|
| + Dictionary("string", new Value(1.1));
|
| EXPECT_TRUE(EqualsUtf16("'string': expected string, got double",
|
| GetPopulateError<TestType>(*value)));
|
| }
|
| @@ -134,7 +134,7 @@ TEST(JsonSchemaCompilerErrorTest, WrongParameterCreationType) {
|
| }
|
| {
|
| std::unique_ptr<base::ListValue> params_value =
|
| - List(new FundamentalValue(5));
|
| + List(new Value(5));
|
| base::string16 error;
|
| EXPECT_FALSE(TestTypeInObject::Params::Create(*params_value, &error));
|
| EXPECT_TRUE(EqualsUtf16("'paramObject': expected dictionary, got integer",
|
| @@ -149,7 +149,7 @@ TEST(JsonSchemaCompilerErrorTest, WrongTypeValueType) {
|
| }
|
| {
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("otherType", new FundamentalValue(1.1));
|
| + Dictionary("otherType", new Value(1.1));
|
| ObjectType out;
|
| base::string16 error;
|
| EXPECT_TRUE(ObjectType::Populate(*value, &out, &error));
|
| @@ -162,13 +162,13 @@ TEST(JsonSchemaCompilerErrorTest, WrongTypeValueType) {
|
| TEST(JsonSchemaCompilerErrorTest, UnableToPopulateArray) {
|
| {
|
| std::unique_ptr<base::ListValue> params_value =
|
| - List(new FundamentalValue(5));
|
| + List(new Value(5));
|
| EXPECT_TRUE(EqualsUtf16("",
|
| GetPopulateError<ChoiceType::Integers>(*params_value)));
|
| }
|
| {
|
| std::unique_ptr<base::ListValue> params_value =
|
| - List(new FundamentalValue(5), new FundamentalValue(false));
|
| + List(new Value(5), new Value(false));
|
| EXPECT_TRUE(EqualsUtf16(
|
| "expected integer, got boolean; unable to populate array 'integers'",
|
| GetPopulateError<ChoiceType::Integers>(*params_value)));
|
| @@ -183,7 +183,7 @@ TEST(JsonSchemaCompilerErrorTest, BinaryTypeExpected) {
|
| }
|
| {
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("data", new FundamentalValue(1.1));
|
| + Dictionary("data", new Value(1.1));
|
| EXPECT_TRUE(EqualsUtf16("'data': expected binary, got double",
|
| GetPopulateError<BinaryData>(*value)));
|
| }
|
| @@ -197,7 +197,7 @@ TEST(JsonSchemaCompilerErrorTest, ListExpected) {
|
| }
|
| {
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("TheArray", new FundamentalValue(5));
|
| + Dictionary("TheArray", new Value(5));
|
| EXPECT_TRUE(EqualsUtf16("'TheArray': expected list, got integer",
|
| GetPopulateError<ArrayObject>(*value)));
|
| }
|
| @@ -230,7 +230,7 @@ TEST(JsonSchemaCompilerErrorTest, WarnOnOptionalFailure) {
|
| }
|
| {
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("string", new base::FundamentalValue(1));
|
| + Dictionary("string", new base::Value(1));
|
|
|
| OptionalTestType out;
|
| base::string16 error;
|
| @@ -250,7 +250,7 @@ TEST(JsonSchemaCompilerErrorTest, OptionalBinaryTypeFailure) {
|
| {
|
| // There's a bug with silent failures if the key doesn't exist.
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("data", new base::FundamentalValue(1));
|
| + Dictionary("data", new base::Value(1));
|
|
|
| OptionalBinaryData out;
|
| base::string16 error;
|
| @@ -269,7 +269,7 @@ TEST(JsonSchemaCompilerErrorTest, OptionalArrayTypeFailure) {
|
| }
|
| {
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("TheArray", new FundamentalValue(5));
|
| + Dictionary("TheArray", new Value(5));
|
| ArrayObject out;
|
| base::string16 error;
|
| EXPECT_TRUE(ArrayObject::Populate(*value, &out, &error));
|
| @@ -282,13 +282,13 @@ TEST(JsonSchemaCompilerErrorTest, OptionalArrayTypeFailure) {
|
| TEST(JsonSchemaCompilerErrorTest, OptionalUnableToPopulateArray) {
|
| {
|
| std::unique_ptr<base::ListValue> params_value =
|
| - List(new FundamentalValue(5));
|
| + List(new Value(5));
|
| EXPECT_TRUE(EqualsUtf16("",
|
| GetPopulateError<OptionalChoiceType::Integers>(*params_value)));
|
| }
|
| {
|
| std::unique_ptr<base::ListValue> params_value =
|
| - List(new FundamentalValue(5), new FundamentalValue(false));
|
| + List(new Value(5), new Value(false));
|
| OptionalChoiceType::Integers out;
|
| base::string16 error;
|
| EXPECT_TRUE(OptionalChoiceType::Integers::Populate(*params_value, &out,
|
| @@ -303,7 +303,7 @@ TEST(JsonSchemaCompilerErrorTest, OptionalUnableToPopulateArray) {
|
| TEST(JsonSchemaCompilerErrorTest, MultiplePopulationErrors) {
|
| {
|
| std::unique_ptr<base::DictionaryValue> value =
|
| - Dictionary("TheArray", new FundamentalValue(5));
|
| + Dictionary("TheArray", new Value(5));
|
| ArrayObject out;
|
| base::string16 error;
|
| EXPECT_TRUE(ArrayObject::Populate(*value, &out, &error));
|
|
|