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

Unified Diff: components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc

Issue 2252353002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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/cloud/component_cloud_policy_service_unittest.cc
diff --git a/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc
index 7015bfbca297352626024c08346cb1e86feed9f4..f141a73e330257862e9b3e22ca445980f3028872 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc
@@ -130,11 +130,10 @@ class ComponentCloudPolicyServiceTest : public testing::Test {
expected_policy_.Set(
"Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
- base::WrapUnique(new base::StringValue("disabled")), nullptr);
+ base::MakeUnique<base::StringValue>("disabled"), nullptr);
expected_policy_.Set("Second", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- base::WrapUnique(new base::StringValue("maybe")),
- nullptr);
+ base::MakeUnique<base::StringValue>("maybe"), nullptr);
}
void TearDown() override {
@@ -203,7 +202,7 @@ class ComponentCloudPolicyServiceTest : public testing::Test {
std::unique_ptr<em::PolicyFetchResponse> CreateResponse() {
builder_.Build();
- return base::WrapUnique(new em::PolicyFetchResponse(builder_.policy()));
+ return base::MakeUnique<em::PolicyFetchResponse>(builder_.policy());
}
std::string CreateSerializedResponse() {
@@ -512,7 +511,7 @@ TEST_F(ComponentCloudPolicyServiceTest, LoadInvalidPolicyFromCache) {
const PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension);
expected_bundle.Get(ns).Set(
"Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
- base::WrapUnique(new base::StringValue("published")), nullptr);
+ base::MakeUnique<base::StringValue>("published"), nullptr);
EXPECT_TRUE(service_->policy().Equals(expected_bundle));
}

Powered by Google App Engine
This is Rietveld 408576698