Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Side by Side Diff: net/spdy/spdy_stream_unittest.cc

Issue 8990001: base::Bind: Convert most of net/http. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698