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

Unified Diff: components/policy/core/common/proxy_policy_provider_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/common/proxy_policy_provider_unittest.cc
diff --git a/components/policy/core/common/proxy_policy_provider_unittest.cc b/components/policy/core/common/proxy_policy_provider_unittest.cc
index 76e13fb78f2d6fac07893f9b2f4a3a8d4da67628..6e0749c77a8de93c0457e1ffd0dcc61010f875c1 100644
--- a/components/policy/core/common/proxy_policy_provider_unittest.cc
+++ b/components/policy/core/common/proxy_policy_provider_unittest.cc
@@ -4,6 +4,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_types.h"
@@ -53,12 +54,9 @@ TEST_F(ProxyPolicyProviderTest, Init) {
TEST_F(ProxyPolicyProviderTest, Delegate) {
PolicyBundle bundle;
bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
- .Set("policy",
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
+ .Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- new base::StringValue("value"),
- NULL);
+ base::WrapUnique(new base::StringValue("value")), nullptr);
mock_provider_.UpdatePolicy(CopyBundle(bundle));
EXPECT_CALL(observer_, OnUpdatePolicy(&proxy_provider_));
@@ -68,12 +66,9 @@ TEST_F(ProxyPolicyProviderTest, Delegate) {
EXPECT_CALL(observer_, OnUpdatePolicy(&proxy_provider_));
bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
- .Set("policy",
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
+ .Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- new base::StringValue("new value"),
- NULL);
+ base::WrapUnique(new base::StringValue("new value")), nullptr);
mock_provider_.UpdatePolicy(CopyBundle(bundle));
Mock::VerifyAndClearExpectations(&observer_);
EXPECT_TRUE(bundle.Equals(proxy_provider_.policies()));
« no previous file with comments | « components/policy/core/common/policy_statistics_collector_unittest.cc ('k') | components/policy/core/common/schema_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698