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

Unified Diff: chrome/browser/extensions/api/storage/policy_value_store_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: chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
diff --git a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
index de089d4523355f0e5a9572855f79c40ae69c3edb..53b1f76a6bbcc7b440e4841d94349203ec7d7011 100644
--- a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
+++ b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
@@ -125,10 +125,10 @@ TEST_F(PolicyValueStoreTest, DontProvideRecommendedPolicies) {
base::FundamentalValue expected(123);
policies.Set("must", policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
- expected.DeepCopy(), nullptr);
+ expected.CreateDeepCopy(), nullptr);
policies.Set("may", policy::POLICY_LEVEL_RECOMMENDED,
policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
- new base::FundamentalValue(456), NULL);
+ base::WrapUnique(new base::FundamentalValue(456)), nullptr);
store_->SetCurrentPolicy(policies);
ValueStore::ReadResult result = store_->Get();
ASSERT_TRUE(result->status().ok());
@@ -170,7 +170,7 @@ TEST_F(PolicyValueStoreTest, NotifyOnChanges) {
policy::PolicyMap policies;
policies.Set("aaa", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
- policy::POLICY_SOURCE_CLOUD, value.DeepCopy(), nullptr);
+ policy::POLICY_SOURCE_CLOUD, value.CreateDeepCopy(), nullptr);
store_->SetCurrentPolicy(policies);
loop_.RunUntilIdle();
Mock::VerifyAndClearExpectations(&observer_);
@@ -186,7 +186,7 @@ TEST_F(PolicyValueStoreTest, NotifyOnChanges) {
}
policies.Set("bbb", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
- policy::POLICY_SOURCE_CLOUD, value.DeepCopy(), nullptr);
+ policy::POLICY_SOURCE_CLOUD, value.CreateDeepCopy(), nullptr);
store_->SetCurrentPolicy(policies);
loop_.RunUntilIdle();
Mock::VerifyAndClearExpectations(&observer_);
@@ -204,7 +204,8 @@ TEST_F(PolicyValueStoreTest, NotifyOnChanges) {
}
policies.Set("bbb", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
- policy::POLICY_SOURCE_CLOUD, new_value.DeepCopy(), nullptr);
+ policy::POLICY_SOURCE_CLOUD, new_value.CreateDeepCopy(),
+ nullptr);
store_->SetCurrentPolicy(policies);
loop_.RunUntilIdle();
Mock::VerifyAndClearExpectations(&observer_);

Powered by Google App Engine
This is Rietveld 408576698