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

Side by Side Diff: net/spdy/spdy_network_transaction_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, 5 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 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 stream->size()); 1714 stream->size());
1715 scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0)); 1715 scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0));
1716 scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true)); 1716 scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true));
1717 MockRead reads[] = { 1717 MockRead reads[] = {
1718 CreateMockRead(*stream_reply, 1), 1718 CreateMockRead(*stream_reply, 1),
1719 MockRead(ASYNC, 0, 3) // EOF 1719 MockRead(ASYNC, 0, 3) // EOF
1720 }; 1720 };
1721 1721
1722 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0)); 1722 scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0));
1723 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); 1723 scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true));
1724 MockRead writes[] = { 1724 MockWrite writes[] = {
1725 CreateMockWrite(*req, 0), 1725 CreateMockWrite(*req, 0),
1726 CreateMockWrite(*body, 2), 1726 CreateMockWrite(*body, 2),
1727 }; 1727 };
1728 1728
1729 DeterministicSocketData data(reads, arraysize(reads), 1729 DeterministicSocketData data(reads, arraysize(reads),
1730 writes, arraysize(writes)); 1730 writes, arraysize(writes));
1731 NormalSpdyTransactionHelper helper(CreatePostRequest(), 1731 NormalSpdyTransactionHelper helper(CreatePostRequest(),
1732 BoundNetLog(), GetParam(), NULL); 1732 BoundNetLog(), GetParam(), NULL);
1733 helper.SetDeterministic(); 1733 helper.SetDeterministic();
1734 helper.RunPreTestSetup(); 1734 helper.RunPreTestSetup();
(...skipping 4371 matching lines...) Expand 10 before | Expand all | Expand 10 after
6106 // And now we can allow everything else to run to completion. 6106 // And now we can allow everything else to run to completion.
6107 data.SetStop(10); 6107 data.SetStop(10);
6108 data.Run(); 6108 data.Run();
6109 EXPECT_EQ(OK, callback2.WaitForResult()); 6109 EXPECT_EQ(OK, callback2.WaitForResult());
6110 EXPECT_EQ(OK, callback3.WaitForResult()); 6110 EXPECT_EQ(OK, callback3.WaitForResult());
6111 6111
6112 helper.VerifyDataConsumed(); 6112 helper.VerifyDataConsumed();
6113 } 6113 }
6114 6114
6115 } // namespace net 6115 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_network_transaction_spdy2_unittest.cc ('k') | net/spdy/spdy_session_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698