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/http/http_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_client_socket_pool.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 enum HttpProxyType { | 36 enum HttpProxyType { |
37 HTTP, | 37 HTTP, |
38 HTTPS, | 38 HTTPS, |
39 SPDY | 39 SPDY |
40 }; | 40 }; |
41 | 41 |
42 struct HttpProxyClientSocketPoolTestParams { | 42 struct HttpProxyClientSocketPoolTestParams { |
43 HttpProxyClientSocketPoolTestParams() | 43 HttpProxyClientSocketPoolTestParams() |
44 : proxy_type(HTTP), | 44 : proxy_type(HTTP), |
45 protocol(kProtoSPDY3) {} | 45 protocol(kProtoSPDY31) {} |
46 | 46 |
47 HttpProxyClientSocketPoolTestParams( | 47 HttpProxyClientSocketPoolTestParams( |
48 HttpProxyType proxy_type, | 48 HttpProxyType proxy_type, |
49 NextProto protocol) | 49 NextProto protocol) |
50 : proxy_type(proxy_type), | 50 : proxy_type(proxy_type), |
51 protocol(protocol) {} | 51 protocol(protocol) {} |
52 | 52 |
53 HttpProxyType proxy_type; | 53 HttpProxyType proxy_type; |
54 NextProto protocol; | 54 NextProto protocol; |
55 }; | 55 }; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 //----------------------------------------------------------------------------- | 335 //----------------------------------------------------------------------------- |
336 // All tests are run with three different proxy types: HTTP, HTTPS (non-SPDY) | 336 // All tests are run with three different proxy types: HTTP, HTTPS (non-SPDY) |
337 // and SPDY. | 337 // and SPDY. |
338 // | 338 // |
339 // TODO(akalin): Use ::testing::Combine() when we are able to use | 339 // TODO(akalin): Use ::testing::Combine() when we are able to use |
340 // <tr1/tuple>. | 340 // <tr1/tuple>. |
341 INSTANTIATE_TEST_CASE_P( | 341 INSTANTIATE_TEST_CASE_P( |
342 HttpProxyClientSocketPoolTests, | 342 HttpProxyClientSocketPoolTests, |
343 HttpProxyClientSocketPoolTest, | 343 HttpProxyClientSocketPoolTest, |
344 ::testing::Values( | 344 ::testing::Values( |
345 HttpProxyClientSocketPoolTestParams(HTTP, kProtoDeprecatedSPDY2), | |
346 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoDeprecatedSPDY2), | |
347 HttpProxyClientSocketPoolTestParams(SPDY, kProtoDeprecatedSPDY2), | |
348 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY3), | |
349 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY3), | |
350 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY3), | |
351 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY31), | 345 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY31), |
352 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY31), | 346 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY31), |
353 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY31), | 347 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY31), |
354 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY4_14), | 348 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY4_14), |
355 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY4_14), | 349 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY4_14), |
356 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY4_14), | 350 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY4_14), |
357 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY4_15), | 351 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY4_15), |
358 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY4_15), | 352 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY4_15), |
359 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY4_15))); | 353 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY4_15))); |
360 | 354 |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 EXPECT_TRUE(headers->IsRedirect(&location)); | 841 EXPECT_TRUE(headers->IsRedirect(&location)); |
848 EXPECT_EQ(location, redirectTarget); | 842 EXPECT_EQ(location, redirectTarget); |
849 } | 843 } |
850 } | 844 } |
851 | 845 |
852 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 846 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. |
853 | 847 |
854 } // namespace | 848 } // namespace |
855 | 849 |
856 } // namespace net | 850 } // namespace net |
OLD | NEW |