| 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 <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "components/policy/core/common/policy_types.h" | 15 #include "components/policy/core/common/policy_types.h" |
| 16 #include "components/policy/core/common/schema.h" | 16 #include "components/policy/core/common/schema.h" |
| 17 #include "components/policy/core/common/schema_registry.h" | 17 #include "components/policy/core/common/schema_registry.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class DictionaryValue; | 21 class DictionaryValue; |
| 22 class ListValue; | 22 class ListValue; |
| 23 class SequencedTaskRunner; | 23 class SequencedTaskRunner; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 void SetUp() override; | 127 void SetUp() override; |
| 128 void TearDown() override; | 128 void TearDown() override; |
| 129 | 129 |
| 130 // Installs a valid policy and checks whether the provider returns the | 130 // Installs a valid policy and checks whether the provider returns the |
| 131 // |expected_value|. | 131 // |expected_value|. |
| 132 void CheckValue(const char* policy_name, | 132 void CheckValue(const char* policy_name, |
| 133 const base::Value& expected_value, | 133 const base::Value& expected_value, |
| 134 base::Closure install_value); | 134 base::Closure install_value); |
| 135 | 135 |
| 136 scoped_ptr<PolicyProviderTestHarness> test_harness_; | 136 std::unique_ptr<PolicyProviderTestHarness> test_harness_; |
| 137 scoped_ptr<ConfigurationPolicyProvider> provider_; | 137 std::unique_ptr<ConfigurationPolicyProvider> provider_; |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderTest); | 140 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderTest); |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 // An extension of ConfigurationPolicyProviderTest that also tests loading of | 143 // An extension of ConfigurationPolicyProviderTest that also tests loading of |
| 144 // 3rd party policy. Policy provider implementations that support loading of | 144 // 3rd party policy. Policy provider implementations that support loading of |
| 145 // 3rd party policy should also instantiate these tests. | 145 // 3rd party policy should also instantiate these tests. |
| 146 class Configuration3rdPartyPolicyProviderTest | 146 class Configuration3rdPartyPolicyProviderTest |
| 147 : public ConfigurationPolicyProviderTest { | 147 : public ConfigurationPolicyProviderTest { |
| 148 protected: | 148 protected: |
| 149 Configuration3rdPartyPolicyProviderTest(); | 149 Configuration3rdPartyPolicyProviderTest(); |
| 150 virtual ~Configuration3rdPartyPolicyProviderTest(); | 150 virtual ~Configuration3rdPartyPolicyProviderTest(); |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 DISALLOW_COPY_AND_ASSIGN(Configuration3rdPartyPolicyProviderTest); | 153 DISALLOW_COPY_AND_ASSIGN(Configuration3rdPartyPolicyProviderTest); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 } // namespace policy | 156 } // namespace policy |
| 157 | 157 |
| 158 #endif // COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ | 158 #endif // COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ |
| OLD | NEW |