| 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_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 } | 930 } |
| 931 | 931 |
| 932 // When retrying the job using the second proxy (badFallback:98), | 932 // When retrying the job using the second proxy (badFallback:98), |
| 933 // alternative job must not be created. So, socket data for only the | 933 // alternative job must not be created. So, socket data for only the |
| 934 // main job is needed. | 934 // main job is needed. |
| 935 StaticSocketDataProvider socket_data_proxy_main_job_2; | 935 StaticSocketDataProvider socket_data_proxy_main_job_2; |
| 936 socket_data_proxy_main_job_2.set_connect_data( | 936 socket_data_proxy_main_job_2.set_connect_data( |
| 937 MockConnect(ASYNC, mock_error)); | 937 MockConnect(ASYNC, mock_error)); |
| 938 socket_factory.AddSocketDataProvider(&socket_data_proxy_main_job_2); | 938 socket_factory.AddSocketDataProvider(&socket_data_proxy_main_job_2); |
| 939 | 939 |
| 940 SSLSocketDataProvider ssl_data(ASYNC, OK); |
| 941 |
| 940 // First request would use DIRECT, and succeed. | 942 // First request would use DIRECT, and succeed. |
| 941 StaticSocketDataProvider socket_data_direct_first_request; | 943 StaticSocketDataProvider socket_data_direct_first_request; |
| 942 socket_data_direct_first_request.set_connect_data(MockConnect(ASYNC, OK)); | 944 socket_data_direct_first_request.set_connect_data(MockConnect(ASYNC, OK)); |
| 943 socket_factory.AddSocketDataProvider(&socket_data_direct_first_request); | 945 socket_factory.AddSocketDataProvider(&socket_data_direct_first_request); |
| 946 socket_factory.AddSSLSocketDataProvider(&ssl_data); |
| 944 | 947 |
| 945 // Second request would use DIRECT, and succeed. | 948 // Second request would use DIRECT, and succeed. |
| 946 StaticSocketDataProvider socket_data_direct_second_request; | 949 StaticSocketDataProvider socket_data_direct_second_request; |
| 947 socket_data_direct_second_request.set_connect_data( | 950 socket_data_direct_second_request.set_connect_data( |
| 948 MockConnect(ASYNC, OK)); | 951 MockConnect(ASYNC, OK)); |
| 949 socket_factory.AddSocketDataProvider(&socket_data_direct_second_request); | 952 socket_factory.AddSocketDataProvider(&socket_data_direct_second_request); |
| 953 socket_factory.AddSSLSocketDataProvider(&ssl_data); |
| 950 | 954 |
| 951 // Now request a stream. It should succeed using the DIRECT. | 955 // Now request a stream. It should succeed using the DIRECT. |
| 952 HttpRequestInfo request_info; | 956 HttpRequestInfo request_info; |
| 953 request_info.method = "GET"; | 957 request_info.method = "GET"; |
| 954 request_info.url = GURL("http://www.google.com"); | 958 request_info.url = GURL("http://www.google.com"); |
| 955 | 959 |
| 956 SSLConfig ssl_config; | 960 SSLConfig ssl_config; |
| 957 StreamRequestWaiter waiter; | 961 StreamRequestWaiter waiter; |
| 958 | 962 |
| 959 EXPECT_EQ(set_alternative_proxy_server, | 963 EXPECT_EQ(set_alternative_proxy_server, |
| (...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2509 HttpNetworkSession::NORMAL_SOCKET_POOL))); | 2513 HttpNetworkSession::NORMAL_SOCKET_POOL))); |
| 2510 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetTransportSocketPool( | 2514 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetTransportSocketPool( |
| 2511 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2515 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 2512 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetSSLSocketPool( | 2516 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetSSLSocketPool( |
| 2513 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2517 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 2514 } | 2518 } |
| 2515 | 2519 |
| 2516 } // namespace | 2520 } // namespace |
| 2517 | 2521 |
| 2518 } // namespace net | 2522 } // namespace net |
| OLD | NEW |