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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 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
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 73fcfdcad47c322bd35feaa66e2fb6fbd41ec423..7812be629093cbf4b2b7a8458375c39f8606c28e 100644
--- a/tools/json_schema_compiler/test/error_generation_unittest.cc
+++ b/tools/json_schema_compiler/test/error_generation_unittest.cc
@@ -11,7 +11,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;
@@ -64,7 +64,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,14 +78,13 @@ TEST(JsonSchemaCompilerErrorTest, TypeIsRequired) {
TEST(JsonSchemaCompilerErrorTest, TooManyParameters) {
{
- std::unique_ptr<base::ListValue> params_value =
- List(new FundamentalValue(5));
+ std::unique_ptr<base::ListValue> params_value = 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,8 +95,7 @@ TEST(JsonSchemaCompilerErrorTest, TooManyParameters) {
TEST(JsonSchemaCompilerErrorTest, ParamIsRequired) {
{
- std::unique_ptr<base::ListValue> params_value =
- List(new FundamentalValue(5));
+ std::unique_ptr<base::ListValue> params_value = List(new Value(5));
base::string16 error;
EXPECT_TRUE(TestFunction::Params::Create(*params_value, &error));
}
@@ -120,7 +118,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,8 +132,7 @@ TEST(JsonSchemaCompilerErrorTest, WrongParameterCreationType) {
EXPECT_TRUE(TestString::Params::Create(*params_value, &error));
}
{
- std::unique_ptr<base::ListValue> params_value =
- List(new FundamentalValue(5));
+ std::unique_ptr<base::ListValue> params_value = List(new Value(5));
base::string16 error;
EXPECT_FALSE(TestTypeInObject::Params::Create(*params_value, &error));
EXPECT_TRUE(EqualsUtf16("'paramObject': expected dictionary, got integer",
@@ -150,7 +147,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,14 +159,13 @@ TEST(JsonSchemaCompilerErrorTest, WrongTypeValueType) {
TEST(JsonSchemaCompilerErrorTest, UnableToPopulateArray) {
{
- std::unique_ptr<base::ListValue> params_value =
- List(new FundamentalValue(5));
+ std::unique_ptr<base::ListValue> params_value = 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)));
@@ -184,7 +180,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)));
}
@@ -198,7 +194,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)));
}
@@ -231,7 +227,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;
@@ -251,7 +247,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;
@@ -270,7 +266,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,14 +278,13 @@ TEST(JsonSchemaCompilerErrorTest, OptionalArrayTypeFailure) {
TEST(JsonSchemaCompilerErrorTest, OptionalUnableToPopulateArray) {
{
- std::unique_ptr<base::ListValue> params_value =
- List(new FundamentalValue(5));
+ std::unique_ptr<base::ListValue> params_value = 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,
@@ -304,7 +299,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));
« no previous file with comments | « tools/json_schema_compiler/test/crossref_unittest.cc ('k') | tools/json_schema_compiler/test/idl_schemas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698