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

Unified Diff: chrome/browser/extensions/extension_proxy_apitest.cc

Issue 5701003: Intorduce a separate preference for 'proxy server mode' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 10 years 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/extensions/extension_proxy_apitest.cc
diff --git a/chrome/browser/extensions/extension_proxy_apitest.cc b/chrome/browser/extensions/extension_proxy_apitest.cc
index f24b7ef5689474a45935bb6fc2f88222e5fafa3f..5b6ef8d1f787593ec3c92fd1c763f77a344f8889 100644
--- a/chrome/browser/extensions/extension_proxy_apitest.cc
+++ b/chrome/browser/extensions/extension_proxy_apitest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/browser/net/pref_proxy_config_service.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -22,11 +23,11 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ProxyAutoSettings) {
PrefService* pref_service = browser()->profile()->GetPrefs();
const PrefService::Preference* pref =
- pref_service->FindPreference(prefs::kProxyAutoDetect);
+ pref_service->FindPreference(prefs::kProxyServerMode);
ASSERT_TRUE(pref != NULL);
ASSERT_TRUE(pref->IsExtensionControlled());
- bool auto_detect = pref_service->GetBoolean(prefs::kProxyAutoDetect);
- EXPECT_TRUE(auto_detect);
+ int mode = pref_service->GetInteger(prefs::kProxyServerMode);
+ EXPECT_EQ(PrefProxyConfigService::AUTO_DETECT, mode);
pref = pref_service->FindPreference(prefs::kProxyPacUrl);
ASSERT_TRUE(pref != NULL);
@@ -53,21 +54,22 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ProxyManualSingle) {
// There should be no values superseding the extension-set proxy in this test.
const PrefService::Preference* pref =
- pref_service->FindPreference(prefs::kProxyServer);
+ pref_service->FindPreference(prefs::kProxyServer);
ASSERT_TRUE(pref != NULL);
ASSERT_TRUE(pref->IsExtensionControlled());
std::string proxy_server = pref_service->GetString(prefs::kProxyServer);
EXPECT_EQ("http=http://127.0.0.1:100;"
- "https=http://127.0.0.1:100;"
- "ftp=http://127.0.0.1:100;"
- "socks=http://9.9.9.9", proxy_server);
+ "https=http://127.0.0.1:100;"
+ "ftp=http://127.0.0.1:100;"
+ "socks=http://9.9.9.9", proxy_server);
battre (please use the other) 2010/12/14 09:45:44 Nit: Indentation broken
gfeher 2010/12/16 10:42:04 Done.
// Other proxy prefs should also be set, so they're all controlled from one
// place.
- pref = pref_service->FindPreference(prefs::kProxyAutoDetect);
+ pref = pref_service->FindPreference(prefs::kProxyServerMode);
ASSERT_TRUE(pref != NULL);
EXPECT_TRUE(pref->IsExtensionControlled());
- EXPECT_FALSE(pref_service->GetBoolean(prefs::kProxyAutoDetect));
+ EXPECT_EQ(PrefProxyConfigService::MANUAL,
+ pref_service->GetInteger(prefs::kProxyServerMode));
pref = pref_service->FindPreference(prefs::kProxyPacUrl);
ASSERT_TRUE(pref != NULL);
@@ -88,7 +90,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ProxyManualIndividual) {
// There should be no values superseding the extension-set proxy in this test.
const PrefService::Preference* pref =
- pref_service->FindPreference(prefs::kProxyServer);
+ pref_service->FindPreference(prefs::kProxyServer);
ASSERT_TRUE(pref != NULL);
ASSERT_TRUE(pref->IsExtensionControlled());
@@ -100,10 +102,11 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ProxyManualIndividual) {
// Other proxy prefs should also be set, so they're all controlled from one
// place.
- pref = pref_service->FindPreference(prefs::kProxyAutoDetect);
+ pref = pref_service->FindPreference(prefs::kProxyServerMode);
ASSERT_TRUE(pref != NULL);
EXPECT_TRUE(pref->IsExtensionControlled());
- EXPECT_FALSE(pref_service->GetBoolean(prefs::kProxyAutoDetect));
+ EXPECT_EQ(PrefProxyConfigService::MANUAL,
+ pref_service->GetInteger(prefs::kProxyServerMode));
pref = pref_service->FindPreference(prefs::kProxyPacUrl);
ASSERT_TRUE(pref != NULL);

Powered by Google App Engine
This is Rietveld 408576698