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

Unified Diff: components/policy/core/common/generate_policy_source_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: More fixes (partial Windows fix) Created 4 years, 8 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/generate_policy_source_unittest.cc
diff --git a/components/policy/core/common/generate_policy_source_unittest.cc b/components/policy/core/common/generate_policy_source_unittest.cc
index 520e257ef8323c2a6b99f8631cefd2c838e60791..b6884474259efbd96ba76c7a6f909ced461a224a 100644
--- a/components/policy/core/common/generate_policy_source_unittest.cc
+++ b/components/policy/core/common/generate_policy_source_unittest.cc
@@ -6,6 +6,7 @@
#include <memory>
#include <string>
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/policy/core/common/policy_details.h"
@@ -217,12 +218,10 @@ TEST(GeneratePolicySource, SetEnterpriseDefaults) {
EXPECT_TRUE(expected.Equals(multiprof_behavior));
// If policy already configured, it's not changed to enterprise defaults.
- policy_map.Set(key::kChromeOsMultiProfileUserBehavior,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- new base::StringValue("test_value"),
- NULL);
+ policy_map.Set(key::kChromeOsMultiProfileUserBehavior, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
+ base::WrapUnique(new base::StringValue("test_value")),
+ nullptr);
SetEnterpriseUsersDefaults(&policy_map);
multiprof_behavior =
policy_map.GetValue(key::kChromeOsMultiProfileUserBehavior);

Powered by Google App Engine
This is Rietveld 408576698