OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 L"foo.com, google.com", // lpszProxy_bypass | 189 L"foo.com, google.com", // lpszProxy_bypass |
190 }, | 190 }, |
191 | 191 |
192 // Expected result. | 192 // Expected result. |
193 true, // auto_detect | 193 true, // auto_detect |
194 GURL(), // pac_url | 194 GURL(), // pac_url |
195 ProxyRulesExpectation::EmptyWithBypass("foo.com,google.com"), | 195 ProxyRulesExpectation::EmptyWithBypass("foo.com,google.com"), |
196 }, | 196 }, |
197 }; | 197 }; |
198 | 198 |
199 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 199 for (size_t i = 0; i < arraysize(tests); ++i) { |
200 WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config = { | 200 WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_config = { |
201 tests[i].ie_config.auto_detect, | 201 tests[i].ie_config.auto_detect, |
202 const_cast<wchar_t*>(tests[i].ie_config.auto_config_url), | 202 const_cast<wchar_t*>(tests[i].ie_config.auto_config_url), |
203 const_cast<wchar_t*>(tests[i].ie_config.proxy), | 203 const_cast<wchar_t*>(tests[i].ie_config.proxy), |
204 const_cast<wchar_t*>(tests[i].ie_config.proxy_bypass)}; | 204 const_cast<wchar_t*>(tests[i].ie_config.proxy_bypass)}; |
205 ProxyConfig config; | 205 ProxyConfig config; |
206 ProxyConfigServiceWin::SetFromIEConfig(&config, ie_config); | 206 ProxyConfigServiceWin::SetFromIEConfig(&config, ie_config); |
207 | 207 |
208 EXPECT_EQ(tests[i].auto_detect, config.auto_detect()); | 208 EXPECT_EQ(tests[i].auto_detect, config.auto_detect()); |
209 EXPECT_EQ(tests[i].pac_url, config.pac_url()); | 209 EXPECT_EQ(tests[i].pac_url, config.pac_url()); |
210 EXPECT_TRUE(tests[i].proxy_rules.Matches(config.proxy_rules())); | 210 EXPECT_TRUE(tests[i].proxy_rules.Matches(config.proxy_rules())); |
211 EXPECT_EQ(PROXY_CONFIG_SOURCE_SYSTEM, config.source()); | 211 EXPECT_EQ(PROXY_CONFIG_SOURCE_SYSTEM, config.source()); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 } // namespace net | 215 } // namespace net |
OLD | NEW |