| Index: tools/json_schema_compiler/test/choices_unittest.cc
|
| diff --git a/tools/json_schema_compiler/test/choices_unittest.cc b/tools/json_schema_compiler/test/choices_unittest.cc
|
| index 35ec22984cf4e86e2faaa90845ca6d6c9c057a27..035695a08cd5bf14c97a58f38ef94122e4f79b24 100644
|
| --- a/tools/json_schema_compiler/test/choices_unittest.cc
|
| +++ b/tools/json_schema_compiler/test/choices_unittest.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include <utility>
|
|
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/strings/string_piece.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "tools/json_schema_compiler/test/test_util.h"
|
| @@ -47,7 +48,8 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreate) {
|
| {
|
| std::unique_ptr<ObjectWithChoices::Params> params(
|
| ObjectWithChoices::Params::Create(
|
| - *List(Dictionary("strings", new base::Value("asdf")).release())));
|
| + *List(Dictionary("strings", base::MakeUnique<base::Value>("asdf"))
|
| + .release())));
|
| ASSERT_TRUE(params);
|
| EXPECT_FALSE(params->string_info.strings.as_strings);
|
| EXPECT_EQ("asdf", *params->string_info.strings.as_string);
|
| @@ -56,8 +58,8 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreate) {
|
| {
|
| std::unique_ptr<ObjectWithChoices::Params> params(
|
| ObjectWithChoices::Params::Create(
|
| - *List(Dictionary("strings", new base::Value("asdf"), "integers",
|
| - new base::Value(6))
|
| + *List(Dictionary("strings", base::MakeUnique<base::Value>("asdf"),
|
| + "integers", base::MakeUnique<base::Value>(6))
|
| .release())));
|
| ASSERT_TRUE(params);
|
| EXPECT_FALSE(params->string_info.strings.as_strings);
|
| @@ -75,7 +77,7 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) {
|
| {
|
| std::unique_ptr<base::DictionaryValue> object_param(
|
| new base::DictionaryValue());
|
| - object_param->SetWithoutPathExpansion("strings", new base::Value(5));
|
| + object_param->SetIntegerWithoutPathExpansion("strings", 5);
|
| std::unique_ptr<base::ListValue> params_value(new base::ListValue());
|
| params_value->Append(std::move(object_param));
|
| std::unique_ptr<ObjectWithChoices::Params> params(
|
| @@ -85,8 +87,8 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) {
|
| {
|
| std::unique_ptr<base::DictionaryValue> object_param(
|
| new base::DictionaryValue());
|
| - object_param->SetWithoutPathExpansion("strings", new base::Value("asdf"));
|
| - object_param->SetWithoutPathExpansion("integers", new base::Value("asdf"));
|
| + object_param->SetStringWithoutPathExpansion("strings", "asdf");
|
| + object_param->SetStringWithoutPathExpansion("integers", "asdf");
|
| std::unique_ptr<base::ListValue> params_value(new base::ListValue());
|
| params_value->Append(std::move(object_param));
|
| std::unique_ptr<ObjectWithChoices::Params> params(
|
| @@ -96,7 +98,7 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) {
|
| {
|
| std::unique_ptr<base::DictionaryValue> object_param(
|
| new base::DictionaryValue());
|
| - object_param->SetWithoutPathExpansion("integers", new base::Value(6));
|
| + object_param->SetIntegerWithoutPathExpansion("integers", 6);
|
| std::unique_ptr<base::ListValue> params_value(new base::ListValue());
|
| params_value->Append(std::move(object_param));
|
| std::unique_ptr<ObjectWithChoices::Params> params(
|
|
|