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

Unified Diff: chrome/browser/policy/configuration_policy_provider_mac_unittest.cc

Issue 8258018: Generate Chrome policy definition list from policy_templates.json. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the unittest fix Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/configuration_policy_provider_mac_unittest.cc
diff --git a/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc b/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc
index 65833559ea58d0c4b830488d39cb66dd103dc827..f1dfe82fb68445fdefd7da7c69a1849b06eab617 100644
--- a/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_provider_mac_unittest.cc
@@ -140,7 +140,7 @@ class ConfigurationPolicyProviderMacTest
TEST_P(ConfigurationPolicyProviderMacTest, Default) {
ConfigurationPolicyProviderMac provider(
- ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), prefs_);
+ GetChromePolicyDefinitionList(), prefs_);
PolicyMap policy_map;
EXPECT_TRUE(provider.Provide(&policy_map));
EXPECT_TRUE(policy_map.empty());
@@ -155,7 +155,7 @@ TEST_P(ConfigurationPolicyProviderMacTest, Invalid) {
// Create the provider and have it read |prefs_|.
ConfigurationPolicyProviderMac provider(
- ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), prefs_);
+ GetChromePolicyDefinitionList(), prefs_);
PolicyMap policy_map;
EXPECT_TRUE(provider.Provide(&policy_map));
EXPECT_TRUE(policy_map.empty());
@@ -171,7 +171,7 @@ TEST_P(ConfigurationPolicyProviderMacTest, TestNonForcedValue) {
// Create the provider and have it read |prefs_|.
ConfigurationPolicyProviderMac provider(
- ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), prefs_);
+ GetChromePolicyDefinitionList(), prefs_);
PolicyMap policy_map;
EXPECT_TRUE(provider.Provide(&policy_map));
EXPECT_TRUE(policy_map.empty());
@@ -187,7 +187,7 @@ TEST_P(ConfigurationPolicyProviderMacTest, TestValue) {
// Create the provider and have it read |prefs_|.
ConfigurationPolicyProviderMac provider(
- ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), prefs_);
+ GetChromePolicyDefinitionList(), prefs_);
PolicyMap policy_map;
EXPECT_TRUE(provider.Provide(&policy_map));
ASSERT_EQ(1U, policy_map.size());
@@ -196,7 +196,9 @@ TEST_P(ConfigurationPolicyProviderMacTest, TestValue) {
EXPECT_TRUE(GetParam().test_value()->Equals(value));
}
-// Instantiate the test case for all policies.
+// Test parameters for all supported policies. testing::Values() has a limit of
+// 50 parameters which is reached in this instantiation; new policies should go
+// in the next instantiation after this one.
INSTANTIATE_TEST_CASE_P(
ConfigurationPolicyProviderMacTestInstance,
ConfigurationPolicyProviderMacTest,
@@ -306,9 +308,6 @@ INSTANTIATE_TEST_CASE_P(
PolicyTestParams::ForBooleanPolicy(
kPolicyInstantEnabled,
key::kInstantEnabled),
- PolicyTestParams::ForIntegerPolicy(
- kPolicyPolicyRefreshRate,
- key::kPolicyRefreshRate),
PolicyTestParams::ForBooleanPolicy(
kPolicyDisablePluginFinder,
key::kDisablePluginFinder),
@@ -350,7 +349,10 @@ INSTANTIATE_TEST_CASE_P(
key::kDiskCacheDir),
PolicyTestParams::ForIntegerPolicy(
kPolicyMaxConnectionsPerProxy,
- key::kMaxConnectionsPerProxy)));
+ key::kMaxConnectionsPerProxy),
+ PolicyTestParams::ForListPolicy(
+ kPolicyURLBlacklist,
+ key::kURLBlacklist)));
// testing::Values has a limit of 50 test templates, which is reached by the
// instantiations above. Add tests for new policies here:
@@ -359,9 +361,6 @@ INSTANTIATE_TEST_CASE_P(
ConfigurationPolicyProviderMacTest,
testing::Values(
PolicyTestParams::ForListPolicy(
- kPolicyURLBlacklist,
- key::kURLBlacklist),
- PolicyTestParams::ForListPolicy(
kPolicyURLWhitelist,
key::kURLWhitelist)));

Powered by Google App Engine
This is Rietveld 408576698