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

Unified Diff: components/policy/core/common/configuration_policy_provider_test.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/configuration_policy_provider_test.cc
diff --git a/components/policy/core/common/configuration_policy_provider_test.cc b/components/policy/core/common/configuration_policy_provider_test.cc
index a9d2ecb4c330bb200215ec804c33d621f0a25575..6681086fd12b648e1fc5aea9171cedffe26d62d1 100644
--- a/components/policy/core/common/configuration_policy_provider_test.cc
+++ b/components/policy/core/common/configuration_policy_provider_test.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "components/policy/core/common/configuration_policy_provider.h"
#include "components/policy/core/common/external_data_fetcher.h"
@@ -227,12 +228,9 @@ void ConfigurationPolicyProviderTest::CheckValue(
loop_.RunUntilIdle();
PolicyBundle expected_bundle;
expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
- .Set(policy_name,
- test_harness_->policy_level(),
- test_harness_->policy_scope(),
- test_harness_->policy_source(),
- expected_value.DeepCopy(),
- NULL);
+ .Set(policy_name, test_harness_->policy_level(),
+ test_harness_->policy_scope(), test_harness_->policy_source(),
+ expected_value.CreateDeepCopy(), nullptr);
EXPECT_TRUE(provider_->policies().Equals(expected_bundle));
// TODO(joaodasilva): set the policy in the POLICY_DOMAIN_EXTENSIONS too,
// and extend the |expected_bundle|, once all providers are ready.
@@ -344,12 +342,9 @@ TEST_P(ConfigurationPolicyProviderTest, RefreshPolicies) {
Mock::VerifyAndClearExpectations(&observer);
bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
- .Set(test_keys::kKeyString,
- test_harness_->policy_level(),
- test_harness_->policy_scope(),
- test_harness_->policy_source(),
- new base::StringValue("value"),
- NULL);
+ .Set(test_keys::kKeyString, test_harness_->policy_level(),
+ test_harness_->policy_scope(), test_harness_->policy_source(),
+ base::WrapUnique(new base::StringValue("value")), nullptr);
EXPECT_TRUE(provider_->policies().Equals(bundle));
provider_->RemoveObserver(&observer);
}
@@ -397,12 +392,10 @@ TEST_P(Configuration3rdPartyPolicyProviderTest, Load3rdParty) {
loop_.RunUntilIdle();
PolicyMap expected_policy;
- expected_policy.Set(test_keys::kKeyDictionary,
- test_harness_->policy_level(),
+ expected_policy.Set(test_keys::kKeyDictionary, test_harness_->policy_level(),
test_harness_->policy_scope(),
test_harness_->policy_source(),
- policy_dict.DeepCopy(),
- NULL);
+ policy_dict.CreateDeepCopy(), nullptr);
PolicyBundle expected_bundle;
expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
.CopyFrom(expected_policy);

Powered by Google App Engine
This is Rietveld 408576698