Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: chrome/browser/policy/configuration_policy_provider_test.h

Issue 10656046: Use a schema to decode 3rd party policy on windows, when present. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 virtual void InstallIntegerPolicy(const std::string& policy_name, 90 virtual void InstallIntegerPolicy(const std::string& policy_name,
91 int policy_value) = 0; 91 int policy_value) = 0;
92 virtual void InstallBooleanPolicy(const std::string& policy_name, 92 virtual void InstallBooleanPolicy(const std::string& policy_name,
93 bool policy_value) = 0; 93 bool policy_value) = 0;
94 virtual void InstallStringListPolicy(const std::string& policy_name, 94 virtual void InstallStringListPolicy(const std::string& policy_name,
95 const base::ListValue* policy_value) = 0; 95 const base::ListValue* policy_value) = 0;
96 virtual void InstallDictionaryPolicy( 96 virtual void InstallDictionaryPolicy(
97 const std::string& policy_name, 97 const std::string& policy_name,
98 const base::DictionaryValue* policy_value) = 0; 98 const base::DictionaryValue* policy_value) = 0;
99 99
100 // Not every provider supports installing 3rd party policy. Those who do
101 // should override this method; the default just makes the test fail.
102 virtual void Install3rdPartyPolicy(const base::DictionaryValue* policies);
103
100 private: 104 private:
101 PolicyLevel level_; 105 PolicyLevel level_;
102 PolicyScope scope_; 106 PolicyScope scope_;
103 107
104 DISALLOW_COPY_AND_ASSIGN(PolicyProviderTestHarness); 108 DISALLOW_COPY_AND_ASSIGN(PolicyProviderTestHarness);
105 }; 109 };
106 110
107 // A factory method for creating a test harness. 111 // A factory method for creating a test harness.
108 typedef PolicyProviderTestHarness* (*CreatePolicyProviderTestHarness)(); 112 typedef PolicyProviderTestHarness* (*CreatePolicyProviderTestHarness)();
109 113
(...skipping 16 matching lines...) Expand all
126 const base::Value& expected_value, 130 const base::Value& expected_value,
127 base::Closure install_value); 131 base::Closure install_value);
128 132
129 scoped_ptr<PolicyProviderTestHarness> test_harness_; 133 scoped_ptr<PolicyProviderTestHarness> test_harness_;
130 scoped_ptr<ConfigurationPolicyProvider> provider_; 134 scoped_ptr<ConfigurationPolicyProvider> provider_;
131 135
132 private: 136 private:
133 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderTest); 137 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProviderTest);
134 }; 138 };
135 139
140 // An extension of ConfigurationPolicyProviderTest that also tests loading of
141 // 3rd party policy. Policy provider implementations that support loading of
142 // 3rd party policy should also instantiate these tests.
143 class Configuration3rdPartyPolicyProviderTest
144 : public ConfigurationPolicyProviderTest {
145 protected:
146 Configuration3rdPartyPolicyProviderTest();
147 virtual ~Configuration3rdPartyPolicyProviderTest();
148
149 private:
150 DISALLOW_COPY_AND_ASSIGN(Configuration3rdPartyPolicyProviderTest);
151 };
152
136 } // namespace policy 153 } // namespace policy
137 154
138 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_TEST_H_ 155 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698