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

Unified Diff: components/cryptauth/cryptauth_enrollment_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/cryptauth/cryptauth_enrollment_manager_unittest.cc
diff --git a/components/cryptauth/cryptauth_enrollment_manager_unittest.cc b/components/cryptauth/cryptauth_enrollment_manager_unittest.cc
index ccb12c18f6f32327dccba55617c77096fc856c4f..7a98f86d8e477902257747f78e881a20cf0d5e71 100644
--- a/components/cryptauth/cryptauth_enrollment_manager_unittest.cc
+++ b/components/cryptauth/cryptauth_enrollment_manager_unittest.cc
@@ -170,12 +170,13 @@ class CryptAuthEnrollmentManagerTest
CryptAuthEnrollmentManager::RegisterPrefs(pref_service_.registry());
pref_service_.SetUserPref(
prefs::kCryptAuthEnrollmentIsRecoveringFromFailure,
- new base::Value(false));
+ base::MakeUnique<base::Value>(false));
pref_service_.SetUserPref(
prefs::kCryptAuthEnrollmentLastEnrollmentTimeSeconds,
- new base::Value(kLastEnrollmentTimeSeconds));
- pref_service_.SetUserPref(prefs::kCryptAuthEnrollmentReason,
- new base::Value(INVOCATION_REASON_UNKNOWN));
+ base::MakeUnique<base::Value>(kLastEnrollmentTimeSeconds));
+ pref_service_.SetUserPref(
+ prefs::kCryptAuthEnrollmentReason,
+ base::MakeUnique<base::Value>(INVOCATION_REASON_UNKNOWN));
std::string public_key_b64, private_key_b64;
base::Base64UrlEncode(public_key_,
@@ -335,7 +336,7 @@ TEST_F(CryptAuthEnrollmentManagerTest, InitWithExistingPrefs) {
TEST_F(CryptAuthEnrollmentManagerTest, InitWithExpiredEnrollment) {
pref_service_.SetUserPref(
prefs::kCryptAuthEnrollmentLastEnrollmentTimeSeconds,
- new base::Value(kLastExpiredEnrollmentTimeSeconds));
+ base::MakeUnique<base::Value>(kLastExpiredEnrollmentTimeSeconds));
EXPECT_CALL(*sync_scheduler(),
Start(clock_->Now() - base::Time::FromDoubleT(

Powered by Google App Engine
This is Rietveld 408576698