| 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 <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "build/build_config.h" |
| 15 #include "components/policy/core/common/policy_types.h" | 16 #include "components/policy/core/common/policy_types.h" |
| 16 #include "components/policy/core/common/schema.h" | 17 #include "components/policy/core/common/schema.h" |
| 17 #include "components/policy/core/common/schema_registry.h" | 18 #include "components/policy/core/common/schema_registry.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 20 |
| 21 #if defined(OS_POSIX) |
| 22 #include "base/files/file_descriptor_watcher_posix.h" |
| 23 #endif |
| 24 |
| 20 namespace base { | 25 namespace base { |
| 21 class DictionaryValue; | 26 class DictionaryValue; |
| 22 class ListValue; | 27 class ListValue; |
| 23 class SequencedTaskRunner; | 28 class SequencedTaskRunner; |
| 24 class Value; | 29 class Value; |
| 25 } | 30 } |
| 26 | 31 |
| 27 namespace policy { | 32 namespace policy { |
| 28 | 33 |
| 29 class ConfigurationPolicyProvider; | 34 class ConfigurationPolicyProvider; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 47 // testing::Test: | 52 // testing::Test: |
| 48 void SetUp() override; | 53 void SetUp() override; |
| 49 void TearDown() override; | 54 void TearDown() override; |
| 50 | 55 |
| 51 protected: | 56 protected: |
| 52 bool RegisterSchema(const PolicyNamespace& ns, | 57 bool RegisterSchema(const PolicyNamespace& ns, |
| 53 const std::string& schema); | 58 const std::string& schema); |
| 54 | 59 |
| 55 SchemaRegistry schema_registry_; | 60 SchemaRegistry schema_registry_; |
| 56 | 61 |
| 57 // Create an actual IO loop (needed by FilePathWatcher). | 62 // Needed by FilePathWatcher, which is used by ConfigDirPolicyLoader and |
| 63 // PolicyLoaderMac. |
| 58 base::MessageLoopForIO loop_; | 64 base::MessageLoopForIO loop_; |
| 65 #if defined(OS_POSIX) |
| 66 base::FileDescriptorWatcher file_descriptor_watcher_; |
| 67 #endif |
| 59 | 68 |
| 60 private: | 69 private: |
| 61 DISALLOW_COPY_AND_ASSIGN(PolicyTestBase); | 70 DISALLOW_COPY_AND_ASSIGN(PolicyTestBase); |
| 62 }; | 71 }; |
| 63 | 72 |
| 64 // An interface for creating a test policy provider and creating a policy | 73 // An interface for creating a test policy provider and creating a policy |
| 65 // provider instance for testing. Used as the parameter to the abstract | 74 // provider instance for testing. Used as the parameter to the abstract |
| 66 // ConfigurationPolicyProviderTest below. | 75 // ConfigurationPolicyProviderTest below. |
| 67 class PolicyProviderTestHarness { | 76 class PolicyProviderTestHarness { |
| 68 public: | 77 public: |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 Configuration3rdPartyPolicyProviderTest(); | 175 Configuration3rdPartyPolicyProviderTest(); |
| 167 virtual ~Configuration3rdPartyPolicyProviderTest(); | 176 virtual ~Configuration3rdPartyPolicyProviderTest(); |
| 168 | 177 |
| 169 private: | 178 private: |
| 170 DISALLOW_COPY_AND_ASSIGN(Configuration3rdPartyPolicyProviderTest); | 179 DISALLOW_COPY_AND_ASSIGN(Configuration3rdPartyPolicyProviderTest); |
| 171 }; | 180 }; |
| 172 | 181 |
| 173 } // namespace policy | 182 } // namespace policy |
| 174 | 183 |
| 175 #endif // COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ | 184 #endif // COMPONENTS_POLICY_CORE_COMMON_CONFIGURATION_POLICY_PROVIDER_TEST_H_ |
| OLD | NEW |