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

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

Issue 6021010: Fix setting a proxy configuration via policy that specifies a .pac file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback and fix tests Created 9 years, 12 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
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/file_path.h" 5 #include "base/file_path.h"
6 #include "chrome/browser/policy/configuration_policy_pref_store.h" 6 #include "chrome/browser/policy/configuration_policy_pref_store.h"
7 #include "chrome/browser/policy/mock_configuration_policy_provider.h" 7 #include "chrome/browser/policy/mock_configuration_policy_provider.h"
8 #include "chrome/browser/prefs/proxy_prefs.h" 8 #include "chrome/browser/prefs/proxy_prefs.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/notification_service.h" 10 #include "chrome/common/notification_service.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 Value::CreateIntegerValue(kPolicyAutoDetectProxyMode)); 311 Value::CreateIntegerValue(kPolicyAutoDetectProxyMode));
312 312
313 ConfigurationPolicyPrefStore store(&provider); 313 ConfigurationPolicyPrefStore store(&provider);
314 VerifyProxyPrefs(store, "", "", "", ProxyPrefs::MODE_AUTO_DETECT); 314 VerifyProxyPrefs(store, "", "", "", ProxyPrefs::MODE_AUTO_DETECT);
315 } 315 }
316 316
317 TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectPac) { 317 TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectPac) {
318 MockConfigurationPolicyProvider provider; 318 MockConfigurationPolicyProvider provider;
319 provider.AddPolicy(kPolicyProxyPacUrl, 319 provider.AddPolicy(kPolicyProxyPacUrl,
320 Value::CreateStringValue("http://short.org/proxy.pac")); 320 Value::CreateStringValue("http://short.org/proxy.pac"));
321 provider.AddPolicy(kPolicyProxyMode, 321 provider.AddPolicy(
322 Value::CreateIntegerValue(kPolicyAutoDetectProxyMode)); 322 kPolicyProxyMode,
323 Value::CreateIntegerValue(kPolicyManuallyConfiguredProxyMode));
323 324
324 ConfigurationPolicyPrefStore store(&provider); 325 ConfigurationPolicyPrefStore store(&provider);
325 VerifyProxyPrefs( 326 VerifyProxyPrefs(
326 store, "", "http://short.org/proxy.pac", "", ProxyPrefs::MODE_PAC_SCRIPT); 327 store, "", "http://short.org/proxy.pac", "", ProxyPrefs::MODE_PAC_SCRIPT);
327 } 328 }
328 329
329 TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystem) { 330 TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystem) {
330 MockConfigurationPolicyProvider provider; 331 MockConfigurationPolicyProvider provider;
331 provider.AddPolicy(kPolicyProxyMode, 332 provider.AddPolicy(kPolicyProxyMode,
332 Value::CreateIntegerValue(kPolicyUseSystemProxyMode)); 333 Value::CreateIntegerValue(kPolicyUseSystemProxyMode));
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 632
632 provider_.SetInitializationComplete(true); 633 provider_.SetInitializationComplete(true);
633 EXPECT_FALSE(store_.IsInitializationComplete()); 634 EXPECT_FALSE(store_.IsInitializationComplete());
634 635
635 store_.OnUpdatePolicy(); 636 store_.OnUpdatePolicy();
636 Mock::VerifyAndClearExpectations(&observer_); 637 Mock::VerifyAndClearExpectations(&observer_);
637 EXPECT_TRUE(store_.IsInitializationComplete()); 638 EXPECT_TRUE(store_.IsInitializationComplete());
638 } 639 }
639 640
640 } // namespace policy 641 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698