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 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 | 1621 |
1622 TestBidirectionalDelegate delegate; | 1622 TestBidirectionalDelegate delegate; |
1623 stream_impl->Start(&bidi_request_info, BoundNetLog(), false, &delegate, | 1623 stream_impl->Start(&bidi_request_info, BoundNetLog(), false, &delegate, |
1624 nullptr); | 1624 nullptr); |
1625 delegate.WaitUntilDone(); | 1625 delegate.WaitUntilDone(); |
1626 | 1626 |
1627 scoped_refptr<IOBuffer> buffer = new net::IOBuffer(1); | 1627 scoped_refptr<IOBuffer> buffer = new net::IOBuffer(1); |
1628 EXPECT_EQ(OK, stream_impl->ReadData(buffer.get(), 1)); | 1628 EXPECT_EQ(OK, stream_impl->ReadData(buffer.get(), 1)); |
1629 EXPECT_EQ(kProtoQUIC1SPDY3, stream_impl->GetProtocol()); | 1629 EXPECT_EQ(kProtoQUIC1SPDY3, stream_impl->GetProtocol()); |
1630 EXPECT_EQ("200", delegate.response_headers().find(":status")->second); | 1630 EXPECT_EQ("200", delegate.response_headers().find(":status")->second); |
1631 EXPECT_EQ(1, GetSocketPoolGroupCount(session()->GetTransportSocketPool( | 1631 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( |
1632 HttpNetworkSession::NORMAL_SOCKET_POOL))); | 1632 HttpNetworkSession::NORMAL_SOCKET_POOL))); |
1633 EXPECT_EQ(1, GetSocketPoolGroupCount(session()->GetSSLSocketPool( | 1633 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( |
1634 HttpNetworkSession::NORMAL_SOCKET_POOL))); | 1634 HttpNetworkSession::NORMAL_SOCKET_POOL))); |
1635 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( | 1635 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( |
1636 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 1636 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
1637 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( | 1637 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( |
1638 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 1638 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
1639 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 1639 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
1640 } | 1640 } |
1641 | 1641 |
1642 // Tests that when QUIC is not enabled for bidirectional streaming, HTTP/2 is | 1642 // Tests that when QUIC is not enabled for bidirectional streaming, HTTP/2 is |
1643 // used instead. | 1643 // used instead. |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2002 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 2002 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
2003 | 2003 |
2004 // Make sure there is no orphaned job. it is already canceled. | 2004 // Make sure there is no orphaned job. it is already canceled. |
2005 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( | 2005 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( |
2006 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); | 2006 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); |
2007 } | 2007 } |
2008 | 2008 |
2009 } // namespace | 2009 } // namespace |
2010 | 2010 |
2011 } // namespace net | 2011 } // namespace net |
OLD | NEW |