Chromium Code Reviews| Index: components/policy/core/common/async_policy_provider_unittest.cc |
| diff --git a/components/policy/core/common/async_policy_provider_unittest.cc b/components/policy/core/common/async_policy_provider_unittest.cc |
| index b81c132d93c134e13167c3f7fbb0f8347996cbbc..352c510d5d3e636b61c9aebaeca92e566fd371e3 100644 |
| --- a/components/policy/core/common/async_policy_provider_unittest.cc |
| +++ b/components/policy/core/common/async_policy_provider_unittest.cc |
| @@ -45,11 +45,12 @@ class MockPolicyLoader : public AsyncPolicyLoader { |
| scoped_refptr<base::SequencedTaskRunner> task_runner); |
| ~MockPolicyLoader() override; |
| - // Load() returns a scoped_ptr<PolicyBundle> but it can't be mocked because |
| + // Load() returns a std::unique_ptr<PolicyBundle> but it can't be mocked |
| + // because |
|
Thiemo Nagel
2016/04/20 20:34:19
Please fix line wrapping and convert in-comment me
dcheng
2016/04/20 20:56:31
Done.
|
| // scoped_ptr is moveable but not copyable. This override forwards the |
| // call to MockLoad() which returns a PolicyBundle*, and returns a copy |
| // wrapped in a passed scoped_ptr. |
| - scoped_ptr<PolicyBundle> Load() override; |
| + std::unique_ptr<PolicyBundle> Load() override; |
| MOCK_METHOD0(MockLoad, const PolicyBundle*()); |
| MOCK_METHOD0(InitOnBackgroundThread, void()); |
| @@ -65,8 +66,8 @@ MockPolicyLoader::MockPolicyLoader( |
| MockPolicyLoader::~MockPolicyLoader() {} |
| -scoped_ptr<PolicyBundle> MockPolicyLoader::Load() { |
| - scoped_ptr<PolicyBundle> bundle; |
| +std::unique_ptr<PolicyBundle> MockPolicyLoader::Load() { |
| + std::unique_ptr<PolicyBundle> bundle; |
| const PolicyBundle* loaded = MockLoad(); |
| if (loaded) { |
| bundle.reset(new PolicyBundle()); |
| @@ -89,7 +90,7 @@ class AsyncPolicyProviderTest : public testing::Test { |
| SchemaRegistry schema_registry_; |
| PolicyBundle initial_bundle_; |
| MockPolicyLoader* loader_; |
| - scoped_ptr<AsyncPolicyProvider> provider_; |
| + std::unique_ptr<AsyncPolicyProvider> provider_; |
| private: |
| DISALLOW_COPY_AND_ASSIGN(AsyncPolicyProviderTest); |
| @@ -108,7 +109,7 @@ void AsyncPolicyProviderTest::SetUp() { |
| EXPECT_CALL(*loader_, MockLoad()).WillOnce(Return(&initial_bundle_)); |
| provider_.reset(new AsyncPolicyProvider( |
| - &schema_registry_, scoped_ptr<AsyncPolicyLoader>(loader_))); |
| + &schema_registry_, std::unique_ptr<AsyncPolicyLoader>(loader_))); |
| provider_->Init(&schema_registry_); |
| // Verify that the initial load is done synchronously: |
| EXPECT_TRUE(provider_->policies().Equals(initial_bundle_)); |