| 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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 } | 922 } |
| 923 | 923 |
| 924 // When retrying the job using the second proxy (badFallback:98), | 924 // When retrying the job using the second proxy (badFallback:98), |
| 925 // alternative job must not be created. So, socket data for only the | 925 // alternative job must not be created. So, socket data for only the |
| 926 // main job is needed. | 926 // main job is needed. |
| 927 StaticSocketDataProvider socket_data_proxy_main_job_2; | 927 StaticSocketDataProvider socket_data_proxy_main_job_2; |
| 928 socket_data_proxy_main_job_2.set_connect_data( | 928 socket_data_proxy_main_job_2.set_connect_data( |
| 929 MockConnect(ASYNC, mock_error)); | 929 MockConnect(ASYNC, mock_error)); |
| 930 socket_factory.AddSocketDataProvider(&socket_data_proxy_main_job_2); | 930 socket_factory.AddSocketDataProvider(&socket_data_proxy_main_job_2); |
| 931 | 931 |
| 932 SSLSocketDataProvider ssl_data(ASYNC, OK); |
| 933 |
| 932 // First request would use DIRECT, and succeed. | 934 // First request would use DIRECT, and succeed. |
| 933 StaticSocketDataProvider socket_data_direct_first_request; | 935 StaticSocketDataProvider socket_data_direct_first_request; |
| 934 socket_data_direct_first_request.set_connect_data(MockConnect(ASYNC, OK)); | 936 socket_data_direct_first_request.set_connect_data(MockConnect(ASYNC, OK)); |
| 935 socket_factory.AddSocketDataProvider(&socket_data_direct_first_request); | 937 socket_factory.AddSocketDataProvider(&socket_data_direct_first_request); |
| 938 socket_factory.AddSSLSocketDataProvider(&ssl_data); |
| 936 | 939 |
| 937 // Second request would use DIRECT, and succeed. | 940 // Second request would use DIRECT, and succeed. |
| 938 StaticSocketDataProvider socket_data_direct_second_request; | 941 StaticSocketDataProvider socket_data_direct_second_request; |
| 939 socket_data_direct_second_request.set_connect_data( | 942 socket_data_direct_second_request.set_connect_data( |
| 940 MockConnect(ASYNC, OK)); | 943 MockConnect(ASYNC, OK)); |
| 941 socket_factory.AddSocketDataProvider(&socket_data_direct_second_request); | 944 socket_factory.AddSocketDataProvider(&socket_data_direct_second_request); |
| 945 socket_factory.AddSSLSocketDataProvider(&ssl_data); |
| 942 | 946 |
| 943 // Now request a stream. It should succeed using the DIRECT. | 947 // Now request a stream. It should succeed using the DIRECT. |
| 944 HttpRequestInfo request_info; | 948 HttpRequestInfo request_info; |
| 945 request_info.method = "GET"; | 949 request_info.method = "GET"; |
| 946 request_info.url = GURL("http://www.google.com"); | 950 request_info.url = GURL("http://www.google.com"); |
| 947 | 951 |
| 948 SSLConfig ssl_config; | 952 SSLConfig ssl_config; |
| 949 StreamRequestWaiter waiter; | 953 StreamRequestWaiter waiter; |
| 950 | 954 |
| 951 EXPECT_EQ(set_alternative_proxy_server, | 955 EXPECT_EQ(set_alternative_proxy_server, |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2484 HttpNetworkSession::NORMAL_SOCKET_POOL))); | 2488 HttpNetworkSession::NORMAL_SOCKET_POOL))); |
| 2485 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetTransportSocketPool( | 2489 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetTransportSocketPool( |
| 2486 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2490 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 2487 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetSSLSocketPool( | 2491 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetSSLSocketPool( |
| 2488 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2492 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 2489 } | 2493 } |
| 2490 | 2494 |
| 2491 } // namespace | 2495 } // namespace |
| 2492 | 2496 |
| 2493 } // namespace net | 2497 } // namespace net |
| OLD | NEW |