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

Unified Diff: components/policy/core/common/schema_unittest.cc

Issue 2030833003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //components (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
Index: components/policy/core/common/schema_unittest.cc
diff --git a/components/policy/core/common/schema_unittest.cc b/components/policy/core/common/schema_unittest.cc
index b7eda64aa9b33d99a876e4a8257c31edd6a75e07..1238f5a442ded96edd4d6d2c8b5e4d60102fa62a 100644
--- a/components/policy/core/common/schema_unittest.cc
+++ b/components/policy/core/common/schema_unittest.cc
@@ -804,7 +804,7 @@ TEST(SchemaTest, Validate) {
root.Set("List", list_value); // Pass ownership to root.
// Test that there are not errors here.
- list_value->Append(new base::FundamentalValue(12345));
+ list_value->AppendInteger(12345);
TestSchemaValidation(subschema, root, SCHEMA_STRICT, true);
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_UNKNOWN_TOPLEVEL, true);
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_UNKNOWN, true);
@@ -812,7 +812,7 @@ TEST(SchemaTest, Validate) {
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_INVALID, true);
// Invalid list item.
- list_value->Append(new base::StringValue("blabla"));
+ list_value->AppendString("blabla");
TestSchemaValidation(subschema, root, SCHEMA_STRICT, false);
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_UNKNOWN_TOPLEVEL, false);
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_UNKNOWN, false);
@@ -833,7 +833,7 @@ TEST(SchemaTest, Validate) {
root.Append(dict_value); // Pass ownership to root.
// Test that there are not errors here.
- list_value->Append(new base::StringValue("blabla"));
+ list_value->AppendString("blabla");
TestSchemaValidation(subschema, root, SCHEMA_STRICT, true);
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_UNKNOWN_TOPLEVEL, true);
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_UNKNOWN, true);
@@ -841,7 +841,7 @@ TEST(SchemaTest, Validate) {
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_INVALID, true);
// Invalid list item.
- list_value->Append(new base::FundamentalValue(12345));
+ list_value->AppendInteger(12345);
TestSchemaValidation(subschema, root, SCHEMA_STRICT, false);
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_UNKNOWN_TOPLEVEL, false);
TestSchemaValidation(subschema, root, SCHEMA_ALLOW_UNKNOWN, false);
« no previous file with comments | « components/policy/core/browser/configuration_policy_pref_store_unittest.cc ('k') | components/prefs/pref_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698