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

Side by Side Diff: net/spdy/spdy_network_transaction_spdy2_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
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/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 stream->size()); 1708 stream->size());
1709 scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); 1709 scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0));
1710 scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); 1710 scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true));
1711 MockRead reads[] = { 1711 MockRead reads[] = {
1712 CreateMockRead(*stream_reply, 1), 1712 CreateMockRead(*stream_reply, 1),
1713 MockRead(ASYNC, 0, 3) // EOF 1713 MockRead(ASYNC, 0, 3) // EOF
1714 }; 1714 };
1715 1715
1716 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); 1716 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0));
1717 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); 1717 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true));
1718 MockRead writes[] = { 1718 MockWrite writes[] = {
1719 CreateMockWrite(*req, 0), 1719 CreateMockWrite(*req, 0),
1720 CreateMockWrite(*body, 2), 1720 CreateMockWrite(*body, 2),
1721 }; 1721 };
1722 1722
1723 DeterministicSocketData data(reads, arraysize(reads), 1723 DeterministicSocketData data(reads, arraysize(reads),
1724 writes, arraysize(writes)); 1724 writes, arraysize(writes));
1725 NormalSpdyTransactionHelper helper(CreatePostRequest(), 1725 NormalSpdyTransactionHelper helper(CreatePostRequest(),
1726 BoundNetLog(), GetParam(), NULL); 1726 BoundNetLog(), GetParam(), NULL);
1727 helper.SetDeterministic(); 1727 helper.SetDeterministic();
1728 helper.RunPreTestSetup(); 1728 helper.RunPreTestSetup();
(...skipping 3818 matching lines...) Expand 10 before | Expand all | Expand 10 after
5547 // And now we can allow everything else to run to completion. 5547 // And now we can allow everything else to run to completion.
5548 data.SetStop(10); 5548 data.SetStop(10);
5549 data.Run(); 5549 data.Run();
5550 EXPECT_EQ(OK, callback2.WaitForResult()); 5550 EXPECT_EQ(OK, callback2.WaitForResult());
5551 EXPECT_EQ(OK, callback3.WaitForResult()); 5551 EXPECT_EQ(OK, callback3.WaitForResult());
5552 5552
5553 helper.VerifyDataConsumed(); 5553 helper.VerifyDataConsumed();
5554 } 5554 }
5555 5555
5556 } // namespace net 5556 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socks_client_socket_pool_unittest.cc ('k') | net/spdy/spdy_network_transaction_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698