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

Unified Diff: chrome/browser/net/disk_cache_dir_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: chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc
diff --git a/chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc b/chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc
index 71dbb250429e4d5141b598785779a252d806ed33..3104690b8d03403896d31ab2db53a13a69cea4a2 100644
--- a/chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc
+++ b/chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc
@@ -4,6 +4,7 @@
#include <string>
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "chrome/browser/net/disk_cache_dir_policy_handler.h"
#include "chrome/common/pref_names.h"
@@ -29,12 +30,9 @@ TEST_F(DiskCacheDirPolicyTest, Default) {
TEST_F(DiskCacheDirPolicyTest, SetPolicyInvalid) {
// DiskCacheDir policy expects a string; give it a boolean.
- policy_.Set(key::kDiskCacheDir,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
+ policy_.Set(key::kDiskCacheDir, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- new base::FundamentalValue(false),
- NULL);
+ base::WrapUnique(new base::FundamentalValue(false)), nullptr);
handler_.ApplyPolicySettings(policy_, &prefs_);
EXPECT_FALSE(prefs_.GetValue(prefs::kDiskCacheDir, NULL));
}
@@ -42,12 +40,9 @@ TEST_F(DiskCacheDirPolicyTest, SetPolicyInvalid) {
TEST_F(DiskCacheDirPolicyTest, SetPolicyValid) {
// Use a variable in the value. It should be expanded by the handler.
const std::string in = "${user_name}/foo";
- policy_.Set(key::kDiskCacheDir,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- new base::StringValue(in),
- NULL);
+ policy_.Set(key::kDiskCacheDir, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD, base::WrapUnique(new base::StringValue(in)),
+ nullptr);
handler_.ApplyPolicySettings(policy_, &prefs_);
const base::Value* value;
« no previous file with comments | « chrome/browser/extensions/policy_handlers_unittest.cc ('k') | chrome/browser/policy/cloud/cloud_policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698