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

Side by Side Diff: chrome/browser/policy/configuration_policy_provider_mac_unittest.cc

Issue 6002015: Policy: generate boilerplate policy type and constant code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge with ToT Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 6
7 #include "base/mac/scoped_cftyperef.h" 7 #include "base/mac/scoped_cftyperef.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/browser/policy/configuration_policy_pref_store.h" 10 #include "chrome/browser/policy/configuration_policy_pref_store.h"
11 #include "chrome/browser/policy/configuration_policy_provider_mac.h" 11 #include "chrome/browser/policy/configuration_policy_provider_mac.h"
12 #include "chrome/browser/policy/mock_configuration_policy_store.h" 12 #include "chrome/browser/policy/mock_configuration_policy_store.h"
13 #include "chrome/browser/preferences_mock_mac.h" 13 #include "chrome/browser/preferences_mock_mac.h"
14 #include "chrome/common/policy_constants.h" 14 #include "policy/policy_constants.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace policy { 17 namespace policy {
18 18
19 // Holds parameters for the parametrized policy tests. 19 // Holds parameters for the parametrized policy tests.
20 class PolicyTestParams { 20 class PolicyTestParams {
21 public: 21 public:
22 // Takes ownership of |test_value|. 22 // Takes ownership of |test_value|.
23 PolicyTestParams(ConfigurationPolicyType type, 23 PolicyTestParams(ConfigurationPolicyType type,
24 const char* policy_name, 24 const char* policy_name,
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 ASSERT_TRUE(value); 193 ASSERT_TRUE(value);
194 EXPECT_TRUE(GetParam().test_value()->Equals(value)); 194 EXPECT_TRUE(GetParam().test_value()->Equals(value));
195 } 195 }
196 196
197 // Instantiate the test case for all policies. 197 // Instantiate the test case for all policies.
198 INSTANTIATE_TEST_CASE_P( 198 INSTANTIATE_TEST_CASE_P(
199 ConfigurationPolicyProviderMacTestInstance, 199 ConfigurationPolicyProviderMacTestInstance,
200 ConfigurationPolicyProviderMacTest, 200 ConfigurationPolicyProviderMacTest,
201 testing::Values( 201 testing::Values(
202 PolicyTestParams::ForStringPolicy( 202 PolicyTestParams::ForStringPolicy(
203 kPolicyHomePage, 203 kPolicyHomepageLocation,
204 key::kHomepageLocation), 204 key::kHomepageLocation),
205 PolicyTestParams::ForBooleanPolicy( 205 PolicyTestParams::ForBooleanPolicy(
206 kPolicyHomepageIsNewTabPage, 206 kPolicyHomepageIsNewTabPage,
207 key::kHomepageIsNewTabPage), 207 key::kHomepageIsNewTabPage),
208 PolicyTestParams::ForIntegerPolicy( 208 PolicyTestParams::ForIntegerPolicy(
209 kPolicyRestoreOnStartup, 209 kPolicyRestoreOnStartup,
210 key::kRestoreOnStartup), 210 key::kRestoreOnStartup),
211 PolicyTestParams::ForListPolicy( 211 PolicyTestParams::ForListPolicy(
212 kPolicyURLsToRestoreOnStartup, 212 kPolicyRestoreOnStartupURLs,
213 key::kURLsToRestoreOnStartup), 213 key::kRestoreOnStartupURLs),
214 PolicyTestParams::ForBooleanPolicy( 214 PolicyTestParams::ForBooleanPolicy(
215 kPolicyDefaultSearchProviderEnabled, 215 kPolicyDefaultSearchProviderEnabled,
216 key::kDefaultSearchProviderEnabled), 216 key::kDefaultSearchProviderEnabled),
217 PolicyTestParams::ForStringPolicy( 217 PolicyTestParams::ForStringPolicy(
218 kPolicyDefaultSearchProviderName, 218 kPolicyDefaultSearchProviderName,
219 key::kDefaultSearchProviderName), 219 key::kDefaultSearchProviderName),
220 PolicyTestParams::ForStringPolicy( 220 PolicyTestParams::ForStringPolicy(
221 kPolicyDefaultSearchProviderKeyword, 221 kPolicyDefaultSearchProviderKeyword,
222 key::kDefaultSearchProviderKeyword), 222 key::kDefaultSearchProviderKeyword),
223 PolicyTestParams::ForStringPolicy( 223 PolicyTestParams::ForStringPolicy(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 PolicyTestParams::ForBooleanPolicy( 271 PolicyTestParams::ForBooleanPolicy(
272 kPolicyPasswordManagerAllowShowPasswords, 272 kPolicyPasswordManagerAllowShowPasswords,
273 key::kPasswordManagerAllowShowPasswords), 273 key::kPasswordManagerAllowShowPasswords),
274 PolicyTestParams::ForListPolicy( 274 PolicyTestParams::ForListPolicy(
275 kPolicyDisabledPlugins, 275 kPolicyDisabledPlugins,
276 key::kDisabledPlugins), 276 key::kDisabledPlugins),
277 PolicyTestParams::ForBooleanPolicy( 277 PolicyTestParams::ForBooleanPolicy(
278 kPolicyAutoFillEnabled, 278 kPolicyAutoFillEnabled,
279 key::kAutoFillEnabled), 279 key::kAutoFillEnabled),
280 PolicyTestParams::ForStringPolicy( 280 PolicyTestParams::ForStringPolicy(
281 kPolicyApplicationLocale, 281 kPolicyApplicationLocaleValue,
282 key::kApplicationLocaleValue), 282 key::kApplicationLocaleValue),
283 PolicyTestParams::ForBooleanPolicy( 283 PolicyTestParams::ForBooleanPolicy(
284 kPolicySyncDisabled, 284 kPolicySyncDisabled,
285 key::kSyncDisabled), 285 key::kSyncDisabled),
286 PolicyTestParams::ForListPolicy( 286 PolicyTestParams::ForListPolicy(
287 kPolicyExtensionInstallAllowList, 287 kPolicyExtensionInstallWhitelist,
288 key::kExtensionInstallAllowList), 288 key::kExtensionInstallWhitelist),
289 PolicyTestParams::ForListPolicy( 289 PolicyTestParams::ForListPolicy(
290 kPolicyExtensionInstallDenyList, 290 kPolicyExtensionInstallBlacklist,
291 key::kExtensionInstallDenyList), 291 key::kExtensionInstallBlacklist),
292 PolicyTestParams::ForBooleanPolicy( 292 PolicyTestParams::ForBooleanPolicy(
293 kPolicyShowHomeButton, 293 kPolicyShowHomeButton,
294 key::kShowHomeButton), 294 key::kShowHomeButton),
295 PolicyTestParams::ForBooleanPolicy( 295 PolicyTestParams::ForBooleanPolicy(
296 kPolicyPrintingEnabled, 296 kPolicyPrintingEnabled,
297 key::kPrintingEnabled), 297 key::kPrintingEnabled),
298 PolicyTestParams::ForIntegerPolicy( 298 PolicyTestParams::ForIntegerPolicy(
299 kPolicyPolicyRefreshRate, 299 kPolicyPolicyRefreshRate,
300 key::kPolicyRefreshRate))); 300 key::kPolicyRefreshRate)));
301 301
302 } // namespace policy 302 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698