| 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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 } | 946 } |
| 947 | 947 |
| 948 // When retrying the job using the second proxy (badFallback:98), | 948 // When retrying the job using the second proxy (badFallback:98), |
| 949 // alternative job must not be created. So, socket data for only the | 949 // alternative job must not be created. So, socket data for only the |
| 950 // main job is needed. | 950 // main job is needed. |
| 951 StaticSocketDataProvider socket_data_proxy_main_job_2; | 951 StaticSocketDataProvider socket_data_proxy_main_job_2; |
| 952 socket_data_proxy_main_job_2.set_connect_data( | 952 socket_data_proxy_main_job_2.set_connect_data( |
| 953 MockConnect(ASYNC, mock_error)); | 953 MockConnect(ASYNC, mock_error)); |
| 954 socket_factory.AddSocketDataProvider(&socket_data_proxy_main_job_2); | 954 socket_factory.AddSocketDataProvider(&socket_data_proxy_main_job_2); |
| 955 | 955 |
| 956 SSLSocketDataProvider ssl_data(ASYNC, OK); |
| 957 |
| 956 // First request would use DIRECT, and succeed. | 958 // First request would use DIRECT, and succeed. |
| 957 StaticSocketDataProvider socket_data_direct_first_request; | 959 StaticSocketDataProvider socket_data_direct_first_request; |
| 958 socket_data_direct_first_request.set_connect_data(MockConnect(ASYNC, OK)); | 960 socket_data_direct_first_request.set_connect_data(MockConnect(ASYNC, OK)); |
| 959 socket_factory.AddSocketDataProvider(&socket_data_direct_first_request); | 961 socket_factory.AddSocketDataProvider(&socket_data_direct_first_request); |
| 962 socket_factory.AddSSLSocketDataProvider(&ssl_data); |
| 960 | 963 |
| 961 // Second request would use DIRECT, and succeed. | 964 // Second request would use DIRECT, and succeed. |
| 962 StaticSocketDataProvider socket_data_direct_second_request; | 965 StaticSocketDataProvider socket_data_direct_second_request; |
| 963 socket_data_direct_second_request.set_connect_data( | 966 socket_data_direct_second_request.set_connect_data( |
| 964 MockConnect(ASYNC, OK)); | 967 MockConnect(ASYNC, OK)); |
| 965 socket_factory.AddSocketDataProvider(&socket_data_direct_second_request); | 968 socket_factory.AddSocketDataProvider(&socket_data_direct_second_request); |
| 969 socket_factory.AddSSLSocketDataProvider(&ssl_data); |
| 966 | 970 |
| 967 // Now request a stream. It should succeed using the DIRECT. | 971 // Now request a stream. It should succeed using the DIRECT. |
| 968 HttpRequestInfo request_info; | 972 HttpRequestInfo request_info; |
| 969 request_info.method = "GET"; | 973 request_info.method = "GET"; |
| 970 request_info.url = GURL("http://www.google.com"); | 974 request_info.url = GURL("http://www.google.com"); |
| 971 | 975 |
| 972 SSLConfig ssl_config; | 976 SSLConfig ssl_config; |
| 973 StreamRequestWaiter waiter; | 977 StreamRequestWaiter waiter; |
| 974 | 978 |
| 975 EXPECT_EQ(set_alternative_proxy_server, | 979 EXPECT_EQ(set_alternative_proxy_server, |
| (...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2705 session->GetTransportSocketPool( | 2709 session->GetTransportSocketPool( |
| 2706 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2710 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 2707 EXPECT_EQ(1, GetSocketPoolGroupCount( | 2711 EXPECT_EQ(1, GetSocketPoolGroupCount( |
| 2708 session->GetSSLSocketPool(HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2712 session->GetSSLSocketPool(HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 2709 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 2713 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
| 2710 } | 2714 } |
| 2711 | 2715 |
| 2712 } // namespace | 2716 } // namespace |
| 2713 | 2717 |
| 2714 } // namespace net | 2718 } // namespace net |
| OLD | NEW |