| OLD | NEW |
| 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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "chrome/browser/prefs/pref_service.h" | 6 #include "chrome/browser/prefs/pref_service.h" |
| 7 #include "chrome/browser/prefs/proxy_config_dictionary.h" | 7 #include "chrome/browser/prefs/proxy_config_dictionary.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 "http=1.1.1.1:80;" | 162 "http=1.1.1.1:80;" |
| 163 "https=2.2.2.2:80;" | 163 "https=2.2.2.2:80;" |
| 164 "ftp=3.3.3.3:9000;" | 164 "ftp=3.3.3.3:9000;" |
| 165 "socks=socks4://4.4.4.4:9090", | 165 "socks=socks4://4.4.4.4:9090", |
| 166 kNoBypass, | 166 kNoBypass, |
| 167 kNoPac, | 167 kNoPac, |
| 168 pref_service); | 168 pref_service); |
| 169 } | 169 } |
| 170 | 170 |
| 171 // Tests setting values only for incognito mode | 171 // Tests setting values only for incognito mode |
| 172 // TODO(battre): re-enable when incognito is supported again | |
| 173 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, | 172 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, |
| 174 DISABLED_ProxyFixedIndividualIncognitoOnly) { | 173 ProxyFixedIndividualIncognitoOnly) { |
| 175 ASSERT_TRUE(RunExtensionTestIncognito("proxy/individual_incognito_only")) << | 174 ASSERT_TRUE(RunExtensionTestIncognito("proxy/individual_incognito_only")) << |
| 176 message_; | 175 message_; |
| 177 const Extension* extension = GetSingleLoadedExtension(); | 176 const Extension* extension = GetSingleLoadedExtension(); |
| 178 ASSERT_TRUE(extension); | 177 ASSERT_TRUE(extension); |
| 179 | 178 |
| 180 PrefService* pref_service = browser()->profile()->GetPrefs(); | 179 PrefService* pref_service = browser()->profile()->GetPrefs(); |
| 181 ExpectNoSettings(pref_service); | 180 ExpectNoSettings(pref_service); |
| 182 | 181 |
| 183 // Now check the incognito preferences. | 182 // Now check the incognito preferences. |
| 184 pref_service = browser()->profile()->GetOffTheRecordProfile()->GetPrefs(); | 183 pref_service = browser()->profile()->GetOffTheRecordProfile()->GetPrefs(); |
| 185 ValidateSettings(ProxyPrefs::MODE_FIXED_SERVERS, | 184 ValidateSettings(ProxyPrefs::MODE_FIXED_SERVERS, |
| 186 "http=1.1.1.1:80;" | 185 "http=1.1.1.1:80;" |
| 187 "https=socks5://2.2.2.2:1080;" | 186 "https=socks5://2.2.2.2:1080;" |
| 188 "ftp=3.3.3.3:9000;" | 187 "ftp=3.3.3.3:9000;" |
| 189 "socks=socks4://4.4.4.4:9090", | 188 "socks=socks4://4.4.4.4:9090", |
| 190 kNoBypass, | 189 kNoBypass, |
| 191 kNoPac, | 190 kNoPac, |
| 192 pref_service); | 191 pref_service); |
| 193 } | 192 } |
| 194 | 193 |
| 195 // Tests setting values also for incognito mode | 194 // Tests setting values also for incognito mode |
| 196 // TODO(battre): re-enable when incognito is supported again | |
| 197 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, | 195 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, |
| 198 DISABLED_ProxyFixedIndividualIncognitoAlso) { | 196 ProxyFixedIndividualIncognitoAlso) { |
| 199 ASSERT_TRUE(RunExtensionTestIncognito("proxy/individual_incognito_also")) << | 197 ASSERT_TRUE(RunExtensionTestIncognito("proxy/individual_incognito_also")) << |
| 200 message_; | 198 message_; |
| 201 const Extension* extension = GetSingleLoadedExtension(); | 199 const Extension* extension = GetSingleLoadedExtension(); |
| 202 ASSERT_TRUE(extension); | 200 ASSERT_TRUE(extension); |
| 203 | 201 |
| 204 PrefService* pref_service = browser()->profile()->GetPrefs(); | 202 PrefService* pref_service = browser()->profile()->GetPrefs(); |
| 205 ValidateSettings(ProxyPrefs::MODE_FIXED_SERVERS, | 203 ValidateSettings(ProxyPrefs::MODE_FIXED_SERVERS, |
| 206 "http=1.1.1.1:80;" | 204 "http=1.1.1.1:80;" |
| 207 "https=socks5://2.2.2.2:1080;" | 205 "https=socks5://2.2.2.2:1080;" |
| 208 "ftp=3.3.3.3:9000;" | 206 "ftp=3.3.3.3:9000;" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 "http=1.1.1.1:80", | 250 "http=1.1.1.1:80", |
| 253 "localhost,::1,foo.bar,<local>", | 251 "localhost,::1,foo.bar,<local>", |
| 254 kNoPac, | 252 kNoPac, |
| 255 pref_service); | 253 pref_service); |
| 256 } | 254 } |
| 257 | 255 |
| 258 // Tests error events. | 256 // Tests error events. |
| 259 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEvents) { | 257 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEvents) { |
| 260 ASSERT_TRUE(RunExtensionTest("proxy/events")) << message_; | 258 ASSERT_TRUE(RunExtensionTest("proxy/events")) << message_; |
| 261 } | 259 } |
| OLD | NEW |