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

Unified Diff: extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc

Issue 2037703004: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //extensions (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
« no previous file with comments | « no previous file | extensions/browser/api/management/management_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
index 07f5071f5fffbc22689111d6e55a8fa98ef51444..265e593cd4ce57489b9e9b89e716d224f0372be0 100644
--- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
+++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
@@ -49,7 +49,7 @@ TEST(WebRequestConditionAttributeTest, CreateConditionAttribute) {
scoped_refptr<const WebRequestConditionAttribute> result;
base::StringValue string_value("main_frame");
base::ListValue resource_types;
- resource_types.Append(new base::StringValue("main_frame"));
+ resource_types.AppendString("main_frame");
// Test wrong condition name passed.
error.clear();
@@ -90,7 +90,7 @@ TEST(WebRequestConditionAttributeTest, ResourceType) {
base::ListValue resource_types;
// The 'sub_frame' value is chosen arbitrarily, so as the corresponding
// content::ResourceType is not 0, the default value.
- resource_types.Append(new base::StringValue("sub_frame"));
+ resource_types.AppendString("sub_frame");
scoped_refptr<const WebRequestConditionAttribute> attribute =
WebRequestConditionAttribute::Create(
@@ -153,7 +153,7 @@ TEST(WebRequestConditionAttributeTest, ContentType) {
base::MessageLoop::current()->Run();
base::ListValue content_types;
- content_types.Append(new base::StringValue("text/plain"));
+ content_types.AppendString("text/plain");
scoped_refptr<const WebRequestConditionAttribute> attribute_include =
WebRequestConditionAttribute::Create(
keys::kContentTypeKey, &content_types, &error);
@@ -177,7 +177,7 @@ TEST(WebRequestConditionAttributeTest, ContentType) {
url_request->response_headers())));
content_types.Clear();
- content_types.Append(new base::StringValue("something/invalid"));
+ content_types.AppendString("something/invalid");
scoped_refptr<const WebRequestConditionAttribute> attribute_unincluded =
WebRequestConditionAttribute::Create(
keys::kContentTypeKey, &content_types, &error);
@@ -389,12 +389,12 @@ std::unique_ptr<base::DictionaryValue> GetDictionaryFromArray(
// Ignoring return value, we already verified the entry is there.
dictionary->RemoveWithoutPathExpansion(*name, &entry_owned);
list->Append(entry_owned.release());
- list->Append(new base::StringValue(*value));
+ list->AppendString(*value);
dictionary->SetWithoutPathExpansion(*name, list);
break;
case base::Value::TYPE_LIST: // Just append to the list.
CHECK(entry->GetAsList(&list));
- list->Append(new base::StringValue(*value));
+ list->AppendString(*value);
break;
default:
NOTREACHED(); // We never put other Values here.
« no previous file with comments | « no previous file | extensions/browser/api/management/management_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698