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 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 params.proxy_service = proxy_service.get(); | 761 params.proxy_service = proxy_service.get(); |
762 params.ssl_config_service = ssl_config_service.get(); | 762 params.ssl_config_service = ssl_config_service.get(); |
763 params.http_server_properties = http_server_properties.GetWeakPtr(); | 763 params.http_server_properties = http_server_properties.GetWeakPtr(); |
764 params.quic_max_number_of_lossy_connections = 2; | 764 params.quic_max_number_of_lossy_connections = 2; |
765 | 765 |
766 scoped_ptr<HttpNetworkSession> session(new HttpNetworkSession(params)); | 766 scoped_ptr<HttpNetworkSession> session(new HttpNetworkSession(params)); |
767 session->quic_stream_factory()->set_require_confirmation(false); | 767 session->quic_stream_factory()->set_require_confirmation(false); |
768 | 768 |
769 session->quic_stream_factory()->number_of_lossy_connections_[99] = | 769 session->quic_stream_factory()->number_of_lossy_connections_[99] = |
770 params.quic_max_number_of_lossy_connections; | 770 params.quic_max_number_of_lossy_connections; |
| 771 session->quic_stream_factory()->MaybeDisableQuic(99); |
| 772 ASSERT_TRUE(session->quic_stream_factory()->IsQuicDisabled(99)); |
771 | 773 |
772 StaticSocketDataProvider socket_data2; | 774 StaticSocketDataProvider socket_data2; |
773 socket_data2.set_connect_data(MockConnect(ASYNC, OK)); | 775 socket_data2.set_connect_data(MockConnect(ASYNC, OK)); |
774 socket_factory.AddSocketDataProvider(&socket_data2); | 776 socket_factory.AddSocketDataProvider(&socket_data2); |
775 | 777 |
776 // Now request a stream. It should succeed using the second proxy in the | 778 // Now request a stream. It should succeed using the second proxy in the |
777 // list. | 779 // list. |
778 HttpRequestInfo request_info; | 780 HttpRequestInfo request_info; |
779 request_info.method = "GET"; | 781 request_info.method = "GET"; |
780 request_info.url = GURL("http://www.google.com"); | 782 request_info.url = GURL("http://www.google.com"); |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 1691 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
1690 | 1692 |
1691 // Make sure there is no orphaned job. it is already canceled. | 1693 // Make sure there is no orphaned job. it is already canceled. |
1692 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( | 1694 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( |
1693 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); | 1695 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); |
1694 } | 1696 } |
1695 | 1697 |
1696 } // namespace | 1698 } // namespace |
1697 | 1699 |
1698 } // namespace net | 1700 } // namespace net |
OLD | NEW |