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

Unified Diff: chrome/browser/prefs/proxy_policy_unittest.cc

Issue 10386097: Refactored ConfigurationPolicyProvider to provide PolicyBundles instead of PolicyMaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 7 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
« no previous file with comments | « chrome/browser/policy/policy_service_unittest.cc ('k') | chrome/browser/ui/webui/policy_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/proxy_policy_unittest.cc
diff --git a/chrome/browser/prefs/proxy_policy_unittest.cc b/chrome/browser/prefs/proxy_policy_unittest.cc
index c4b07ace10e12ba06f2c546f9ca7287b5481a627..3c7cd2f648f15496d3d60476e4ab45cad04c000c 100644
--- a/chrome/browser/prefs/proxy_policy_unittest.cc
+++ b/chrome/browser/prefs/proxy_policy_unittest.cc
@@ -79,8 +79,6 @@ class ProxyPolicyTest : public testing::Test {
: command_line_(CommandLine::NO_PROGRAM) {}
virtual void SetUp() OVERRIDE {
- EXPECT_CALL(provider_, ProvideInternal(_))
- .WillRepeatedly(CopyPolicyMap(&policy_));
EXPECT_CALL(provider_, IsInitializationComplete())
.WillRepeatedly(Return(true));
@@ -100,7 +98,6 @@ class ProxyPolicyTest : public testing::Test {
}
CommandLine command_line_;
- PolicyMap policy_;
MockConfigurationPolicyProvider provider_;
scoped_ptr<PolicyServiceImpl> policy_service_;
};
@@ -110,13 +107,14 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) {
command_line_.AppendSwitchASCII(switches::kProxyServer, "789");
Value* mode_name = Value::CreateStringValue(
ProxyPrefs::kFixedServersProxyModeName);
- policy_.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- mode_name);
- policy_.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- Value::CreateStringValue("abc"));
- policy_.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- Value::CreateStringValue("ghi"));
- provider_.NotifyPolicyUpdated();
+ PolicyMap policy;
+ policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ mode_name);
+ policy.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ Value::CreateStringValue("abc"));
+ policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ Value::CreateStringValue("ghi"));
+ provider_.UpdateChromePolicy(policy);
// First verify that command-line options are set correctly when
// there is no policy in effect.
@@ -143,9 +141,10 @@ TEST_F(ProxyPolicyTest, OverridesUnrelatedCommandLineOptions) {
command_line_.AppendSwitchASCII(switches::kProxyServer, "789");
Value* mode_name = Value::CreateStringValue(
ProxyPrefs::kAutoDetectProxyModeName);
- policy_.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- mode_name);
- provider_.NotifyPolicyUpdated();
+ PolicyMap policy;
+ policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ mode_name);
+ provider_.UpdateChromePolicy(policy);
// First verify that command-line options are set correctly when
// there is no policy in effect.
@@ -169,9 +168,10 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineNoProxy) {
command_line_.AppendSwitch(switches::kNoProxyServer);
Value* mode_name = Value::CreateStringValue(
ProxyPrefs::kAutoDetectProxyModeName);
- policy_.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- mode_name);
- provider_.NotifyPolicyUpdated();
+ PolicyMap policy;
+ policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ mode_name);
+ provider_.UpdateChromePolicy(policy);
// First verify that command-line options are set correctly when
// there is no policy in effect.
@@ -191,9 +191,10 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineAutoDetect) {
command_line_.AppendSwitch(switches::kProxyAutoDetect);
Value* mode_name = Value::CreateStringValue(
ProxyPrefs::kDirectProxyModeName);
- policy_.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- mode_name);
- provider_.NotifyPolicyUpdated();
+ PolicyMap policy;
+ policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ mode_name);
+ provider_.UpdateChromePolicy(policy);
// First verify that the auto-detect is set if there is no managed
// PrefStore.
« no previous file with comments | « chrome/browser/policy/policy_service_unittest.cc ('k') | chrome/browser/ui/webui/policy_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698