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

Unified Diff: components/json_schema/json_schema_validator_unittest_base.cc

Issue 2792573002: Remove base::Value::CreateNullValue (Closed)
Patch Set: Rebase 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
Index: components/json_schema/json_schema_validator_unittest_base.cc
diff --git a/components/json_schema/json_schema_validator_unittest_base.cc b/components/json_schema/json_schema_validator_unittest_base.cc
index 1208c12bb424cea7ac5542a0af00711672d4f706..d96544c31d258e6e03beaefd6d6c585960ecaddb 100644
--- a/components/json_schema/json_schema_validator_unittest_base.cc
+++ b/components/json_schema/json_schema_validator_unittest_base.cc
@@ -152,7 +152,7 @@ void JSONSchemaValidatorTestBase::TestEnum() {
ExpectNotValid(
TEST_SOURCE, std::unique_ptr<base::Value>(new base::Value("42")).get(),
schema.get(), NULL, std::string(), JSONSchemaValidator::kInvalidEnum);
- ExpectNotValid(TEST_SOURCE, base::Value::CreateNullValue().get(),
+ ExpectNotValid(TEST_SOURCE, base::MakeUnique<base::Value>().get(),
schema.get(), NULL, std::string(),
JSONSchemaValidator::kInvalidEnum);
}
@@ -161,7 +161,7 @@ void JSONSchemaValidatorTestBase::TestChoices() {
std::unique_ptr<base::DictionaryValue> schema(
LoadDictionary("choices_schema.json"));
- ExpectValid(TEST_SOURCE, base::Value::CreateNullValue().get(), schema.get(),
+ ExpectValid(TEST_SOURCE, base::MakeUnique<base::Value>().get(), schema.get(),
NULL);
ExpectValid(TEST_SOURCE,
std::unique_ptr<base::Value>(new base::Value(42)).get(),
@@ -286,7 +286,7 @@ void JSONSchemaValidatorTestBase::TestObject() {
ExpectValid(TEST_SOURCE, instance.get(), schema.get(), NULL);
instance->Remove("bar", NULL);
ExpectValid(TEST_SOURCE, instance.get(), schema.get(), NULL);
- instance->Set("bar", base::Value::CreateNullValue());
+ instance->Set("bar", base::MakeUnique<base::Value>());
ExpectNotValid(TEST_SOURCE, instance.get(), schema.get(), NULL,
"bar", JSONSchemaValidator::FormatErrorMessage(
JSONSchemaValidator::kInvalidType,
@@ -433,7 +433,7 @@ void JSONSchemaValidatorTestBase::TestArrayTuple() {
ExpectValid(TEST_SOURCE, instance.get(), schema.get(), NULL);
// TODO(aa): I think this is inconsistent with the handling of NULL+optional
// for objects.
- instance->Set(0, base::Value::CreateNullValue());
+ instance->Set(0, base::MakeUnique<base::Value>());
ExpectValid(TEST_SOURCE, instance.get(), schema.get(), NULL);
instance->Set(0, new base::Value(42));
ExpectNotValid(TEST_SOURCE, instance.get(), schema.get(), NULL, "0",
@@ -604,7 +604,7 @@ void JSONSchemaValidatorTestBase::TestTypeClassifier() {
std::unique_ptr<base::Value>(new base::DictionaryValue()).get()));
EXPECT_EQ(std::string(schema::kNull),
JSONSchemaValidator::GetJSONSchemaType(
- base::Value::CreateNullValue().get()));
+ base::MakeUnique<base::Value>().get()));
}
void JSONSchemaValidatorTestBase::TestTypes() {
@@ -670,7 +670,7 @@ void JSONSchemaValidatorTestBase::TestTypes() {
schema.get(), NULL);
schema->SetString(schema::kType, schema::kNull);
- ExpectValid(TEST_SOURCE, base::Value::CreateNullValue().get(), schema.get(),
+ ExpectValid(TEST_SOURCE, base::MakeUnique<base::Value>().get(), schema.get(),
NULL);
// not valid
@@ -683,7 +683,7 @@ void JSONSchemaValidatorTestBase::TestTypes() {
schema->SetString(schema::kType, schema::kObject);
ExpectNotValid(
- TEST_SOURCE, base::Value::CreateNullValue().get(), schema.get(), NULL,
+ TEST_SOURCE, base::MakeUnique<base::Value>().get(), schema.get(), NULL,
std::string(),
JSONSchemaValidator::FormatErrorMessage(JSONSchemaValidator::kInvalidType,
schema::kObject, schema::kNull));
« no previous file with comments | « components/history/core/browser/top_sites_impl.cc ('k') | components/policy/core/browser/android/policy_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698