| 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..6370c54e9b19956f0e817323db7bfaf5e4a550a9 100644
|
| --- a/components/policy/core/common/async_policy_provider_unittest.cc
|
| +++ b/components/policy/core/common/async_policy_provider_unittest.cc
|
| @@ -45,11 +45,11 @@ 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
|
| - // 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;
|
| + // Load() returns a std::unique_ptr<PolicyBundle> but it can't be mocked
|
| + // because std::unique_ptr is moveable but not copyable. This override
|
| + // forwards the call to MockLoad() which returns a PolicyBundle*, and returns
|
| + // a copy wrapped in a std::unique_ptr.
|
| + std::unique_ptr<PolicyBundle> Load() override;
|
|
|
| MOCK_METHOD0(MockLoad, const PolicyBundle*());
|
| MOCK_METHOD0(InitOnBackgroundThread, void());
|
| @@ -65,8 +65,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 +89,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 +108,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_));
|
|
|