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

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

Issue 10796085: Give MockRead and MockWrite distinct types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix compile. Created 8 years, 4 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_spdy2_unittest.cc ('k') | no next file » | 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 "net/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include "net/base/host_cache.h" 7 #include "net/base/host_cache.h"
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "net/base/net_log_unittest.h" 9 #include "net/base/net_log_unittest.h"
10 #include "net/spdy/spdy_io_buffer.h" 10 #include "net/spdy/spdy_io_buffer.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 SpdySessionDependencies session_deps; 176 SpdySessionDependencies session_deps;
177 session_deps.host_resolver->set_synchronous_mode(true); 177 session_deps.host_resolver->set_synchronous_mode(true);
178 178
179 MockConnect connect_data(SYNCHRONOUS, OK); 179 MockConnect connect_data(SYNCHRONOUS, OK);
180 scoped_ptr<SpdyFrame> read_ping(ConstructSpdyPing()); 180 scoped_ptr<SpdyFrame> read_ping(ConstructSpdyPing());
181 MockRead reads[] = { 181 MockRead reads[] = {
182 CreateMockRead(*read_ping), 182 CreateMockRead(*read_ping),
183 MockRead(SYNCHRONOUS, 0, 0) // EOF 183 MockRead(SYNCHRONOUS, 0, 0) // EOF
184 }; 184 };
185 scoped_ptr<SpdyFrame> write_ping(ConstructSpdyPing()); 185 scoped_ptr<SpdyFrame> write_ping(ConstructSpdyPing());
186 MockRead writes[] = { 186 MockWrite writes[] = {
187 CreateMockRead(*write_ping), 187 CreateMockWrite(*write_ping),
188 }; 188 };
189 StaticSocketDataProvider data( 189 StaticSocketDataProvider data(
190 reads, arraysize(reads), writes, arraysize(writes)); 190 reads, arraysize(reads), writes, arraysize(writes));
191 data.set_connect_data(connect_data); 191 data.set_connect_data(connect_data);
192 session_deps.socket_factory->AddSocketDataProvider(&data); 192 session_deps.socket_factory->AddSocketDataProvider(&data);
193 193
194 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); 194 SSLSocketDataProvider ssl(SYNCHRONOUS, OK);
195 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); 195 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
196 196
197 scoped_refptr<HttpNetworkSession> http_session( 197 scoped_refptr<HttpNetworkSession> http_session(
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 SpdySessionDependencies session_deps; 329 SpdySessionDependencies session_deps;
330 session_deps.host_resolver->set_synchronous_mode(true); 330 session_deps.host_resolver->set_synchronous_mode(true);
331 331
332 MockConnect connect_data(SYNCHRONOUS, OK); 332 MockConnect connect_data(SYNCHRONOUS, OK);
333 scoped_ptr<SpdyFrame> read_ping(ConstructSpdyPing()); 333 scoped_ptr<SpdyFrame> read_ping(ConstructSpdyPing());
334 MockRead reads[] = { 334 MockRead reads[] = {
335 CreateMockRead(*read_ping), 335 CreateMockRead(*read_ping),
336 MockRead(SYNCHRONOUS, 0, 0) // EOF 336 MockRead(SYNCHRONOUS, 0, 0) // EOF
337 }; 337 };
338 scoped_ptr<SpdyFrame> write_ping(ConstructSpdyPing()); 338 scoped_ptr<SpdyFrame> write_ping(ConstructSpdyPing());
339 MockRead writes[] = { 339 MockWrite writes[] = {
340 CreateMockRead(*write_ping), 340 CreateMockWrite(*write_ping),
341 }; 341 };
342 StaticSocketDataProvider data( 342 StaticSocketDataProvider data(
343 reads, arraysize(reads), writes, arraysize(writes)); 343 reads, arraysize(reads), writes, arraysize(writes));
344 data.set_connect_data(connect_data); 344 data.set_connect_data(connect_data);
345 session_deps.socket_factory->AddSocketDataProvider(&data); 345 session_deps.socket_factory->AddSocketDataProvider(&data);
346 346
347 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); 347 SSLSocketDataProvider ssl(SYNCHRONOUS, OK);
348 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); 348 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
349 349
350 scoped_refptr<HttpNetworkSession> http_session( 350 scoped_refptr<HttpNetworkSession> http_session(
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 EXPECT_EQ(1u, spdy_stream2->stream_id()); 1444 EXPECT_EQ(1u, spdy_stream2->stream_id());
1445 1445
1446 spdy_stream1->Cancel(); 1446 spdy_stream1->Cancel();
1447 spdy_stream1 = NULL; 1447 spdy_stream1 = NULL;
1448 1448
1449 spdy_stream2->Cancel(); 1449 spdy_stream2->Cancel();
1450 spdy_stream2 = NULL; 1450 spdy_stream2 = NULL;
1451 } 1451 }
1452 1452
1453 } // namespace net 1453 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_spdy2_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698