Index: components/prefs/pref_change_registrar_unittest.cc |
diff --git a/components/prefs/pref_change_registrar_unittest.cc b/components/prefs/pref_change_registrar_unittest.cc |
index cecaca85ed90bd38f8bf23288a1b6da32b8f6b83..15be02c869e6a044d01c4b682db15cab27072441 100644 |
--- a/components/prefs/pref_change_registrar_unittest.cc |
+++ b/components/prefs/pref_change_registrar_unittest.cc |
@@ -2,9 +2,11 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "components/prefs/pref_change_registrar.h" |
+ |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
-#include "components/prefs/pref_change_registrar.h" |
+#include "base/memory/ptr_util.h" |
#include "components/prefs/pref_observer.h" |
#include "components/prefs/pref_registry_simple.h" |
#include "components/prefs/testing_pref_service.h" |
@@ -157,9 +159,11 @@ TEST_F(ObserveSetOfPreferencesTest, IsObserved) { |
TEST_F(ObserveSetOfPreferencesTest, IsManaged) { |
std::unique_ptr<PrefChangeRegistrar> pref_set(CreatePrefChangeRegistrar()); |
EXPECT_FALSE(pref_set->IsManaged()); |
- pref_service_->SetManagedPref(kHomePage, new Value("http://crbug.com")); |
+ pref_service_->SetManagedPref(kHomePage, |
+ base::MakeUnique<Value>("http://crbug.com")); |
EXPECT_TRUE(pref_set->IsManaged()); |
- pref_service_->SetManagedPref(kHomePageIsNewTabPage, new Value(true)); |
+ pref_service_->SetManagedPref(kHomePageIsNewTabPage, |
+ base::MakeUnique<Value>(true)); |
EXPECT_TRUE(pref_set->IsManaged()); |
pref_service_->RemoveManagedPref(kHomePage); |
EXPECT_TRUE(pref_set->IsManaged()); |
@@ -180,15 +184,18 @@ TEST_F(ObserveSetOfPreferencesTest, Observe) { |
pref_set.Add(kHomePageIsNewTabPage, callback); |
EXPECT_CALL(*this, OnPreferenceChanged(kHomePage)); |
- pref_service_->SetUserPref(kHomePage, new Value("http://crbug.com")); |
+ pref_service_->SetUserPref(kHomePage, |
+ base::MakeUnique<Value>("http://crbug.com")); |
Mock::VerifyAndClearExpectations(this); |
EXPECT_CALL(*this, OnPreferenceChanged(kHomePageIsNewTabPage)); |
- pref_service_->SetUserPref(kHomePageIsNewTabPage, new Value(true)); |
+ pref_service_->SetUserPref(kHomePageIsNewTabPage, |
+ base::MakeUnique<Value>(true)); |
Mock::VerifyAndClearExpectations(this); |
EXPECT_CALL(*this, OnPreferenceChanged(_)).Times(0); |
- pref_service_->SetUserPref(kApplicationLocale, new Value("en_US.utf8")); |
+ pref_service_->SetUserPref(kApplicationLocale, |
+ base::MakeUnique<Value>("en_US.utf8")); |
Mock::VerifyAndClearExpectations(this); |
} |