Index: chrome/browser/prefs/incognito_mode_prefs_unittest.cc |
diff --git a/chrome/browser/prefs/incognito_mode_prefs_unittest.cc b/chrome/browser/prefs/incognito_mode_prefs_unittest.cc |
index 96f50d61a6d95bc2d7e96078a86613a1457bec24..454e1d0c718522608ac97f2b1ba748acf0605529 100644 |
--- a/chrome/browser/prefs/incognito_mode_prefs_unittest.cc |
+++ b/chrome/browser/prefs/incognito_mode_prefs_unittest.cc |
@@ -4,6 +4,7 @@ |
#include "chrome/browser/prefs/incognito_mode_prefs.h" |
+#include "base/memory/ptr_util.h" |
#include "base/test/gtest_util.h" |
#include "chrome/common/pref_names.h" |
#include "components/sync_preferences/testing_pref_service_syncable.h" |
@@ -38,18 +39,20 @@ TEST_F(IncognitoModePrefsTest, IntToAvailability) { |
} |
TEST_F(IncognitoModePrefsTest, GetAvailability) { |
- prefs_.SetUserPref(prefs::kIncognitoModeAvailability, |
- new base::Value(IncognitoModePrefs::ENABLED)); |
+ prefs_.SetUserPref( |
+ prefs::kIncognitoModeAvailability, |
+ base::MakeUnique<base::Value>(IncognitoModePrefs::ENABLED)); |
EXPECT_EQ(IncognitoModePrefs::ENABLED, |
IncognitoModePrefs::GetAvailability(&prefs_)); |
- prefs_.SetUserPref(prefs::kIncognitoModeAvailability, |
- new base::Value(IncognitoModePrefs::DISABLED)); |
+ prefs_.SetUserPref( |
+ prefs::kIncognitoModeAvailability, |
+ base::MakeUnique<base::Value>(IncognitoModePrefs::DISABLED)); |
EXPECT_EQ(IncognitoModePrefs::DISABLED, |
IncognitoModePrefs::GetAvailability(&prefs_)); |
prefs_.SetUserPref(prefs::kIncognitoModeAvailability, |
- new base::Value(IncognitoModePrefs::FORCED)); |
+ base::MakeUnique<base::Value>(IncognitoModePrefs::FORCED)); |
EXPECT_EQ(IncognitoModePrefs::FORCED, |
IncognitoModePrefs::GetAvailability(&prefs_)); |
} |
@@ -57,7 +60,8 @@ TEST_F(IncognitoModePrefsTest, GetAvailability) { |
typedef IncognitoModePrefsTest IncognitoModePrefsDeathTest; |
TEST_F(IncognitoModePrefsDeathTest, GetAvailabilityBadValue) { |
- prefs_.SetUserPref(prefs::kIncognitoModeAvailability, new base::Value(-1)); |
+ prefs_.SetUserPref(prefs::kIncognitoModeAvailability, |
+ base::MakeUnique<base::Value>(-1)); |
EXPECT_DCHECK_DEATH({ |
IncognitoModePrefs::Availability availability = |
IncognitoModePrefs::GetAvailability(&prefs_); |