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

Unified Diff: components/search_engines/template_url_prepopulate_data_unittest.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 years, 6 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/search_engines/template_url_prepopulate_data_unittest.cc
diff --git a/components/search_engines/template_url_prepopulate_data_unittest.cc b/components/search_engines/template_url_prepopulate_data_unittest.cc
index 368597b9ff352803245dc726504a5122f76a8127..b3759a090633d6529f2ce269383f94c477fef01e 100644
--- a/components/search_engines/template_url_prepopulate_data_unittest.cc
+++ b/components/search_engines/template_url_prepopulate_data_unittest.cc
@@ -2,8 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "components/search_engines/template_url_prepopulate_data.h"
+
#include <stddef.h>
+#include <memory>
+#include <utility>
+
#include "base/command_line.h"
#include "base/files/scoped_temp_dir.h"
#include "base/macros.h"
@@ -15,7 +20,6 @@
#include "components/search_engines/search_engines_pref_names.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
-#include "components/search_engines/template_url_prepopulate_data.h"
#include "components/search_engines/template_url_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -207,7 +211,7 @@ TEST_F(TemplateURLPrepopulateDataTest, ClearProvidersFromPrefs) {
prefs_.SetUserPref(prefs::kSearchProviderOverridesVersion,
new base::FundamentalValue(1));
base::ListValue* overrides = new base::ListValue;
- base::DictionaryValue* entry(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue);
// Set only the minimal required settings for a search provider configuration.
entry->SetString("name", "foo");
entry->SetString("keyword", "fook");
@@ -215,7 +219,7 @@ TEST_F(TemplateURLPrepopulateDataTest, ClearProvidersFromPrefs) {
entry->SetString("favicon_url", "http://foi.com/favicon.ico");
entry->SetString("encoding", "UTF-8");
entry->SetInteger("id", 1001);
- overrides->Append(entry);
+ overrides->Append(std::move(entry));
prefs_.SetUserPref(prefs::kSearchProviderOverrides, overrides);
int version = TemplateURLPrepopulateData::GetDataVersion(&prefs_);

Powered by Google App Engine
This is Rietveld 408576698