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

Unified Diff: components/policy/core/browser/autofill_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/policy/core/browser/autofill_policy_handler_unittest.cc
diff --git a/components/policy/core/browser/autofill_policy_handler_unittest.cc b/components/policy/core/browser/autofill_policy_handler_unittest.cc
index 4db22478365b68b7723380621c1228c19ed4e38a..d7c353663da26d3c4754a30d1a9978e01d3cd1d9 100644
--- a/components/policy/core/browser/autofill_policy_handler_unittest.cc
+++ b/components/policy/core/browser/autofill_policy_handler_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/policy/core/browser/autofill_policy_handler.h"
@@ -26,12 +27,9 @@ TEST_F(AutofillPolicyHandlerTest, Default) {
TEST_F(AutofillPolicyHandlerTest, Enabled) {
PolicyMap policy;
- policy.Set(key::kAutoFillEnabled,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
+ policy.Set(key::kAutoFillEnabled, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- new base::FundamentalValue(true),
- NULL);
+ base::WrapUnique(new base::FundamentalValue(true)), nullptr);
PrefValueMap prefs;
AutofillPolicyHandler handler;
handler.ApplyPolicySettings(policy, &prefs);
@@ -42,12 +40,9 @@ TEST_F(AutofillPolicyHandlerTest, Enabled) {
TEST_F(AutofillPolicyHandlerTest, Disabled) {
PolicyMap policy;
- policy.Set(key::kAutoFillEnabled,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
+ policy.Set(key::kAutoFillEnabled, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- new base::FundamentalValue(false),
- NULL);
+ base::WrapUnique(new base::FundamentalValue(false)), nullptr);
PrefValueMap prefs;
AutofillPolicyHandler handler;
handler.ApplyPolicySettings(policy, &prefs);

Powered by Google App Engine
This is Rietveld 408576698