| 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/spdy/spdy_proxy_client_socket.h" | 5 #include "net/spdy/spdy_proxy_client_socket.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 SpdyTestUtil spdy_util_; | 118 SpdyTestUtil spdy_util_; |
| 119 scoped_ptr<SpdyProxyClientSocket> sock_; | 119 scoped_ptr<SpdyProxyClientSocket> sock_; |
| 120 TestCompletionCallback read_callback_; | 120 TestCompletionCallback read_callback_; |
| 121 TestCompletionCallback write_callback_; | 121 TestCompletionCallback write_callback_; |
| 122 scoped_ptr<DeterministicSocketData> data_; | 122 scoped_ptr<DeterministicSocketData> data_; |
| 123 BoundTestNetLog net_log_; | 123 BoundTestNetLog net_log_; |
| 124 | 124 |
| 125 private: | 125 private: |
| 126 scoped_refptr<HttpNetworkSession> session_; | 126 scoped_ptr<HttpNetworkSession> session_; |
| 127 scoped_refptr<IOBuffer> read_buf_; | 127 scoped_refptr<IOBuffer> read_buf_; |
| 128 SpdySessionDependencies session_deps_; | 128 SpdySessionDependencies session_deps_; |
| 129 MockConnect connect_data_; | 129 MockConnect connect_data_; |
| 130 base::WeakPtr<SpdySession> spdy_session_; | 130 base::WeakPtr<SpdySession> spdy_session_; |
| 131 BufferedSpdyFramer framer_; | 131 BufferedSpdyFramer framer_; |
| 132 | 132 |
| 133 std::string user_agent_; | 133 std::string user_agent_; |
| 134 GURL url_; | 134 GURL url_; |
| 135 HostPortPair proxy_host_port_; | 135 HostPortPair proxy_host_port_; |
| 136 HostPortPair endpoint_host_port_pair_; | 136 HostPortPair endpoint_host_port_pair_; |
| 137 ProxyServer proxy_; | 137 ProxyServer proxy_; |
| 138 SpdySessionKey endpoint_spdy_session_key_; | 138 SpdySessionKey endpoint_spdy_session_key_; |
| 139 | 139 |
| 140 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocketTest); | 140 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocketTest); |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 INSTANTIATE_TEST_CASE_P(NextProto, | 143 INSTANTIATE_TEST_CASE_P(NextProto, |
| 144 SpdyProxyClientSocketTest, | 144 SpdyProxyClientSocketTest, |
| 145 testing::Values(kProtoSPDY31, | 145 testing::Values(kProtoSPDY31, |
| 146 kProtoHTTP2)); | 146 kProtoHTTP2)); |
| 147 | 147 |
| 148 SpdyProxyClientSocketTest::SpdyProxyClientSocketTest() | 148 SpdyProxyClientSocketTest::SpdyProxyClientSocketTest() |
| 149 : spdy_util_(GetParam()), | 149 : spdy_util_(GetParam()), |
| 150 session_(NULL), | |
| 151 read_buf_(NULL), | 150 read_buf_(NULL), |
| 152 session_deps_(GetParam()), | 151 session_deps_(GetParam()), |
| 153 connect_data_(SYNCHRONOUS, OK), | 152 connect_data_(SYNCHRONOUS, OK), |
| 154 framer_(spdy_util_.spdy_version(), false), | 153 framer_(spdy_util_.spdy_version(), false), |
| 155 user_agent_(kUserAgent), | 154 user_agent_(kUserAgent), |
| 156 url_(kRequestUrl), | 155 url_(kRequestUrl), |
| 157 proxy_host_port_(kProxyHost, kProxyPort), | 156 proxy_host_port_(kProxyHost, kProxyPort), |
| 158 endpoint_host_port_pair_(kOriginHost, kOriginPort), | 157 endpoint_host_port_pair_(kOriginHost, kOriginPort), |
| 159 proxy_(ProxyServer::SCHEME_HTTPS, proxy_host_port_), | 158 proxy_(ProxyServer::SCHEME_HTTPS, proxy_host_port_), |
| 160 endpoint_spdy_session_key_(endpoint_host_port_pair_, | 159 endpoint_spdy_session_key_(endpoint_host_port_pair_, |
| (...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 | 1375 |
| 1377 EXPECT_FALSE(sock_.get()); | 1376 EXPECT_FALSE(sock_.get()); |
| 1378 EXPECT_TRUE(read_callback.have_result()); | 1377 EXPECT_TRUE(read_callback.have_result()); |
| 1379 EXPECT_FALSE(write_callback_.have_result()); | 1378 EXPECT_FALSE(write_callback_.have_result()); |
| 1380 | 1379 |
| 1381 // Let the RST_STREAM write while |rst| is in-scope. | 1380 // Let the RST_STREAM write while |rst| is in-scope. |
| 1382 base::MessageLoop::current()->RunUntilIdle(); | 1381 base::MessageLoop::current()->RunUntilIdle(); |
| 1383 } | 1382 } |
| 1384 | 1383 |
| 1385 } // namespace net | 1384 } // namespace net |
| OLD | NEW |