OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_TEST_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_TEST_H_ |
6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_TEST_H_ | 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_TEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Abstract policy provider test. This is meant to be instantiated for each | 83 // Abstract policy provider test. This is meant to be instantiated for each |
84 // policy provider implementation, passing in a suitable harness factory | 84 // policy provider implementation, passing in a suitable harness factory |
85 // function as the test parameter. | 85 // function as the test parameter. |
86 class ConfigurationPolicyProviderTest | 86 class ConfigurationPolicyProviderTest |
87 : public AsynchronousPolicyTestBase, | 87 : public AsynchronousPolicyTestBase, |
88 public testing::WithParamInterface<CreatePolicyProviderTestHarness> { | 88 public testing::WithParamInterface<CreatePolicyProviderTestHarness> { |
89 protected: | 89 protected: |
90 ConfigurationPolicyProviderTest(); | 90 ConfigurationPolicyProviderTest(); |
91 virtual ~ConfigurationPolicyProviderTest(); | 91 virtual ~ConfigurationPolicyProviderTest(); |
92 | 92 |
93 virtual void SetUp(); | 93 virtual void SetUp() OVERRIDE; |
94 virtual void TearDown(); | 94 virtual void TearDown() OVERRIDE; |
95 | 95 |
96 // Installs a valid policy and checks whether the provider returns the | 96 // Installs a valid policy and checks whether the provider returns the |
97 // |expected_value|. | 97 // |expected_value|. |
98 void CheckValue(const char* policy_name, | 98 void CheckValue(const char* policy_name, |
99 ConfigurationPolicyType policy_type, | 99 ConfigurationPolicyType policy_type, |
100 const base::Value& expected_value, | 100 const base::Value& expected_value, |
101 base::Closure install_value); | 101 base::Closure install_value); |
102 | 102 |
103 scoped_ptr<PolicyProviderTestHarness> test_harness_; | 103 scoped_ptr<PolicyProviderTestHarness> test_harness_; |
104 scoped_ptr<AsynchronousPolicyProvider> provider_; | 104 scoped_ptr<AsynchronousPolicyProvider> provider_; |
105 | 105 |
106 private: | 106 private: |
107 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderTest); | 107 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderTest); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace policy | 110 } // namespace policy |
111 | 111 |
112 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_TEST_H_ | 112 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_TEST_H_ |
OLD | NEW |