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

Unified Diff: net/spdy/spdy_network_transaction_spdy2_unittest.cc

Issue 10815074: Instead of enqueueing SPDY frames, enqueue SPDY streams that are ready to produce data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove logging and cleanup 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_io_buffer.cc ('k') | net/spdy/spdy_network_transaction_spdy3_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_network_transaction_spdy2_unittest.cc
diff --git a/net/spdy/spdy_network_transaction_spdy2_unittest.cc b/net/spdy/spdy_network_transaction_spdy2_unittest.cc
index 95bfc8734eeb1567f6d3e0c106e8f645dd9628f8..2cff815074696c4e324f799041eca01406a1900a 100644
--- a/net/spdy/spdy_network_transaction_spdy2_unittest.cc
+++ b/net/spdy/spdy_network_transaction_spdy2_unittest.cc
@@ -1709,21 +1709,35 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, PostWithEarlySynReply) {
scoped_ptr<SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0));
scoped_ptr<SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true));
MockRead reads[] = {
- CreateMockRead(*stream_reply, 2),
- CreateMockRead(*stream_body, 3),
- MockRead(SYNCHRONOUS, 0, 0) // EOF
+ CreateMockRead(*stream_reply, 1),
+ MockRead(ASYNC, 0, 3) // EOF
};
- DelayedSocketData data(0, reads, arraysize(reads), NULL, 0);
- NormalSpdyTransactionHelper helper(request,
+ scoped_ptr<SpdyFrame> req(ConstructSpdyPost(kUploadDataSize, NULL, 0));
+ scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true));
+ MockRead writes[] = {
+ CreateMockWrite(*req, 0),
+ CreateMockWrite(*body, 2),
+ };
+
+ DeterministicSocketData data(reads, arraysize(reads),
+ writes, arraysize(writes));
+ NormalSpdyTransactionHelper helper(CreatePostRequest(),
BoundNetLog(), GetParam(), NULL);
+ helper.SetDeterministic();
helper.RunPreTestSetup();
- helper.AddData(&data);
- helper.RunDefaultTest();
- helper.VerifyDataConsumed();
+ helper.AddDeterministicData(&data);
+ HttpNetworkTransaction* trans = helper.trans();
- TransactionHelperResult out = helper.output();
- EXPECT_EQ(ERR_SYN_REPLY_NOT_RECEIVED, out.rv);
+ TestCompletionCallback callback;
+ int rv = trans->Start(
+ &CreatePostRequest(), callback.callback(), BoundNetLog());
+ EXPECT_EQ(ERR_IO_PENDING, rv);
+
+ data.RunFor(2);
+ rv = callback.WaitForResult();
+ EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, rv);
+ data.RunFor(1);
}
// The client upon cancellation tries to send a RST_STREAM frame. The mock
@@ -5457,10 +5471,11 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, OutOfOrderSynStream) {
// This first request will start to establish the SpdySession.
// Then we will start the second (MEDIUM priority) and then third
// (HIGHEST priority) request in such a way that the third will actually
- // start before the second, causing the second to be re-numbered.
+ // start before the second, causing the second to be numbered differently
+ // than the order they were created.
scoped_ptr<SpdyFrame> req1(ConstructSpdyGet(NULL, 0, false, 1, LOWEST));
- scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, MEDIUM));
- scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, HIGHEST));
+ scoped_ptr<SpdyFrame> req2(ConstructSpdyGet(NULL, 0, false, 3, HIGHEST));
+ scoped_ptr<SpdyFrame> req3(ConstructSpdyGet(NULL, 0, false, 5, MEDIUM));
MockWrite writes[] = {
CreateMockWrite(*req1, 0),
CreateMockWrite(*req2, 3),
« no previous file with comments | « net/spdy/spdy_io_buffer.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