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

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

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> Created 4 years, 8 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/objects_unittest.cc
diff --git a/tools/json_schema_compiler/test/objects_unittest.cc b/tools/json_schema_compiler/test/objects_unittest.cc
index 5c00926b69ea9f089b5e75a76c0692fd37d20185..fffaff15d8f9634a550a8ff2c6d41549aa35629b 100644
--- a/tools/json_schema_compiler/test/objects_unittest.cc
+++ b/tools/json_schema_compiler/test/objects_unittest.cc
@@ -16,17 +16,18 @@ using namespace test::api::objects_movable_json;
TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
{
- scoped_ptr<base::ListValue> strings(new base::ListValue());
+ std::unique_ptr<base::ListValue> strings(new base::ListValue());
strings->Append(new base::StringValue("one"));
strings->Append(new base::StringValue("two"));
- scoped_ptr<base::DictionaryValue> info_value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> info_value(
+ new base::DictionaryValue());
info_value->Set("strings", strings.release());
info_value->Set("integer", new base::FundamentalValue(5));
info_value->Set("boolean", new base::FundamentalValue(true));
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ std::unique_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(info_value.release());
- scoped_ptr<ObjectParam::Params> params(
+ std::unique_ptr<ObjectParam::Params> params(
ObjectParam::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_EQ((size_t) 2, params->info.strings.size());
@@ -36,16 +37,17 @@ TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
EXPECT_TRUE(params->info.boolean);
}
{
- scoped_ptr<base::ListValue> strings(new base::ListValue());
+ std::unique_ptr<base::ListValue> strings(new base::ListValue());
strings->Append(new base::StringValue("one"));
strings->Append(new base::StringValue("two"));
- scoped_ptr<base::DictionaryValue> info_value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> info_value(
+ new base::DictionaryValue());
info_value->Set("strings", strings.release());
info_value->Set("integer", new base::FundamentalValue(5));
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ std::unique_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(info_value.release());
- scoped_ptr<ObjectParam::Params> params(
+ std::unique_ptr<ObjectParam::Params> params(
ObjectParam::Params::Create(*params_value));
EXPECT_FALSE(params.get());
}
@@ -54,7 +56,8 @@ TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
TEST(JsonSchemaCompilerObjectsTest, ReturnsObjectResultCreate) {
ReturnsObject::Results::Info info;
info.state = FIRST_STATE_FOO;
- scoped_ptr<base::ListValue> results = ReturnsObject::Results::Create(info);
+ std::unique_ptr<base::ListValue> results =
+ ReturnsObject::Results::Create(info);
base::DictionaryValue expected;
expected.SetString("state", "foo");
@@ -66,7 +69,7 @@ TEST(JsonSchemaCompilerObjectsTest, ReturnsObjectResultCreate) {
TEST(JsonSchemaCompilerObjectsTest, OnObjectFiredCreate) {
OnObjectFired::SomeObject object;
object.state = FIRST_STATE_BAR;
- scoped_ptr<base::ListValue> results(OnObjectFired::Create(object));
+ std::unique_ptr<base::ListValue> results(OnObjectFired::Create(object));
base::DictionaryValue expected;
expected.SetString("state", "bar");
« no previous file with comments | « tools/json_schema_compiler/test/idl_schemas_unittest.cc ('k') | tools/json_schema_compiler/test/simple_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698