| 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_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
| 6 #include "base/ref_counted.h" | 6 #include "base/ref_counted.h" |
| 7 #include "net/spdy/spdy_session.h" | 7 #include "net/spdy/spdy_session.h" |
| 8 #include "net/spdy/spdy_test_util.h" | 8 #include "net/spdy/spdy_test_util.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 MockConnect connect_data(false, OK); | 185 MockConnect connect_data(false, OK); |
| 186 data->set_connect_data(connect_data); | 186 data->set_connect_data(connect_data); |
| 187 | 187 |
| 188 session_deps.socket_factory->AddSocketDataProvider(data.get()); | 188 session_deps.socket_factory->AddSocketDataProvider(data.get()); |
| 189 SpdySession::SetSSLMode(false); | 189 SpdySession::SetSSLMode(false); |
| 190 | 190 |
| 191 scoped_refptr<SpdySession> session(CreateSpdySession()); | 191 scoped_refptr<SpdySession> session(CreateSpdySession()); |
| 192 GURL url("http://www.google.com/"); | 192 GURL url("http://www.google.com/"); |
| 193 | 193 |
| 194 HostPortPair host_port_pair("www.google.com", 80); | 194 HostPortPair host_port_pair("www.google.com", 80); |
| 195 scoped_refptr<TCPSocketParams> tcp_params = | 195 scoped_refptr<TCPSocketParams> tcp_params( |
| 196 new TCPSocketParams(host_port_pair, LOWEST, GURL(), false); | 196 new TCPSocketParams(host_port_pair, LOWEST, GURL(), false)); |
| 197 | 197 |
| 198 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); | 198 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); |
| 199 EXPECT_EQ(OK, | 199 EXPECT_EQ(OK, |
| 200 connection->Init(host_port_pair.ToString(), tcp_params, LOWEST, | 200 connection->Init(host_port_pair.ToString(), tcp_params, LOWEST, |
| 201 NULL, session_->tcp_socket_pool(), BoundNetLog())); | 201 NULL, session_->tcp_socket_pool(), BoundNetLog())); |
| 202 session->InitializeWithSocket(connection.release(), false, OK); | 202 session->InitializeWithSocket(connection.release(), false, OK); |
| 203 | 203 |
| 204 scoped_refptr<SpdyStream> stream; | 204 scoped_refptr<SpdyStream> stream; |
| 205 ASSERT_EQ( | 205 ASSERT_EQ( |
| 206 OK, | 206 OK, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 225 | 225 |
| 226 EXPECT_TRUE(delegate->send_headers_completed()); | 226 EXPECT_TRUE(delegate->send_headers_completed()); |
| 227 EXPECT_EQ("200", (*delegate->response())["status"]); | 227 EXPECT_EQ("200", (*delegate->response())["status"]); |
| 228 EXPECT_EQ("HTTP/1.1", (*delegate->response())["version"]); | 228 EXPECT_EQ("HTTP/1.1", (*delegate->response())["version"]); |
| 229 EXPECT_EQ(std::string("\0hello!\xff", 8), delegate->received_data()); | 229 EXPECT_EQ(std::string("\0hello!\xff", 8), delegate->received_data()); |
| 230 EXPECT_EQ(8, delegate->data_sent()); | 230 EXPECT_EQ(8, delegate->data_sent()); |
| 231 EXPECT_TRUE(delegate->closed()); | 231 EXPECT_TRUE(delegate->closed()); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace net | 234 } // namespace net |
| OLD | NEW |