Chromium Code Reviews| 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 #ifndef COMPONENTS_POLICY_CORE_COMMON_MOCK_CONFIGURATION_POLICY_PROVIDER_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_MOCK_CONFIGURATION_POLICY_PROVIDER_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_MOCK_CONFIGURATION_POLICY_PROVIDER_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_MOCK_CONFIGURATION_POLICY_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "components/policy/core/common/configuration_policy_provider.h" | 9 #include "components/policy/core/common/configuration_policy_provider.h" |
| 10 #include "components/policy/core/common/policy_map.h" | 10 #include "components/policy/core/common/policy_map.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 // this mock. | 37 // this mock. |
| 38 using ConfigurationPolicyProvider::Init; | 38 using ConfigurationPolicyProvider::Init; |
| 39 void Init() { | 39 void Init() { |
| 40 ConfigurationPolicyProvider::Init(®istry_); | 40 ConfigurationPolicyProvider::Init(®istry_); |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Convenience method that installs an expectation on RefreshPolicies that | 43 // Convenience method that installs an expectation on RefreshPolicies that |
| 44 // just notifies the observers and serves the same policies. | 44 // just notifies the observers and serves the same policies. |
| 45 void SetAutoRefresh(); | 45 void SetAutoRefresh(); |
| 46 | 46 |
| 47 // Defines source. Will return POLICY_SOURCE_DEFAULT that is never used by any | |
| 48 // other provider. | |
| 49 PolicySource source() const override; | |
|
Thiemo Nagel
2015/09/01 17:40:37
Remove.
fhorschig
2015/09/04 06:53:54
Done.
| |
| 50 | |
| 47 private: | 51 private: |
| 48 void RefreshWithSamePolicies(); | 52 void RefreshWithSamePolicies(); |
| 49 | 53 |
| 50 SchemaRegistry registry_; | 54 SchemaRegistry registry_; |
| 51 | 55 |
| 52 DISALLOW_COPY_AND_ASSIGN(MockConfigurationPolicyProvider); | 56 DISALLOW_COPY_AND_ASSIGN(MockConfigurationPolicyProvider); |
| 53 }; | 57 }; |
| 54 | 58 |
| 55 class MockConfigurationPolicyObserver | 59 class MockConfigurationPolicyObserver |
| 56 : public ConfigurationPolicyProvider::Observer { | 60 : public ConfigurationPolicyProvider::Observer { |
| 57 public: | 61 public: |
| 58 MockConfigurationPolicyObserver(); | 62 MockConfigurationPolicyObserver(); |
| 59 virtual ~MockConfigurationPolicyObserver(); | 63 virtual ~MockConfigurationPolicyObserver(); |
| 60 | 64 |
| 61 MOCK_METHOD1(OnUpdatePolicy, void(ConfigurationPolicyProvider*)); | 65 MOCK_METHOD1(OnUpdatePolicy, void(ConfigurationPolicyProvider*)); |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 } // namespace policy | 68 } // namespace policy |
| 65 | 69 |
| 66 #endif // COMPONENTS_POLICY_CORE_COMMON_MOCK_CONFIGURATION_POLICY_PROVIDER_H_ | 70 #endif // COMPONENTS_POLICY_CORE_COMMON_MOCK_CONFIGURATION_POLICY_PROVIDER_H_ |
| OLD | NEW |