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/mock_configuration_policy_provider.h" | 5 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 void MockConfigurationPolicyProvider::UpdateChromePolicy( | 22 void MockConfigurationPolicyProvider::UpdateChromePolicy( |
23 const PolicyMap& policy) { | 23 const PolicyMap& policy) { |
24 scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); | 24 scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); |
25 bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 25 bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
26 .CopyFrom(policy); | 26 .CopyFrom(policy); |
27 UpdatePolicy(bundle.Pass()); | 27 UpdatePolicy(bundle.Pass()); |
28 if (base::MessageLoop::current()) | 28 if (base::MessageLoop::current()) |
29 base::RunLoop().RunUntilIdle(); | 29 base::RunLoop().RunUntilIdle(); |
30 } | 30 } |
31 | 31 |
32 PolicySource MockConfigurationPolicyProvider::source() const { | |
Thiemo Nagel
2015/09/01 17:40:37
Remove.
fhorschig
2015/09/04 06:53:54
Done.
| |
33 return POLICY_SOURCE_DEFAULT; | |
34 } | |
35 | |
32 void MockConfigurationPolicyProvider::SetAutoRefresh() { | 36 void MockConfigurationPolicyProvider::SetAutoRefresh() { |
33 EXPECT_CALL(*this, RefreshPolicies()).WillRepeatedly( | 37 EXPECT_CALL(*this, RefreshPolicies()).WillRepeatedly( |
34 Invoke(this, &MockConfigurationPolicyProvider::RefreshWithSamePolicies)); | 38 Invoke(this, &MockConfigurationPolicyProvider::RefreshWithSamePolicies)); |
35 } | 39 } |
36 | 40 |
37 void MockConfigurationPolicyProvider::RefreshWithSamePolicies() { | 41 void MockConfigurationPolicyProvider::RefreshWithSamePolicies() { |
38 scoped_ptr<PolicyBundle> bundle(new PolicyBundle); | 42 scoped_ptr<PolicyBundle> bundle(new PolicyBundle); |
39 bundle->CopyFrom(policies()); | 43 bundle->CopyFrom(policies()); |
40 UpdatePolicy(bundle.Pass()); | 44 UpdatePolicy(bundle.Pass()); |
41 } | 45 } |
42 | 46 |
43 MockConfigurationPolicyObserver::MockConfigurationPolicyObserver() {} | 47 MockConfigurationPolicyObserver::MockConfigurationPolicyObserver() {} |
44 | 48 |
45 MockConfigurationPolicyObserver::~MockConfigurationPolicyObserver() {} | 49 MockConfigurationPolicyObserver::~MockConfigurationPolicyObserver() {} |
46 | 50 |
47 } // namespace policy | 51 } // namespace policy |
OLD | NEW |