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

Unified Diff: components/sync_driver/sync_policy_handler_unittest.cc

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another-fix Created 4 years, 7 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/sync_driver/sync_policy_handler_unittest.cc
diff --git a/components/sync_driver/sync_policy_handler_unittest.cc b/components/sync_driver/sync_policy_handler_unittest.cc
index dd300d67781245046d578486adacba714494753b..b3754cb82bac7d12134ec6a561b5c0f74532f676 100644
--- a/components/sync_driver/sync_policy_handler_unittest.cc
+++ b/components/sync_driver/sync_policy_handler_unittest.cc
@@ -4,6 +4,7 @@
#include "components/sync_driver/sync_policy_handler.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_types.h"
@@ -27,12 +28,9 @@ TEST_F(SyncPolicyHandlerTest, Default) {
TEST_F(SyncPolicyHandlerTest, Enabled) {
policy::PolicyMap policy;
- policy.Set(policy::key::kSyncDisabled,
- policy::POLICY_LEVEL_MANDATORY,
- policy::POLICY_SCOPE_USER,
- policy::POLICY_SOURCE_CLOUD,
- new base::FundamentalValue(false),
- NULL);
+ policy.Set(policy::key::kSyncDisabled, policy::POLICY_LEVEL_MANDATORY,
+ policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
+ base::WrapUnique(new base::FundamentalValue(false)), nullptr);
SyncPolicyHandler handler;
PrefValueMap prefs;
handler.ApplyPolicySettings(policy, &prefs);
@@ -43,12 +41,9 @@ TEST_F(SyncPolicyHandlerTest, Enabled) {
TEST_F(SyncPolicyHandlerTest, Disabled) {
policy::PolicyMap policy;
- policy.Set(policy::key::kSyncDisabled,
- policy::POLICY_LEVEL_MANDATORY,
- policy::POLICY_SCOPE_USER,
- policy::POLICY_SOURCE_CLOUD,
- new base::FundamentalValue(true),
- NULL);
+ policy.Set(policy::key::kSyncDisabled, policy::POLICY_LEVEL_MANDATORY,
+ policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
+ base::WrapUnique(new base::FundamentalValue(true)), nullptr);
SyncPolicyHandler handler;
PrefValueMap prefs;
handler.ApplyPolicySettings(policy, &prefs);
« no previous file with comments | « components/search_engines/default_search_policy_handler_unittest.cc ('k') | remoting/host/policy_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698