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

Unified Diff: chrome/browser/prefs/incognito_mode_prefs_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: 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_);
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_unittest.cc ('k') | chrome/browser/prefs/session_startup_pref_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698