| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); | 189 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); |
| 190 EXPECT_EQ(OK, connection->Init(host_port_pair.ToString(), transport_params, | 190 EXPECT_EQ(OK, connection->Init(host_port_pair.ToString(), transport_params, |
| 191 LOWEST, CompletionCallback(), | 191 LOWEST, CompletionCallback(), |
| 192 session_->GetTransportSocketPool(), | 192 session_->GetTransportSocketPool(), |
| 193 BoundNetLog())); | 193 BoundNetLog())); |
| 194 session->InitializeWithSocket(connection.release(), false, OK); | 194 session->InitializeWithSocket(connection.release(), false, OK); |
| 195 | 195 |
| 196 scoped_refptr<SpdyStream> stream; | 196 scoped_refptr<SpdyStream> stream; |
| 197 ASSERT_EQ( | 197 ASSERT_EQ( |
| 198 OK, | 198 OK, |
| 199 session->CreateStream(url, LOWEST, &stream, BoundNetLog(), NULL)); | 199 session->CreateStream(url, LOWEST, &stream, BoundNetLog(), |
| 200 CompletionCallback())); |
| 200 scoped_refptr<IOBufferWithSize> buf(new IOBufferWithSize(8)); | 201 scoped_refptr<IOBufferWithSize> buf(new IOBufferWithSize(8)); |
| 201 memcpy(buf->data(), "\0hello!\xff", 8); | 202 memcpy(buf->data(), "\0hello!\xff", 8); |
| 202 TestOldCompletionCallback callback; | 203 TestOldCompletionCallback callback; |
| 203 | 204 |
| 204 scoped_ptr<TestSpdyStreamDelegate> delegate( | 205 scoped_ptr<TestSpdyStreamDelegate> delegate( |
| 205 new TestSpdyStreamDelegate(stream.get(), buf.get(), &callback)); | 206 new TestSpdyStreamDelegate(stream.get(), buf.get(), &callback)); |
| 206 stream->SetDelegate(delegate.get()); | 207 stream->SetDelegate(delegate.get()); |
| 207 | 208 |
| 208 EXPECT_FALSE(stream->HasUrl()); | 209 EXPECT_FALSE(stream->HasUrl()); |
| 209 | 210 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 stream->OnHeaders(headers); | 259 stream->OnHeaders(headers); |
| 259 | 260 |
| 260 stream->set_response_received(); | 261 stream->set_response_received(); |
| 261 EXPECT_TRUE(stream->response_received()); | 262 EXPECT_TRUE(stream->response_received()); |
| 262 EXPECT_TRUE(stream->HasUrl()); | 263 EXPECT_TRUE(stream->HasUrl()); |
| 263 EXPECT_EQ(kStreamUrl, stream->GetUrl().spec()); | 264 EXPECT_EQ(kStreamUrl, stream->GetUrl().spec()); |
| 264 } | 265 } |
| 265 | 266 |
| 266 | 267 |
| 267 } // namespace net | 268 } // namespace net |
| OLD | NEW |