| 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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 | 1634 |
| 1635 TestBidirectionalDelegate delegate; | 1635 TestBidirectionalDelegate delegate; |
| 1636 stream_impl->Start(&bidi_request_info, BoundNetLog(), false, &delegate, | 1636 stream_impl->Start(&bidi_request_info, BoundNetLog(), false, &delegate, |
| 1637 nullptr); | 1637 nullptr); |
| 1638 delegate.WaitUntilDone(); | 1638 delegate.WaitUntilDone(); |
| 1639 | 1639 |
| 1640 scoped_refptr<IOBuffer> buffer = new net::IOBuffer(1); | 1640 scoped_refptr<IOBuffer> buffer = new net::IOBuffer(1); |
| 1641 EXPECT_EQ(OK, stream_impl->ReadData(buffer.get(), 1)); | 1641 EXPECT_EQ(OK, stream_impl->ReadData(buffer.get(), 1)); |
| 1642 EXPECT_EQ(kProtoQUIC1SPDY3, stream_impl->GetProtocol()); | 1642 EXPECT_EQ(kProtoQUIC1SPDY3, stream_impl->GetProtocol()); |
| 1643 EXPECT_EQ("200", delegate.response_headers().find(":status")->second); | 1643 EXPECT_EQ("200", delegate.response_headers().find(":status")->second); |
| 1644 EXPECT_EQ(1, GetSocketPoolGroupCount(session()->GetTransportSocketPool( | 1644 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( |
| 1645 HttpNetworkSession::NORMAL_SOCKET_POOL))); | 1645 HttpNetworkSession::NORMAL_SOCKET_POOL))); |
| 1646 EXPECT_EQ(1, GetSocketPoolGroupCount(session()->GetSSLSocketPool( | 1646 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( |
| 1647 HttpNetworkSession::NORMAL_SOCKET_POOL))); | 1647 HttpNetworkSession::NORMAL_SOCKET_POOL))); |
| 1648 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( | 1648 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( |
| 1649 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 1649 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 1650 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( | 1650 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( |
| 1651 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 1651 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
| 1652 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 1652 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
| 1653 } | 1653 } |
| 1654 | 1654 |
| 1655 // Tests that when QUIC is not enabled for bidirectional streaming, HTTP/2 is | 1655 // Tests that when QUIC is not enabled for bidirectional streaming, HTTP/2 is |
| 1656 // used instead. | 1656 // used instead. |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2015 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 2015 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
| 2016 | 2016 |
| 2017 // Make sure there is no orphaned job. it is already canceled. | 2017 // Make sure there is no orphaned job. it is already canceled. |
| 2018 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( | 2018 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( |
| 2019 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); | 2019 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); |
| 2020 } | 2020 } |
| 2021 | 2021 |
| 2022 } // namespace | 2022 } // namespace |
| 2023 | 2023 |
| 2024 } // namespace net | 2024 } // namespace net |
| OLD | NEW |