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

Unified Diff: chrome/browser/policy/profile_policy_connector_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
« no previous file with comments | « chrome/browser/policy/policy_startup_browsertest.cc ('k') | chrome/browser/prefs/proxy_policy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/profile_policy_connector_unittest.cc
diff --git a/chrome/browser/policy/profile_policy_connector_unittest.cc b/chrome/browser/policy/profile_policy_connector_unittest.cc
index 217cae77940885816778f6ddb800a00152e04d74..a1345a3bc8af1a102ddc1d1be9b814efb9f8914a 100644
--- a/chrome/browser/policy/profile_policy_connector_unittest.cc
+++ b/chrome/browser/policy/profile_policy_connector_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/policy/profile_policy_connector.h"
+#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -96,12 +97,10 @@ TEST_F(ProfilePolicyConnectorTest, IsPolicyFromCloudPolicy) {
key::kAutoFillEnabled));
// Set the policy at the cloud provider.
- cloud_policy_store_.policy_map_.Set(key::kAutoFillEnabled,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- new base::FundamentalValue(false),
- nullptr);
+ cloud_policy_store_.policy_map_.Set(
+ key::kAutoFillEnabled, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD, base::WrapUnique(new base::FundamentalValue(false)),
+ nullptr);
cloud_policy_store_.NotifyStoreLoaded();
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(connector.IsPolicyFromCloudPolicy(key::kAutoFillEnabled));
@@ -113,12 +112,9 @@ TEST_F(ProfilePolicyConnectorTest, IsPolicyFromCloudPolicy) {
// Now test with a higher-priority provider also setting the policy.
PolicyMap map;
- map.Set(key::kAutoFillEnabled,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
+ map.Set(key::kAutoFillEnabled, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- new base::FundamentalValue(true),
- nullptr);
+ base::WrapUnique(new base::FundamentalValue(true)), nullptr);
mock_provider_.UpdateChromePolicy(map);
EXPECT_FALSE(connector.IsPolicyFromCloudPolicy(key::kAutoFillEnabled));
value = connector.policy_service()->GetPolicies(chrome_ns).GetValue(
« no previous file with comments | « chrome/browser/policy/policy_startup_browsertest.cc ('k') | chrome/browser/prefs/proxy_policy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698