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

Unified Diff: chrome/browser/net/pref_proxy_config_service_unittest.cc

Issue 6240013: Make proxy settings one atomic dictionary in the PrefStores such that modifications are atomic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/out/Debug
Patch Set: Updated to ToT and addressed Matt's comments in base-CL Created 9 years, 11 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/net/pref_proxy_config_service_unittest.cc
diff --git a/chrome/browser/net/pref_proxy_config_service_unittest.cc b/chrome/browser/net/pref_proxy_config_service_unittest.cc
index dad5c53eb6772a83da3fde4144bcb515c239ea5c..5bdef3541c8e48b1858b9fa5995ada765e6dcab4 100644
--- a/chrome/browser/net/pref_proxy_config_service_unittest.cc
+++ b/chrome/browser/net/pref_proxy_config_service_unittest.cc
@@ -114,10 +114,8 @@ TEST_F(PrefProxyConfigServiceTest, BaseConfiguration) {
TEST_F(PrefProxyConfigServiceTest, DynamicPrefOverrides) {
pref_service_->SetManagedPref(
- prefs::kProxyServer, Value::CreateStringValue("http://example.com:3128"));
- pref_service_->SetManagedPref(
- prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_FIXED_SERVERS));
+ prefs::kProxy,
+ ProxyPrefsDictionary::CreateFixedServers("http://example.com:3128", ""));
loop_.RunAllPending();
net::ProxyConfig actual_config;
@@ -129,9 +127,8 @@ TEST_F(PrefProxyConfigServiceTest, DynamicPrefOverrides) {
net::ProxyServer::FromURI("http://example.com:3128",
net::ProxyServer::SCHEME_HTTP));
- pref_service_->SetManagedPref(
- prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_AUTO_DETECT));
+ pref_service_->SetManagedPref(prefs::kProxy,
+ ProxyPrefsDictionary::CreateAutoDetect());
loop_.RunAllPending();
proxy_config_service_->GetLatestProxyConfig(&actual_config);
@@ -164,17 +161,9 @@ TEST_F(PrefProxyConfigServiceTest, Observers) {
EXPECT_CALL(observer,
OnProxyConfigChanged(ProxyConfigMatches(pref_config))).Times(1);
-
- pref_service_->SetManagedPref(prefs::kProxyPacUrl,
- Value::CreateStringValue(kFixedPacUrl));
- // The above does not trigger a notification, because PrefProxyConfig still
- // sees the mode as the default (ProxyPrefs::SYSTEM), so that it doesn't claim
- // to have proxy config.
- // TODO(battre): Remove this comment when http://crbug.com/65732 is
- // resolved.
pref_service_->SetManagedPref(
- prefs::kProxyMode,
- Value::CreateIntegerValue(ProxyPrefs::MODE_PAC_SCRIPT));
+ prefs::kProxy,
+ ProxyPrefsDictionary::CreatePacScript(kFixedPacUrl));
loop_.RunAllPending();
Mock::VerifyAndClearExpectations(&observer);
@@ -190,12 +179,7 @@ TEST_F(PrefProxyConfigServiceTest, Observers) {
// Clear the override should switch back to the fixed configuration.
EXPECT_CALL(observer,
OnProxyConfigChanged(ProxyConfigMatches(config3))).Times(1);
- pref_service_->RemoveManagedPref(prefs::kProxyMode);
- // The above switches the mode to the default (ProxyPrefs::SYSTEM), so the
- // next removal won't bother PrefProxyConfigService.
- // TODO(battre): Remove this comment when http://crbug.com/65732 is
- // completed.
- pref_service_->RemoveManagedPref(prefs::kProxyPacUrl);
+ pref_service_->RemoveManagedPref(prefs::kProxy);
loop_.RunAllPending();
Mock::VerifyAndClearExpectations(&observer);

Powered by Google App Engine
This is Rietveld 408576698