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

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

Issue 2036013002: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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.cc » ('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 3c2baa3974884cc307233c1f30cd771f79dd5d98..995fea65268aaa36adc132db348ef3bdc9c99306 100644
--- a/tools/json_schema_compiler/test/simple_api_unittest.cc
+++ b/tools/json_schema_compiler/test/simple_api_unittest.cc
@@ -25,13 +25,13 @@ TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerResultCreate) {
std::unique_ptr<base::ListValue> results =
IncrementInteger::Results::Create(5);
base::ListValue expected;
- expected.Append(new base::FundamentalValue(5));
+ expected.AppendInteger(5);
EXPECT_TRUE(results->Equals(&expected));
}
TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerParamsCreate) {
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(new base::FundamentalValue(6));
+ params_value->AppendInteger(6);
std::unique_ptr<IncrementInteger::Params> params(
IncrementInteger::Params::Create(*params_value));
EXPECT_TRUE(params.get());
@@ -41,8 +41,8 @@ TEST(JsonSchemaCompilerSimpleTest, IncrementIntegerParamsCreate) {
TEST(JsonSchemaCompilerSimpleTest, NumberOfParams) {
{
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(new base::StringValue("text"));
- params_value->Append(new base::StringValue("text"));
+ params_value->AppendString("text");
+ params_value->AppendString("text");
std::unique_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_FALSE(params.get());
@@ -65,7 +65,7 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalStringParamsCreate) {
}
{
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(new base::StringValue("asdf"));
+ params_value->AppendString("asdf");
std::unique_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_TRUE(params.get());
@@ -88,7 +88,7 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalParamsTakingNull) {
TEST(JsonSchemaCompilerSimpleTest, OptionalStringParamsWrongType) {
{
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(new base::FundamentalValue(5));
+ params_value->AppendInteger(5);
std::unique_ptr<OptionalString::Params> params(
OptionalString::Params::Create(*params_value));
EXPECT_FALSE(params.get());
@@ -99,7 +99,7 @@ TEST(JsonSchemaCompilerSimpleTest, OptionalBeforeRequired) {
{
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(base::Value::CreateNullValue());
- params_value->Append(new base::StringValue("asdf"));
+ params_value->AppendString("asdf");
std::unique_ptr<OptionalBeforeRequired::Params> params(
OptionalBeforeRequired::Params::Create(*params_value));
EXPECT_TRUE(params.get());
@@ -151,7 +151,7 @@ TEST(JsonSchemaCompilerSimpleTest, OnIntegerFiredCreate) {
{
std::unique_ptr<base::ListValue> results(OnIntegerFired::Create(5));
base::ListValue expected;
- expected.Append(new base::FundamentalValue(5));
+ expected.AppendInteger(5);
EXPECT_TRUE(results->Equals(&expected));
}
}
@@ -160,7 +160,7 @@ TEST(JsonSchemaCompilerSimpleTest, OnStringFiredCreate) {
{
std::unique_ptr<base::ListValue> results(OnStringFired::Create("yo dawg"));
base::ListValue expected;
- expected.Append(new base::StringValue("yo dawg"));
+ expected.AppendString("yo dawg");
EXPECT_TRUE(results->Equals(&expected));
}
}
« no previous file with comments | « tools/json_schema_compiler/test/objects_unittest.cc ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698