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

Unified Diff: components/policy/core/browser/url_blacklist_manager_unittest.cc

Issue 2782553004: Move TestingPrefService to use unique_ptr<Value> (Closed)
Patch Set: comments Created 3 years, 9 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/browser/url_blacklist_manager_unittest.cc
diff --git a/components/policy/core/browser/url_blacklist_manager_unittest.cc b/components/policy/core/browser/url_blacklist_manager_unittest.cc
index f43c04cd5c023185ce52bc015dcb2b48b9f16485..bf6d7f3967d066620b8b76b85d4b2afa83c879dd 100644
--- a/components/policy/core/browser/url_blacklist_manager_unittest.cc
+++ b/components/policy/core/browser/url_blacklist_manager_unittest.cc
@@ -223,12 +223,14 @@ TEST_P(URLBlacklistFilterToComponentsTest, FilterToComponents) {
}
TEST_F(URLBlacklistManagerTest, SingleUpdateForTwoPrefChanges) {
- base::ListValue* blacklist = new base::ListValue;
+ auto blacklist = base::MakeUnique<base::ListValue>();
blacklist->AppendString("*.google.com");
- base::ListValue* whitelist = new base::ListValue;
+ auto whitelist = base::MakeUnique<base::ListValue>();
whitelist->AppendString("mail.google.com");
- pref_service_.SetManagedPref(policy_prefs::kUrlBlacklist, blacklist);
- pref_service_.SetManagedPref(policy_prefs::kUrlBlacklist, whitelist);
+ pref_service_.SetManagedPref(policy_prefs::kUrlBlacklist,
+ std::move(blacklist));
+ pref_service_.SetManagedPref(policy_prefs::kUrlBlacklist,
+ std::move(whitelist));
base::RunLoop().RunUntilIdle();
EXPECT_EQ(1, blacklist_manager_->update_called());

Powered by Google App Engine
This is Rietveld 408576698