OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_CONFIGURATION_POLICY_PREF_STORE_TEST_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_PREF_STORE_TEST_H_ |
6 #define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_PREF_STORE_TEST_H_ | 6 #define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_PREF_STORE_TEST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "components/policy/core/browser/configuration_policy_handler_list.h" | 12 #include "components/policy/core/browser/configuration_policy_handler_list.h" |
13 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 13 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
14 #include "components/policy/core/common/policy_service_impl.h" | 14 #include "components/policy/core/common/policy_service_impl.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace policy { | 17 namespace policy { |
18 | 18 |
19 struct PolicyHandlerParameters; | 19 struct PolicyHandlerParameters; |
20 class PolicyMap; | 20 class PolicyMap; |
21 class PolicyService; | 21 class PolicyService; |
22 class ConfigurationPolicyPrefStore; | 22 class ConfigurationPolicyPrefStore; |
23 | 23 |
24 class ConfigurationPolicyPrefStoreTest : public testing::Test { | 24 class ConfigurationPolicyPrefStoreTest : public testing::Test { |
25 protected: | 25 protected: |
26 ConfigurationPolicyPrefStoreTest(); | 26 ConfigurationPolicyPrefStoreTest(); |
27 virtual ~ConfigurationPolicyPrefStoreTest(); | 27 ~ConfigurationPolicyPrefStoreTest() override; |
28 virtual void TearDown() override; | 28 void TearDown() override; |
29 void UpdateProviderPolicy(const PolicyMap& policy); | 29 void UpdateProviderPolicy(const PolicyMap& policy); |
30 | 30 |
31 // A unit test can override this method to populate the policy handler | 31 // A unit test can override this method to populate the policy handler |
32 // parameters as suited to its needs. | 32 // parameters as suited to its needs. |
33 virtual void PopulatePolicyHandlerParameters( | 33 virtual void PopulatePolicyHandlerParameters( |
34 PolicyHandlerParameters* parameters); | 34 PolicyHandlerParameters* parameters); |
35 | 35 |
36 PolicyServiceImpl::Providers providers_; | 36 PolicyServiceImpl::Providers providers_; |
37 ConfigurationPolicyHandlerList handler_list_; | 37 ConfigurationPolicyHandlerList handler_list_; |
38 MockConfigurationPolicyProvider provider_; | 38 MockConfigurationPolicyProvider provider_; |
39 scoped_ptr<PolicyService> policy_service_; | 39 scoped_ptr<PolicyService> policy_service_; |
40 scoped_refptr<ConfigurationPolicyPrefStore> store_; | 40 scoped_refptr<ConfigurationPolicyPrefStore> store_; |
41 base::MessageLoop loop_; | 41 base::MessageLoop loop_; |
42 | 42 |
43 private: | 43 private: |
44 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStoreTest); | 44 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStoreTest); |
45 }; | 45 }; |
46 | 46 |
47 } // namespace policy | 47 } // namespace policy |
48 | 48 |
49 #endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_PREF_STORE_TEST_H
_ | 49 #endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_PREF_STORE_TEST_H
_ |
OLD | NEW |