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

Unified Diff: components/url_matcher/url_matcher_factory_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/url_matcher/url_matcher_factory_unittest.cc
diff --git a/components/url_matcher/url_matcher_factory_unittest.cc b/components/url_matcher/url_matcher_factory_unittest.cc
index 4718ca95b3ba886748e3a068610b524f58fb1fd7..77f7a04e8c9f7e68512c0fcdc88c0812802104c3 100644
--- a/components/url_matcher/url_matcher_factory_unittest.cc
+++ b/components/url_matcher/url_matcher_factory_unittest.cc
@@ -50,14 +50,14 @@ TEST(URLMatcherFactoryTest, CreateFromURLFilterDictionary) {
// Port range: Allow 80;1000-1010.
base::ListValue* port_range = new base::ListValue();
- port_range->Append(new base::FundamentalValue(1000));
- port_range->Append(new base::FundamentalValue(1010));
+ port_range->AppendInteger(1000);
+ port_range->AppendInteger(1010);
base::ListValue* port_ranges = new base::ListValue();
- port_ranges->Append(new base::FundamentalValue(80));
+ port_ranges->AppendInteger(80);
port_ranges->Append(port_range);
base::ListValue* scheme_list = new base::ListValue();
- scheme_list->Append(new base::StringValue("http"));
+ scheme_list->AppendString("http");
base::DictionaryValue valid_condition;
valid_condition.SetString(keys::kHostSuffixKey, "example.com");
@@ -139,7 +139,7 @@ TEST(URLMatcherFactoryTest, UpperCase) {
// {"scheme": ["HTTP"]}
base::ListValue* scheme_list = new base::ListValue();
- scheme_list->Append(new base::StringValue("HTTP"));
+ scheme_list->AppendString("HTTP");
base::DictionaryValue invalid_condition5;
invalid_condition5.Set(keys::kSchemesKey, scheme_list);
@@ -232,7 +232,7 @@ void UrlConditionCaseTest::CheckCondition(
base::DictionaryValue condition;
if (use_list_of_strings_) {
base::ListValue* list = new base::ListValue();
- list->Append(new base::StringValue(value));
+ list->AppendString(value);
condition.SetWithoutPathExpansion(condition_key_, list);
} else {
condition.SetStringWithoutPathExpansion(condition_key_, value);
« no previous file with comments | « components/translate/core/browser/translate_prefs.cc ('k') | components/version_ui/version_handler_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698