diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 16:46:17 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 16:46:17 +0000 |
commit | c22edd63437194368b171c30cd6be75ba035c2e5 (patch) | |
tree | 8ec0ff419e0c193cc2c502ea2037c90dc94d8d96 /chrome/browser/policy/configuration_policy_provider_mac.cc | |
parent | 1402a942bf08d8ae241a65a55c6a657c65be39b5 (diff) | |
download | chromium_src-c22edd63437194368b171c30cd6be75ba035c2e5.zip chromium_src-c22edd63437194368b171c30cd6be75ba035c2e5.tar.gz chromium_src-c22edd63437194368b171c30cd6be75ba035c2e5.tar.bz2 |
Clean up policy tests.
Refactor the unit tests for the various ConfigurationPolicyProvider implementations and the ConfigurationPolicyPrefStore, so they are more modular and it becomes easy to add tests for new policies. Also make sure all the existing policies get test coverage.
BUG=none
TEST=compiles and passes unit tests
Review URL: http://codereview.chromium.org/3311005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/policy/configuration_policy_provider_mac.cc')
-rw-r--r-- | chrome/browser/policy/configuration_policy_provider_mac.cc | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/chrome/browser/policy/configuration_policy_provider_mac.cc b/chrome/browser/policy/configuration_policy_provider_mac.cc index 8f86142..185995a 100644 --- a/chrome/browser/policy/configuration_policy_provider_mac.cc +++ b/chrome/browser/policy/configuration_policy_provider_mac.cc @@ -22,8 +22,7 @@ ConfigurationPolicyProviderMac::ConfigurationPolicyProviderMac( } bool ConfigurationPolicyProviderMac::Provide(ConfigurationPolicyStore* store) { - bool success = true; - const PolicyValueMap& mapping(policy_value_map()); + const PolicyValueMap& mapping = policy_value_map(); for (PolicyValueMap::const_iterator current = mapping.begin(); current != mapping.end(); ++current) { @@ -44,8 +43,6 @@ bool ConfigurationPolicyProviderMac::Provide(ConfigurationPolicyStore* store) { store->Apply( current->policy_type, Value::CreateStringValue(string_value)); - } else { - success = false; } break; case Value::TYPE_BOOLEAN: @@ -53,8 +50,6 @@ bool ConfigurationPolicyProviderMac::Provide(ConfigurationPolicyStore* store) { bool bool_value = CFBooleanGetValue((CFBooleanRef)value.get()); store->Apply(current->policy_type, Value::CreateBooleanValue(bool_value)); - } else { - success = false; } break; case Value::TYPE_INTEGER: @@ -66,10 +61,6 @@ bool ConfigurationPolicyProviderMac::Provide(ConfigurationPolicyStore* store) { if (cast) store->Apply(current->policy_type, Value::CreateIntegerValue(int_value)); - else - success = false; - } else { - success = false; } break; case Value::TYPE_LIST: @@ -91,10 +82,6 @@ bool ConfigurationPolicyProviderMac::Provide(ConfigurationPolicyStore* store) { } if (valid_array) store->Apply(current->policy_type, list_value.release()); - else - success = false; - } else { - success = false; } break; default: @@ -103,7 +90,7 @@ bool ConfigurationPolicyProviderMac::Provide(ConfigurationPolicyStore* store) { } } - return success; + return true; } } // namespace policy |