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

Unified Diff: chrome/browser/printing/cloud_print/cloud_print_proxy_service_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/printing/cloud_print/cloud_print_proxy_service_unittest.cc
diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc
index 8636b75d1eca75f2bd8e2917a21ce02b9fc0d7c1..a2246942bdc5c8b84528bbb37ad6043908bd4a2e 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc
@@ -11,6 +11,7 @@
#include "base/command_line.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
@@ -244,9 +245,9 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyDisabled) {
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(
- prefs::kCloudPrintEmail,
- new base::Value(MockServiceProcessControl::EnabledUserId()));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(
+ MockServiceProcessControl::EnabledUserId()));
service.Initialize();
@@ -261,7 +262,8 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyEnabled) {
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(prefs::kCloudPrintEmail, new base::Value(std::string()));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(std::string()));
service.Initialize();
service.RefreshStatusFromService();
@@ -278,8 +280,10 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithPolicySetProxyDisabled) {
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(prefs::kCloudPrintEmail, new base::Value(std::string()));
- prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::Value(false));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(std::string()));
+ prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
+ base::MakeUnique<base::Value>(false));
service.Initialize();
@@ -295,8 +299,10 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithPolicySetProxyEnabled) {
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(prefs::kCloudPrintEmail, new base::Value(std::string()));
- prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::Value(false));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(std::string()));
+ prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
+ base::MakeUnique<base::Value>(false));
service.Initialize();
@@ -311,15 +317,16 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyDisabledThenSetPolicy) {
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(
- prefs::kCloudPrintEmail,
- new base::Value(MockServiceProcessControl::EnabledUserId()));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(
+ MockServiceProcessControl::EnabledUserId()));
service.Initialize();
EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail));
- prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::Value(false));
+ prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
+ base::MakeUnique<base::Value>(false));
EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail));
}
@@ -332,7 +339,8 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyEnabledThenSetPolicy) {
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(prefs::kCloudPrintEmail, new base::Value(std::string()));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(std::string()));
service.Initialize();
service.RefreshStatusFromService();
@@ -341,7 +349,8 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyEnabledThenSetPolicy) {
prefs->GetString(prefs::kCloudPrintEmail));
service.GetMockServiceProcessControl()->SetWillBeDisabledExpectations();
- prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::Value(false));
+ prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
+ base::MakeUnique<base::Value>(false));
EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail));
}
@@ -355,8 +364,10 @@ TEST_F(CloudPrintProxyPolicyTest,
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(prefs::kCloudPrintEmail, new base::Value(std::string()));
- prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::Value(false));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(std::string()));
+ prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
+ base::MakeUnique<base::Value>(false));
service.Initialize();
@@ -375,8 +386,10 @@ TEST_F(CloudPrintProxyPolicyTest,
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(prefs::kCloudPrintEmail, new base::Value(std::string()));
- prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::Value(false));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(std::string()));
+ prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
+ base::MakeUnique<base::Value>(false));
service.Initialize();
@@ -393,9 +406,9 @@ TEST_F(CloudPrintProxyPolicyTest, StartWithNoPolicyProxyDisabledThenEnable) {
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(
- prefs::kCloudPrintEmail,
- new base::Value(MockServiceProcessControl::EnabledUserId()));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(
+ MockServiceProcessControl::EnabledUserId()));
service.Initialize();
EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail));
@@ -417,8 +430,10 @@ TEST_F(CloudPrintProxyPolicyTest,
sync_preferences::TestingPrefServiceSyncable* prefs =
profile_.GetTestingPrefService();
- prefs->SetUserPref(prefs::kCloudPrintEmail, new base::Value(std::string()));
- prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled, new base::Value(false));
+ prefs->SetUserPref(prefs::kCloudPrintEmail,
+ base::MakeUnique<base::Value>(std::string()));
+ prefs->SetManagedPref(prefs::kCloudPrintProxyEnabled,
+ base::MakeUnique<base::Value>(false));
service.Initialize();
« no previous file with comments | « chrome/browser/prefs/session_startup_pref_unittest.cc ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698