OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/spdy/spdy_io_buffer.h" | 5 #include "net/spdy/spdy_io_buffer.h" |
6 #include "net/spdy/spdy_session.h" | 6 #include "net/spdy/spdy_session.h" |
7 #include "net/spdy/spdy_stream.h" | 7 #include "net/spdy/spdy_stream.h" |
8 #include "net/spdy/spdy_test_util.h" | 8 #include "net/spdy/spdy_test_util.h" |
9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 SSLSocketDataProvider ssl(false, OK); | 74 SSLSocketDataProvider ssl(false, OK); |
75 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); | 75 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); |
76 | 76 |
77 scoped_refptr<HttpNetworkSession> http_session( | 77 scoped_refptr<HttpNetworkSession> http_session( |
78 SpdySessionDependencies::SpdyCreateSession(&session_deps)); | 78 SpdySessionDependencies::SpdyCreateSession(&session_deps)); |
79 | 79 |
80 const std::string kTestHost("www.foo.com"); | 80 const std::string kTestHost("www.foo.com"); |
81 const int kTestPort = 80; | 81 const int kTestPort = 80; |
82 HostPortPair test_host_port_pair(kTestHost, kTestPort); | 82 HostPortPair test_host_port_pair(kTestHost, kTestPort); |
83 HostPortProxyPair pair(test_host_port_pair, ""); | 83 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); |
84 | 84 |
85 scoped_refptr<SpdySessionPool> spdy_session_pool( | 85 scoped_refptr<SpdySessionPool> spdy_session_pool( |
86 http_session->spdy_session_pool()); | 86 http_session->spdy_session_pool()); |
87 EXPECT_FALSE(spdy_session_pool->HasSession(pair)); | 87 EXPECT_FALSE(spdy_session_pool->HasSession(pair)); |
88 scoped_refptr<SpdySession> session = | 88 scoped_refptr<SpdySession> session = |
89 spdy_session_pool->Get(pair, http_session.get(), BoundNetLog()); | 89 spdy_session_pool->Get(pair, http_session.get(), BoundNetLog()); |
90 EXPECT_TRUE(spdy_session_pool->HasSession(pair)); | 90 EXPECT_TRUE(spdy_session_pool->HasSession(pair)); |
91 | 91 |
92 scoped_refptr<TCPSocketParams> tcp_params = | 92 scoped_refptr<TCPSocketParams> tcp_params = |
93 new TCPSocketParams(kTestHost, kTestPort, MEDIUM, GURL(), false); | 93 new TCPSocketParams(kTestHost, kTestPort, MEDIUM, GURL(), false); |
(...skipping 11 matching lines...) Expand all Loading... |
105 // Delete the first session. | 105 // Delete the first session. |
106 session = NULL; | 106 session = NULL; |
107 | 107 |
108 // Delete the second session. | 108 // Delete the second session. |
109 spdy_session_pool->Remove(session2); | 109 spdy_session_pool->Remove(session2); |
110 session2 = NULL; | 110 session2 = NULL; |
111 } | 111 } |
112 | 112 |
113 } // namespace | 113 } // namespace |
114 } // namespace net | 114 } // namespace net |
OLD | NEW |