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

Side by Side Diff: net/proxy/proxy_config_service_win_unittest.cc

Issue 149191: Whenever proxy configurations contain socks and http/https/ftp proxies, socks... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: adding disabled win test Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "net/proxy/proxy_config_service_win.h" 5 #include "net/proxy/proxy_config_service_win.h"
6 6
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.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 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 EXPECT_EQ(tests[i].auto_detect, config.auto_detect); 167 EXPECT_EQ(tests[i].auto_detect, config.auto_detect);
168 EXPECT_EQ(tests[i].pac_url, config.pac_url); 168 EXPECT_EQ(tests[i].pac_url, config.pac_url);
169 EXPECT_EQ(tests[i].proxy_bypass_list, 169 EXPECT_EQ(tests[i].proxy_bypass_list,
170 FlattenProxyBypass(config.proxy_bypass)); 170 FlattenProxyBypass(config.proxy_bypass));
171 EXPECT_EQ(tests[i].bypass_local_names, config.proxy_bypass_local_names); 171 EXPECT_EQ(tests[i].bypass_local_names, config.proxy_bypass_local_names);
172 EXPECT_EQ(tests[i].proxy_rules, config.proxy_rules); 172 EXPECT_EQ(tests[i].proxy_rules, config.proxy_rules);
173 } 173 }
174 } 174 }
175 175
176 #if defined(NOT_DEFINED_VALUE)
Arindam 2009/07/10 19:25:17 I believe this is the test you wanted. However, as
eroman 2009/07/10 21:24:46 The test I was thinking of is to add an extra bloc
Arindam 2009/07/11 00:53:35 Now I get it. Done.
177 TEST(ProxyConfigServiceWin, FallbackToSOCKSProxy) {
178 WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config =
179 { // Input
180 TRUE, // fAutoDetect
181 NULL, // lpszAutoConfigUrl
182 L"http=httpproxy:80;socks=socksproxy:1080", // lpszProxy
183 NULL, // lpszProxy_bypass
184 };
185 ProxyConfig config;
186 ProxyConfigServiceWin::SetFromIEConfig(&config, ie_config);
187
188 EXPECT_EQ(true, config.auto_detect);
189 EXPECT_EQ(GURL(), config.pac_url);
190 EXPECT_EQ("", FlattenProxyBypass(config.proxy_bypass));
191 EXPECT_EQ(false, config.proxy_bypass_local_names);
192 EXPECT_EQ(MakeProxyPerSchemeRules("httpproxy:80", "", "", "socksproxy:1080"),
193 config.proxy_rules);
194
195 {
196 SyncProxyService service(new MockProxyConfigService(config),
197 new MockProxyResolver);
198 GURL test_url("http://www.msn.com");
199 net::ProxyInfo info;
200 int rv = service.ResolveProxy(test_url, &info);
201 EXPECT_EQ(net::OK, rv);
202 EXPECT_FALSE(info.is_direct());
203 EXPECT_EQ("httpproxy:80", info.proxy_server().ToURI());
204 }
205
206 {
207 SyncProxyService service(new MockProxyConfigService(config),
208 new MockProxyResolver);
209 GURL test_url("https://www.msn.com");
210 net::ProxyInfo info;
211 int rv = service.ResolveProxy(test_url, &info);
212 EXPECT_EQ(net::OK, rv);
213 EXPECT_FALSE(info.is_direct());
214 EXPECT_EQ("socks4://socksproxy:1080", info.proxy_server().ToURI());
215 }
216 }
217 #endif
218
176 } // namespace net 219 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698