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

Unified Diff: chrome/browser/chromeos/policy/auto_enrollment_client_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/chromeos/policy/auto_enrollment_client_unittest.cc
diff --git a/chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc b/chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc
index 47d4a46b6cf52314cf025036cd992b8956d21d79..5ddfe5c4ae05bb2de8e0094b45be2c755cfad3b1 100644
--- a/chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc
+++ b/chrome/browser/chromeos/policy/auto_enrollment_client_unittest.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
@@ -426,9 +427,10 @@ TEST_F(AutoEnrollmentClientTest, ReuseCachedDecision) {
EXPECT_CALL(*service_,
CreateJob(DeviceManagementRequestJob::TYPE_AUTO_ENROLLMENT, _))
.Times(0);
- local_state_->SetUserPref(prefs::kShouldAutoEnroll, new base::Value(true));
+ local_state_->SetUserPref(prefs::kShouldAutoEnroll,
+ base::MakeUnique<base::Value>(true));
local_state_->SetUserPref(prefs::kAutoEnrollmentPowerLimit,
- new base::Value(8));
+ base::MakeUnique<base::Value>(8));
// Note that device state will be retrieved every time, regardless of any
// cached information. This is intentional, the idea is that device state on
@@ -446,9 +448,10 @@ TEST_F(AutoEnrollmentClientTest, ReuseCachedDecision) {
}
TEST_F(AutoEnrollmentClientTest, RetryIfPowerLargerThanCached) {
- local_state_->SetUserPref(prefs::kShouldAutoEnroll, new base::Value(false));
+ local_state_->SetUserPref(prefs::kShouldAutoEnroll,
+ base::MakeUnique<base::Value>(false));
local_state_->SetUserPref(prefs::kAutoEnrollmentPowerLimit,
- new base::Value(8));
+ base::MakeUnique<base::Value>(8));
CreateClient(kStateKey, 5, 10);
ServerWillReply(-1, true, true);
ServerWillSendState(

Powered by Google App Engine
This is Rietveld 408576698