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

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

Issue 9425016: Change MockRead and MockWrite (et. al.) to take an IoMode enum, instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 8 years, 10 months 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
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "net/base/completion_callback.h" 6 #include "net/base/completion_callback.h"
7 #include "net/spdy/spdy_stream.h" 7 #include "net/spdy/spdy_stream.h"
8 #include "net/spdy/spdy_http_utils.h" 8 #include "net/spdy/spdy_http_utils.h"
9 #include "net/spdy/spdy_session.h" 9 #include "net/spdy/spdy_session.h"
10 #include "net/spdy/spdy_test_util.h" 10 #include "net/spdy/spdy_test_util.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 }; 157 };
158 writes[0].sequence_number = 0; 158 writes[0].sequence_number = 0;
159 writes[1].sequence_number = 2; 159 writes[1].sequence_number = 2;
160 160
161 scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); 161 scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1));
162 scoped_ptr<spdy::SpdyFrame> echo( 162 scoped_ptr<spdy::SpdyFrame> echo(
163 ConstructSpdyBodyFrame("\0hello!\xff", 8)); 163 ConstructSpdyBodyFrame("\0hello!\xff", 8));
164 MockRead reads[] = { 164 MockRead reads[] = {
165 CreateMockRead(*resp), 165 CreateMockRead(*resp),
166 CreateMockRead(*echo), 166 CreateMockRead(*echo),
167 MockRead(true, 0, 0), // EOF 167 MockRead(ASYNC, 0, 0), // EOF
168 }; 168 };
169 reads[0].sequence_number = 1; 169 reads[0].sequence_number = 1;
170 reads[1].sequence_number = 3; 170 reads[1].sequence_number = 3;
171 reads[2].sequence_number = 4; 171 reads[2].sequence_number = 4;
172 172
173 scoped_ptr<OrderedSocketData> data( 173 scoped_ptr<OrderedSocketData> data(
174 new OrderedSocketData(reads, arraysize(reads), 174 new OrderedSocketData(reads, arraysize(reads),
175 writes, arraysize(writes))); 175 writes, arraysize(writes)));
176 MockConnect connect_data(SYNCHRONOUS, OK); 176 MockConnect connect_data(SYNCHRONOUS, OK);
177 data->set_connect_data(connect_data); 177 data->set_connect_data(connect_data);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 stream->OnHeaders(headers); 260 stream->OnHeaders(headers);
261 261
262 stream->set_response_received(); 262 stream->set_response_received();
263 EXPECT_TRUE(stream->response_received()); 263 EXPECT_TRUE(stream->response_received());
264 EXPECT_TRUE(stream->HasUrl()); 264 EXPECT_TRUE(stream->HasUrl());
265 EXPECT_EQ(kStreamUrl, stream->GetUrl().spec()); 265 EXPECT_EQ(kStreamUrl, stream->GetUrl().spec());
266 } 266 }
267 267
268 268
269 } // namespace net 269 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698