OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/net/chrome_url_request_context.h" | 6 #include "chrome/browser/net/chrome_url_request_context.h" |
7 #include "chrome/common/chrome_switches.h" | 7 #include "chrome/common/chrome_switches.h" |
8 #include "net/proxy/proxy_config.h" | 8 #include "net/proxy/proxy_config.h" |
9 #include "net/proxy/proxy_config_service_common_unittest.h" | 9 #include "net/proxy/proxy_config_service_common_unittest.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 CommandLine single_proxy(L"foo.exe"); | 25 CommandLine single_proxy(L"foo.exe"); |
26 single_proxy.AppendSwitchWithValue(switches::kProxyServer, | 26 single_proxy.AppendSwitchWithValue(switches::kProxyServer, |
27 L"http://proxy:8888"); | 27 L"http://proxy:8888"); |
28 CommandLine per_scheme_proxy(L"foo.exe"); | 28 CommandLine per_scheme_proxy(L"foo.exe"); |
29 per_scheme_proxy.AppendSwitchWithValue(switches::kProxyServer, | 29 per_scheme_proxy.AppendSwitchWithValue(switches::kProxyServer, |
30 L"http=httpproxy:8888;ftp=ftpproxy:8889"); | 30 L"http=httpproxy:8888;ftp=ftpproxy:8889"); |
31 CommandLine per_scheme_proxy_bypass(L"foo.exe"); | 31 CommandLine per_scheme_proxy_bypass(L"foo.exe"); |
32 per_scheme_proxy_bypass.AppendSwitchWithValue(switches::kProxyServer, | 32 per_scheme_proxy_bypass.AppendSwitchWithValue(switches::kProxyServer, |
33 L"http=httpproxy:8888;ftp=ftpproxy:8889"); | 33 L"http=httpproxy:8888;ftp=ftpproxy:8889"); |
34 per_scheme_proxy_bypass.AppendSwitchWithValue( | 34 per_scheme_proxy_bypass.AppendSwitchWithValue( |
35 switches::kProxyBypassUrls, | 35 switches::kProxyBypassList, |
36 L".google.com, foo.com:99, 1.2.3.4:22, 127.0.0.1/8"); | 36 L".google.com, foo.com:99, 1.2.3.4:22, 127.0.0.1/8"); |
37 CommandLine with_pac_url(L"foo.exe"); | 37 CommandLine with_pac_url(L"foo.exe"); |
38 with_pac_url.AppendSwitchWithValue(switches::kProxyPacUrl, | 38 with_pac_url.AppendSwitchWithValue(switches::kProxyPacUrl, |
39 L"http://wpad/wpad.dat"); | 39 L"http://wpad/wpad.dat"); |
40 with_pac_url.AppendSwitchWithValue( | 40 with_pac_url.AppendSwitchWithValue( |
41 switches::kProxyBypassUrls, | 41 switches::kProxyBypassList, |
42 L".google.com, foo.com:99, 1.2.3.4:22, 127.0.0.1/8"); | 42 L".google.com, foo.com:99, 1.2.3.4:22, 127.0.0.1/8"); |
43 CommandLine with_auto_detect(L"foo.exe"); | 43 CommandLine with_auto_detect(L"foo.exe"); |
44 with_auto_detect.AppendSwitch(switches::kProxyAutoDetect); | 44 with_auto_detect.AppendSwitch(switches::kProxyAutoDetect); |
45 | 45 |
46 // Inspired from proxy_config_service_win_unittest.cc. | 46 // Inspired from proxy_config_service_win_unittest.cc. |
47 const struct { | 47 const struct { |
48 // Short description to identify the test | 48 // Short description to identify the test |
49 std::string description; | 49 std::string description; |
50 | 50 |
51 // The command line to build a ProxyConfig from. | 51 // The command line to build a ProxyConfig from. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 EXPECT_TRUE(config != NULL); | 172 EXPECT_TRUE(config != NULL); |
173 EXPECT_EQ(tests[i].auto_detect, config->auto_detect); | 173 EXPECT_EQ(tests[i].auto_detect, config->auto_detect); |
174 EXPECT_EQ(tests[i].pac_url, config->pac_url); | 174 EXPECT_EQ(tests[i].pac_url, config->pac_url); |
175 EXPECT_EQ(tests[i].proxy_bypass_list, | 175 EXPECT_EQ(tests[i].proxy_bypass_list, |
176 net::FlattenProxyBypass(config->proxy_bypass)); | 176 net::FlattenProxyBypass(config->proxy_bypass)); |
177 EXPECT_EQ(tests[i].bypass_local_names, config->proxy_bypass_local_names); | 177 EXPECT_EQ(tests[i].bypass_local_names, config->proxy_bypass_local_names); |
178 EXPECT_EQ(tests[i].proxy_rules, config->proxy_rules); | 178 EXPECT_EQ(tests[i].proxy_rules, config->proxy_rules); |
179 } | 179 } |
180 } | 180 } |
181 } | 181 } |
OLD | NEW |