OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/policy/core/common/async_policy_provider.h" | 5 #include "components/policy/core/common/async_policy_provider.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 MockPolicyLoader::~MockPolicyLoader() {} | 66 MockPolicyLoader::~MockPolicyLoader() {} |
67 | 67 |
68 scoped_ptr<PolicyBundle> MockPolicyLoader::Load() { | 68 scoped_ptr<PolicyBundle> MockPolicyLoader::Load() { |
69 scoped_ptr<PolicyBundle> bundle; | 69 scoped_ptr<PolicyBundle> bundle; |
70 const PolicyBundle* loaded = MockLoad(); | 70 const PolicyBundle* loaded = MockLoad(); |
71 if (loaded) { | 71 if (loaded) { |
72 bundle.reset(new PolicyBundle()); | 72 bundle.reset(new PolicyBundle()); |
73 bundle->CopyFrom(*loaded); | 73 bundle->CopyFrom(*loaded); |
74 } | 74 } |
75 return bundle.Pass(); | 75 return bundle; |
76 } | 76 } |
77 | 77 |
78 } // namespace | 78 } // namespace |
79 | 79 |
80 class AsyncPolicyProviderTest : public testing::Test { | 80 class AsyncPolicyProviderTest : public testing::Test { |
81 protected: | 81 protected: |
82 AsyncPolicyProviderTest(); | 82 AsyncPolicyProviderTest(); |
83 ~AsyncPolicyProviderTest() override; | 83 ~AsyncPolicyProviderTest() override; |
84 | 84 |
85 void SetUp() override; | 85 void SetUp() override; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 EXPECT_CALL(observer, OnUpdatePolicy(provider_.get())).Times(0); | 220 EXPECT_CALL(observer, OnUpdatePolicy(provider_.get())).Times(0); |
221 provider_->Shutdown(); | 221 provider_->Shutdown(); |
222 loop_.RunUntilIdle(); | 222 loop_.RunUntilIdle(); |
223 Mock::VerifyAndClearExpectations(&observer); | 223 Mock::VerifyAndClearExpectations(&observer); |
224 | 224 |
225 provider_->RemoveObserver(&observer); | 225 provider_->RemoveObserver(&observer); |
226 provider_.reset(); | 226 provider_.reset(); |
227 } | 227 } |
228 | 228 |
229 } // namespace policy | 229 } // namespace policy |
OLD | NEW |