| 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_CONFIGURATION_POLICY_PROVIDER_TEST_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 extern const char kKeyDictionary[]; | 37 extern const char kKeyDictionary[]; |
| 38 | 38 |
| 39 } // namespace test_keys | 39 } // namespace test_keys |
| 40 | 40 |
| 41 class PolicyTestBase : public testing::Test { | 41 class PolicyTestBase : public testing::Test { |
| 42 public: | 42 public: |
| 43 PolicyTestBase(); | 43 PolicyTestBase(); |
| 44 virtual ~PolicyTestBase(); | 44 virtual ~PolicyTestBase(); |
| 45 | 45 |
| 46 // testing::Test: | 46 // testing::Test: |
| 47 virtual void SetUp() OVERRIDE; | 47 virtual void SetUp() override; |
| 48 virtual void TearDown() OVERRIDE; | 48 virtual void TearDown() override; |
| 49 | 49 |
| 50 protected: | 50 protected: |
| 51 bool RegisterSchema(const PolicyNamespace& ns, | 51 bool RegisterSchema(const PolicyNamespace& ns, |
| 52 const std::string& schema); | 52 const std::string& schema); |
| 53 | 53 |
| 54 SchemaRegistry schema_registry_; | 54 SchemaRegistry schema_registry_; |
| 55 | 55 |
| 56 // Create an actual IO loop (needed by FilePathWatcher). | 56 // Create an actual IO loop (needed by FilePathWatcher). |
| 57 base::MessageLoopForIO loop_; | 57 base::MessageLoopForIO loop_; |
| 58 | 58 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Abstract policy provider test. This is meant to be instantiated for each | 113 // Abstract policy provider test. This is meant to be instantiated for each |
| 114 // policy provider implementation, passing in a suitable harness factory | 114 // policy provider implementation, passing in a suitable harness factory |
| 115 // function as the test parameter. | 115 // function as the test parameter. |
| 116 class ConfigurationPolicyProviderTest | 116 class ConfigurationPolicyProviderTest |
| 117 : public PolicyTestBase, | 117 : public PolicyTestBase, |
| 118 public testing::WithParamInterface<CreatePolicyProviderTestHarness> { | 118 public testing::WithParamInterface<CreatePolicyProviderTestHarness> { |
| 119 protected: | 119 protected: |
| 120 ConfigurationPolicyProviderTest(); | 120 ConfigurationPolicyProviderTest(); |
| 121 virtual ~ConfigurationPolicyProviderTest(); | 121 virtual ~ConfigurationPolicyProviderTest(); |
| 122 | 122 |
| 123 virtual void SetUp() OVERRIDE; | 123 virtual void SetUp() override; |
| 124 virtual void TearDown() OVERRIDE; | 124 virtual void TearDown() override; |
| 125 | 125 |
| 126 // Installs a valid policy and checks whether the provider returns the | 126 // Installs a valid policy and checks whether the provider returns the |
| 127 // |expected_value|. | 127 // |expected_value|. |
| 128 void CheckValue(const char* policy_name, | 128 void CheckValue(const char* policy_name, |
| 129 const base::Value& expected_value, | 129 const base::Value& expected_value, |
| 130 base::Closure install_value); | 130 base::Closure install_value); |
| 131 | 131 |
| 132 scoped_ptr<PolicyProviderTestHarness> test_harness_; | 132 scoped_ptr<PolicyProviderTestHarness> test_harness_; |
| 133 scoped_ptr<ConfigurationPolicyProvider> provider_; | 133 scoped_ptr<ConfigurationPolicyProvider> provider_; |
| 134 | 134 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 145 Configuration3rdPartyPolicyProviderTest(); | 145 Configuration3rdPartyPolicyProviderTest(); |
| 146 virtual ~Configuration3rdPartyPolicyProviderTest(); | 146 virtual ~Configuration3rdPartyPolicyProviderTest(); |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 DISALLOW_COPY_AND_ASSIGN(Configuration3rdPartyPolicyProviderTest); | 149 DISALLOW_COPY_AND_ASSIGN(Configuration3rdPartyPolicyProviderTest); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 } // namespace policy | 152 } // namespace policy |
| 153 | 153 |
| 154 #endif // COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ | 154 #endif // COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ |
| OLD | NEW |