| 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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 } | 928 } |
| 929 | 929 |
| 930 // When retrying the job using the second proxy (badFallback:98), | 930 // When retrying the job using the second proxy (badFallback:98), |
| 931 // alternative job must not be created. So, socket data for only the | 931 // alternative job must not be created. So, socket data for only the |
| 932 // main job is needed. | 932 // main job is needed. |
| 933 StaticSocketDataProvider socket_data_proxy_main_job_2; | 933 StaticSocketDataProvider socket_data_proxy_main_job_2; |
| 934 socket_data_proxy_main_job_2.set_connect_data( | 934 socket_data_proxy_main_job_2.set_connect_data( |
| 935 MockConnect(ASYNC, mock_error)); | 935 MockConnect(ASYNC, mock_error)); |
| 936 socket_factory.AddSocketDataProvider(&socket_data_proxy_main_job_2); | 936 socket_factory.AddSocketDataProvider(&socket_data_proxy_main_job_2); |
| 937 | 937 |
| 938 SSLSocketDataProvider ssl_data(ASYNC, OK); | |
| 939 | |
| 940 // First request would use DIRECT, and succeed. | 938 // First request would use DIRECT, and succeed. |
| 941 StaticSocketDataProvider socket_data_direct_first_request; | 939 StaticSocketDataProvider socket_data_direct_first_request; |
| 942 socket_data_direct_first_request.set_connect_data(MockConnect(ASYNC, OK)); | 940 socket_data_direct_first_request.set_connect_data(MockConnect(ASYNC, OK)); |
| 943 socket_factory.AddSocketDataProvider(&socket_data_direct_first_request); | 941 socket_factory.AddSocketDataProvider(&socket_data_direct_first_request); |
| 944 socket_factory.AddSSLSocketDataProvider(&ssl_data); | |
| 945 | 942 |
| 946 // Second request would use DIRECT, and succeed. | 943 // Second request would use DIRECT, and succeed. |
| 947 StaticSocketDataProvider socket_data_direct_second_request; | 944 StaticSocketDataProvider socket_data_direct_second_request; |
| 948 socket_data_direct_second_request.set_connect_data( | 945 socket_data_direct_second_request.set_connect_data( |
| 949 MockConnect(ASYNC, OK)); | 946 MockConnect(ASYNC, OK)); |
| 950 socket_factory.AddSocketDataProvider(&socket_data_direct_second_request); | 947 socket_factory.AddSocketDataProvider(&socket_data_direct_second_request); |
| 951 socket_factory.AddSSLSocketDataProvider(&ssl_data); | |
| 952 | 948 |
| 953 // Now request a stream. It should succeed using the DIRECT. | 949 // Now request a stream. It should succeed using the DIRECT. |
| 954 HttpRequestInfo request_info; | 950 HttpRequestInfo request_info; |
| 955 request_info.method = "GET"; | 951 request_info.method = "GET"; |
| 956 request_info.url = GURL("http://www.google.com"); | 952 request_info.url = GURL("http://www.google.com"); |
| 957 | 953 |
| 958 SSLConfig ssl_config; | 954 SSLConfig ssl_config; |
| 959 StreamRequestWaiter waiter; | 955 StreamRequestWaiter waiter; |
| 960 | 956 |
| 961 EXPECT_EQ(set_alternative_proxy_server, | 957 EXPECT_EQ(set_alternative_proxy_server, |
| (...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2501 HttpNetworkSession::NORMAL_SOCKET_POOL))); | 2497 HttpNetworkSession::NORMAL_SOCKET_POOL))); |
| 2502 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetTransportSocketPool( | 2498 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetTransportSocketPool( |
| 2503 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2499 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 2504 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetSSLSocketPool( | 2500 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetSSLSocketPool( |
| 2505 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2501 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 2506 } | 2502 } |
| 2507 | 2503 |
| 2508 } // namespace | 2504 } // namespace |
| 2509 | 2505 |
| 2510 } // namespace net | 2506 } // namespace net |
| OLD | NEW |