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.h" | 5 #include "net/proxy/proxy_config.h" |
6 #include "net/proxy/proxy_config_service_common_unittest.h" | 6 #include "net/proxy/proxy_config_service_common_unittest.h" |
7 #include "net/proxy/proxy_info.h" | 7 #include "net/proxy/proxy_info.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 "PROXY myhttpproxy:80;DIRECT", | 301 "PROXY myhttpproxy:80;DIRECT", |
302 NULL, | 302 NULL, |
303 NULL, | 303 NULL, |
304 NULL, | 304 NULL, |
305 }, | 305 }, |
306 | 306 |
307 }; | 307 }; |
308 | 308 |
309 ProxyConfig config; | 309 ProxyConfig config; |
310 | 310 |
311 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 311 for (size_t i = 0; i < arraysize(tests); ++i) { |
312 config.proxy_rules().ParseFromString(tests[i].proxy_rules); | 312 config.proxy_rules().ParseFromString(tests[i].proxy_rules); |
313 | 313 |
314 EXPECT_EQ(tests[i].type, config.proxy_rules().type); | 314 EXPECT_EQ(tests[i].type, config.proxy_rules().type); |
315 ExpectProxyServerEquals(tests[i].single_proxy, | 315 ExpectProxyServerEquals(tests[i].single_proxy, |
316 config.proxy_rules().single_proxies); | 316 config.proxy_rules().single_proxies); |
317 ExpectProxyServerEquals(tests[i].proxy_for_http, | 317 ExpectProxyServerEquals(tests[i].proxy_for_http, |
318 config.proxy_rules().proxies_for_http); | 318 config.proxy_rules().proxies_for_http); |
319 ExpectProxyServerEquals(tests[i].proxy_for_https, | 319 ExpectProxyServerEquals(tests[i].proxy_for_https, |
320 config.proxy_rules().proxies_for_https); | 320 config.proxy_rules().proxies_for_https); |
321 ExpectProxyServerEquals(tests[i].proxy_for_ftp, | 321 ExpectProxyServerEquals(tests[i].proxy_for_ftp, |
(...skipping 26 matching lines...) Expand all Loading... |
348 EXPECT_TRUE(result.is_direct_only()); | 348 EXPECT_TRUE(result.is_direct_only()); |
349 EXPECT_TRUE(result.did_bypass_proxy()); | 349 EXPECT_TRUE(result.did_bypass_proxy()); |
350 | 350 |
351 rules.Apply(GURL("http://example.com"), &result); | 351 rules.Apply(GURL("http://example.com"), &result); |
352 EXPECT_FALSE(result.is_direct()); | 352 EXPECT_FALSE(result.is_direct()); |
353 EXPECT_FALSE(result.did_bypass_proxy()); | 353 EXPECT_FALSE(result.did_bypass_proxy()); |
354 } | 354 } |
355 | 355 |
356 } // namespace | 356 } // namespace |
357 } // namespace net | 357 } // namespace net |
OLD | NEW |