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

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

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error Created 3 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
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/fuzzer.cc ('k') | tools/json_schema_compiler/test/error_generation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/fuzzer.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