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

Unified Diff: chrome/browser/search/contextual_search_policy_handler_android_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: chrome/browser/search/contextual_search_policy_handler_android_unittest.cc
diff --git a/chrome/browser/search/contextual_search_policy_handler_android_unittest.cc b/chrome/browser/search/contextual_search_policy_handler_android_unittest.cc
index 023adb9490d6fe5be385c26b5c2d06786ec99788..675b5cd22e5f4dcfc095d3fcb3a0a9e6e38a3aaf 100644
--- a/chrome/browser/search/contextual_search_policy_handler_android_unittest.cc
+++ b/chrome/browser/search/contextual_search_policy_handler_android_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 "chrome/browser/search/contextual_search_policy_handler_android.h"
#include "chrome/common/pref_names.h"
@@ -24,12 +25,9 @@ TEST(ContextualSearchPolicyHandlerAndroidTest, Default) {
TEST(ContextualSearchPolicyHandlerAndroidTest, Enabled) {
PolicyMap policy;
- policy.Set(key::kContextualSearchEnabled,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- POLICY_SOURCE_PLATFORM,
- new base::FundamentalValue(true),
- NULL);
+ policy.Set(key::kContextualSearchEnabled, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, POLICY_SOURCE_PLATFORM,
+ base::WrapUnique(new base::FundamentalValue(true)), nullptr);
PrefValueMap prefs;
ContextualSearchPolicyHandlerAndroid handler;
handler.ApplyPolicySettings(policy, &prefs);
@@ -42,12 +40,9 @@ TEST(ContextualSearchPolicyHandlerAndroidTest, Enabled) {
TEST(ContextualSearchPolicyHandlerAndroidTest, Disabled) {
PolicyMap policy;
- policy.Set(key::kContextualSearchEnabled,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- POLICY_SOURCE_PLATFORM,
- new base::FundamentalValue(false),
- NULL);
+ policy.Set(key::kContextualSearchEnabled, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, POLICY_SOURCE_PLATFORM,
+ base::WrapUnique(new base::FundamentalValue(false)), nullptr);
PrefValueMap prefs;
ContextualSearchPolicyHandlerAndroid handler;
handler.ApplyPolicySettings(policy, &prefs);

Powered by Google App Engine
This is Rietveld 408576698