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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 enum HttpProxyType { | 35 enum HttpProxyType { |
36 HTTP, | 36 HTTP, |
37 HTTPS, | 37 HTTPS, |
38 SPDY | 38 SPDY |
39 }; | 39 }; |
40 | 40 |
41 struct HttpProxyClientSocketPoolTestParams { | 41 struct HttpProxyClientSocketPoolTestParams { |
42 HttpProxyClientSocketPoolTestParams() | 42 HttpProxyClientSocketPoolTestParams() |
43 : proxy_type(HTTP), | 43 : proxy_type(HTTP), |
44 protocol(kProtoSPDY2) {} | 44 protocol(kProtoSPDY3) {} |
45 | 45 |
46 HttpProxyClientSocketPoolTestParams( | 46 HttpProxyClientSocketPoolTestParams( |
47 HttpProxyType proxy_type, | 47 HttpProxyType proxy_type, |
48 NextProto protocol) | 48 NextProto protocol) |
49 : proxy_type(proxy_type), | 49 : proxy_type(proxy_type), |
50 protocol(protocol) {} | 50 protocol(protocol) {} |
51 | 51 |
52 HttpProxyType proxy_type; | 52 HttpProxyType proxy_type; |
53 NextProto protocol; | 53 NextProto protocol; |
54 }; | 54 }; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 //----------------------------------------------------------------------------- | 231 //----------------------------------------------------------------------------- |
232 // All tests are run with three different proxy types: HTTP, HTTPS (non-SPDY) | 232 // All tests are run with three different proxy types: HTTP, HTTPS (non-SPDY) |
233 // and SPDY. | 233 // and SPDY. |
234 // | 234 // |
235 // TODO(akalin): Use ::testing::Combine() when we are able to use | 235 // TODO(akalin): Use ::testing::Combine() when we are able to use |
236 // <tr1/tuple>. | 236 // <tr1/tuple>. |
237 INSTANTIATE_TEST_CASE_P( | 237 INSTANTIATE_TEST_CASE_P( |
238 HttpProxyClientSocketPoolTests, | 238 HttpProxyClientSocketPoolTests, |
239 HttpProxyClientSocketPoolTest, | 239 HttpProxyClientSocketPoolTest, |
240 ::testing::Values( | 240 ::testing::Values( |
241 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY2), | 241 HttpProxyClientSocketPoolTestParams(HTTP, kProtoDeprecatedSPDY2), |
242 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY2), | 242 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoDeprecatedSPDY2), |
243 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY2), | 243 HttpProxyClientSocketPoolTestParams(SPDY, kProtoDeprecatedSPDY2), |
244 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY3), | 244 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY3), |
245 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY3), | 245 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY3), |
246 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY3), | 246 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY3), |
247 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY31), | 247 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY31), |
248 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY31), | 248 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY31), |
249 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY31), | 249 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY31), |
250 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY4a2), | 250 HttpProxyClientSocketPoolTestParams(HTTP, kProtoSPDY4a2), |
251 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY4a2), | 251 HttpProxyClientSocketPoolTestParams(HTTPS, kProtoSPDY4a2), |
252 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY4a2), | 252 HttpProxyClientSocketPoolTestParams(SPDY, kProtoSPDY4a2), |
253 HttpProxyClientSocketPoolTestParams(HTTP, kProtoHTTP2Draft04), | 253 HttpProxyClientSocketPoolTestParams(HTTP, kProtoHTTP2Draft04), |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 EXPECT_TRUE(headers->IsRedirect(&location)); | 724 EXPECT_TRUE(headers->IsRedirect(&location)); |
725 EXPECT_EQ(location, redirectTarget); | 725 EXPECT_EQ(location, redirectTarget); |
726 } | 726 } |
727 } | 727 } |
728 | 728 |
729 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 729 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. |
730 | 730 |
731 } // namespace | 731 } // namespace |
732 | 732 |
733 } // namespace net | 733 } // namespace net |
OLD | NEW |