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

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

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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/enums_unittest.cc
diff --git a/tools/json_schema_compiler/test/enums_unittest.cc b/tools/json_schema_compiler/test/enums_unittest.cc
index d5ba3250a0d3d7961684c1014bc4c1b452ca7e58..5318981ba224f9388562015673de5c2b1aa9b005 100644
--- a/tools/json_schema_compiler/test/enums_unittest.cc
+++ b/tools/json_schema_compiler/test/enums_unittest.cc
@@ -14,7 +14,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumTypePopulate) {
{
EnumType enum_type;
base::DictionaryValue value;
- value.Set("type", new base::StringValue("one"));
+ value.Set("type", new base::Value("one"));
EXPECT_TRUE(EnumType::Populate(value, &enum_type));
EXPECT_EQ(ENUMERATION_ONE, enum_type.type);
EXPECT_TRUE(value.Equals(enum_type.ToValue().get()));
@@ -22,7 +22,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumTypePopulate) {
{
EnumType enum_type;
base::DictionaryValue value;
- value.Set("type", new base::StringValue("invalid"));
+ value.Set("type", new base::Value("invalid"));
EXPECT_FALSE(EnumType::Populate(value, &enum_type));
}
}
@@ -50,11 +50,11 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) {
base::DictionaryValue value;
ASSERT_FALSE(HasEnumeration::Populate(value, &enumeration));
- value.Set("enumeration", new base::StringValue("one"));
+ value.Set("enumeration", new base::Value("one"));
ASSERT_TRUE(HasEnumeration::Populate(value, &enumeration));
EXPECT_TRUE(value.Equals(enumeration.ToValue().get()));
- value.Set("optional_enumeration", new base::StringValue("two"));
+ value.Set("optional_enumeration", new base::Value("two"));
ASSERT_TRUE(HasEnumeration::Populate(value, &enumeration));
EXPECT_TRUE(value.Equals(enumeration.ToValue().get()));
}
@@ -63,7 +63,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) {
base::DictionaryValue value;
ASSERT_FALSE(ReferenceEnum::Populate(value, &enumeration));
- value.Set("reference_enum", new base::StringValue("one"));
+ value.Set("reference_enum", new base::Value("one"));
ASSERT_TRUE(ReferenceEnum::Populate(value, &enumeration));
EXPECT_TRUE(value.Equals(enumeration.ToValue().get()));
}
@@ -72,8 +72,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsAsTypes) {
TEST(JsonSchemaCompilerEnumsTest, EnumsArrayAsType) {
{
base::ListValue params_value;
- params_value.Append(
- List(new base::StringValue("one"), new base::StringValue("two")));
+ params_value.Append(List(new base::Value("one"), new base::Value("two")));
std::unique_ptr<TakesEnumArrayAsType::Params> params(
TakesEnumArrayAsType::Params::Create(params_value));
ASSERT_TRUE(params);
@@ -83,7 +82,7 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsArrayAsType) {
}
{
base::ListValue params_value;
- params_value.Append(List(new base::StringValue("invalid")));
+ params_value.Append(List(new base::Value("invalid")));
std::unique_ptr<TakesEnumArrayAsType::Params> params(
TakesEnumArrayAsType::Params::Create(params_value));
EXPECT_FALSE(params);
@@ -93,8 +92,8 @@ TEST(JsonSchemaCompilerEnumsTest, EnumsArrayAsType) {
TEST(JsonSchemaCompilerEnumsTest, ReturnsEnumCreate) {
{
Enumeration state = ENUMERATION_ONE;
- std::unique_ptr<base::Value> result(new base::StringValue(ToString(state)));
- std::unique_ptr<base::Value> expected(new base::StringValue("one"));
+ std::unique_ptr<base::Value> result(new base::Value(ToString(state)));
+ std::unique_ptr<base::Value> expected(new base::Value("one"));
EXPECT_TRUE(result->Equals(expected.get()));
}
{
@@ -122,7 +121,7 @@ TEST(JsonSchemaCompilerEnumsTest, OptionalEnumTypePopulate) {
{
OptionalEnumType enum_type;
base::DictionaryValue value;
- value.Set("type", new base::StringValue("two"));
+ value.Set("type", new base::Value("two"));
EXPECT_TRUE(OptionalEnumType::Populate(value, &enum_type));
EXPECT_EQ(ENUMERATION_TWO, enum_type.type);
EXPECT_TRUE(value.Equals(enum_type.ToValue().get()));
@@ -137,7 +136,7 @@ TEST(JsonSchemaCompilerEnumsTest, OptionalEnumTypePopulate) {
{
OptionalEnumType enum_type;
base::DictionaryValue value;
- value.Set("type", new base::StringValue("invalid"));
+ value.Set("type", new base::Value("invalid"));
EXPECT_FALSE(OptionalEnumType::Populate(value, &enum_type));
}
}
@@ -163,8 +162,7 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumParamsCreate) {
TEST(JsonSchemaCompilerEnumsTest, TakesEnumArrayParamsCreate) {
{
base::ListValue params_value;
- params_value.Append(
- List(new base::StringValue("one"), new base::StringValue("two")));
+ params_value.Append(List(new base::Value("one"), new base::Value("two")));
std::unique_ptr<TakesEnumArray::Params> params(
TakesEnumArray::Params::Create(params_value));
ASSERT_TRUE(params);
@@ -174,7 +172,7 @@ TEST(JsonSchemaCompilerEnumsTest, TakesEnumArrayParamsCreate) {
}
{
base::ListValue params_value;
- params_value.Append(List(new base::StringValue("invalid")));
+ params_value.Append(List(new base::Value("invalid")));
std::unique_ptr<TakesEnumArray::Params> params(
TakesEnumArray::Params::Create(params_value));
EXPECT_FALSE(params);
@@ -247,9 +245,8 @@ TEST(JsonSchemaCompilerEnumsTest, TakesMultipleOptionalEnumsParamsCreate) {
TEST(JsonSchemaCompilerEnumsTest, OnEnumFiredCreate) {
{
Enumeration some_enum = ENUMERATION_ONE;
- std::unique_ptr<base::Value> result(
- new base::StringValue(ToString(some_enum)));
- std::unique_ptr<base::Value> expected(new base::StringValue("one"));
+ std::unique_ptr<base::Value> result(new base::Value(ToString(some_enum)));
+ std::unique_ptr<base::Value> expected(new base::Value("one"));
EXPECT_TRUE(result->Equals(expected.get()));
}
{
« no previous file with comments | « tools/json_schema_compiler/test/crossref_unittest.cc ('k') | tools/json_schema_compiler/test/error_generation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698