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

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: Fixed Lint comment Created 9 years, 10 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..d25abaa6adf23bb5229dffad821555b3e77bda91 100644
--- a/chrome/browser/net/pref_proxy_config_service_unittest.cc
+++ b/chrome/browser/net/pref_proxy_config_service_unittest.cc
@@ -8,7 +8,7 @@
#include "base/file_path.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/prefs/pref_service_mock_builder.h"
-#include "chrome/browser/prefs/proxy_prefs.h"
+#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/testing_pref_service.h"
@@ -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,
+ ProxyConfigDictionary::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,
+ ProxyConfigDictionary::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,
+ ProxyConfigDictionary::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);
« no previous file with comments | « chrome/browser/net/pref_proxy_config_service.cc ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698