OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "net/spdy/spdy_stream.h" | 6 #include "net/spdy/spdy_stream.h" |
7 #include "net/spdy/spdy_http_utils.h" | 7 #include "net/spdy/spdy_http_utils.h" |
8 #include "net/spdy/spdy_session.h" | 8 #include "net/spdy/spdy_session.h" |
9 #include "net/spdy/spdy_test_util.h" | 9 #include "net/spdy/spdy_test_util.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 scoped_refptr<SpdySession> session(CreateSpdySession()); | 181 scoped_refptr<SpdySession> session(CreateSpdySession()); |
182 const char* kStreamUrl = "http://www.google.com/"; | 182 const char* kStreamUrl = "http://www.google.com/"; |
183 GURL url(kStreamUrl); | 183 GURL url(kStreamUrl); |
184 | 184 |
185 HostPortPair host_port_pair("www.google.com", 80); | 185 HostPortPair host_port_pair("www.google.com", 80); |
186 scoped_refptr<TransportSocketParams> transport_params( | 186 scoped_refptr<TransportSocketParams> transport_params( |
187 new TransportSocketParams(host_port_pair, LOWEST, false, false)); | 187 new TransportSocketParams(host_port_pair, LOWEST, false, false)); |
188 | 188 |
189 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); | 189 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); |
190 EXPECT_EQ(OK, | 190 EXPECT_EQ(OK, connection->Init(host_port_pair.ToString(), transport_params, |
191 connection->Init(host_port_pair.ToString(), | 191 LOWEST, CompletionCallback(), |
192 transport_params, | 192 session_->GetTransportSocketPool(), |
193 LOWEST, | 193 BoundNetLog())); |
194 NULL, | |
195 session_->GetTransportSocketPool(), | |
196 BoundNetLog())); | |
197 session->InitializeWithSocket(connection.release(), false, OK); | 194 session->InitializeWithSocket(connection.release(), false, OK); |
198 | 195 |
199 scoped_refptr<SpdyStream> stream; | 196 scoped_refptr<SpdyStream> stream; |
200 ASSERT_EQ( | 197 ASSERT_EQ( |
201 OK, | 198 OK, |
202 session->CreateStream(url, LOWEST, &stream, BoundNetLog(), NULL)); | 199 session->CreateStream(url, LOWEST, &stream, BoundNetLog(), NULL)); |
203 scoped_refptr<IOBufferWithSize> buf(new IOBufferWithSize(8)); | 200 scoped_refptr<IOBufferWithSize> buf(new IOBufferWithSize(8)); |
204 memcpy(buf->data(), "\0hello!\xff", 8); | 201 memcpy(buf->data(), "\0hello!\xff", 8); |
205 TestOldCompletionCallback callback; | 202 TestOldCompletionCallback callback; |
206 | 203 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 stream->OnHeaders(headers); | 258 stream->OnHeaders(headers); |
262 | 259 |
263 stream->set_response_received(); | 260 stream->set_response_received(); |
264 EXPECT_TRUE(stream->response_received()); | 261 EXPECT_TRUE(stream->response_received()); |
265 EXPECT_TRUE(stream->HasUrl()); | 262 EXPECT_TRUE(stream->HasUrl()); |
266 EXPECT_EQ(kStreamUrl, stream->GetUrl().spec()); | 263 EXPECT_EQ(kStreamUrl, stream->GetUrl().spec()); |
267 } | 264 } |
268 | 265 |
269 | 266 |
270 } // namespace net | 267 } // namespace net |
OLD | NEW |