| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 // Now check the incognito preferences. | 249 // Now check the incognito preferences. |
| 250 pref_service = browser()->profile()->GetOffTheRecordProfile()->GetPrefs(); | 250 pref_service = browser()->profile()->GetOffTheRecordProfile()->GetPrefs(); |
| 251 ValidateSettings(ProxyPrefs::MODE_FIXED_SERVERS, | 251 ValidateSettings(ProxyPrefs::MODE_FIXED_SERVERS, |
| 252 "http=1.1.1.1:80", | 252 "http=1.1.1.1:80", |
| 253 "localhost,::1,foo.bar,<local>", | 253 "localhost,::1,foo.bar,<local>", |
| 254 kNoPac, | 254 kNoPac, |
| 255 pref_service); | 255 pref_service); |
| 256 } | 256 } |
| 257 | 257 |
| 258 // This test sets proxy to an inavalid host "does.not.exist" and then fetches |
| 259 // a page from localhost, expecting an error since host is invalid. |
| 260 // On ChromeOS, localhost is by default bypassed, so the page from localhost |
| 261 // will be fetched successfully, resulting in no error. Hence this test |
| 262 // shouldn't run on ChromeOS. |
| 263 #if defined(OS_CHROMEOS) |
| 264 #define MAYBE_ProxyEventsInvalidProxy DISABLED_ProxyEventsInvalidProxy |
| 265 #else |
| 266 #define MAYBE_ProxyEventsInvalidProxy ProxyEventsInvalidProxy |
| 267 #endif // defined(OS_CHROMEOS) |
| 268 |
| 258 // Tests error events: invalid proxy | 269 // Tests error events: invalid proxy |
| 259 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEventsInvalidProxy) { | 270 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, MAYBE_ProxyEventsInvalidProxy) { |
| 260 ASSERT_TRUE(StartTestServer()); | 271 ASSERT_TRUE(StartTestServer()); |
| 261 ASSERT_TRUE( | 272 ASSERT_TRUE( |
| 262 RunExtensionSubtest("proxy/events", "invalid_proxy.html")) << message_; | 273 RunExtensionSubtest("proxy/events", "invalid_proxy.html")) << message_; |
| 263 } | 274 } |
| 264 | 275 |
| 265 // Tests error events: PAC script parse error. | 276 // Tests error events: PAC script parse error. |
| 266 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEventsParseError) { | 277 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEventsParseError) { |
| 267 ASSERT_TRUE( | 278 ASSERT_TRUE( |
| 268 RunExtensionSubtest("proxy/events", "parse_error.html")) << message_; | 279 RunExtensionSubtest("proxy/events", "parse_error.html")) << message_; |
| 269 } | 280 } |
| OLD | NEW |