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

Unified Diff: net/spdy/spdy_network_transaction_spdy3_unittest.cc

Issue 10795012: Modify DeterministicSocketData to verify that the sequence number of reads and writes start at zero… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sleevi's comments 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
Index: net/spdy/spdy_network_transaction_spdy3_unittest.cc
diff --git a/net/spdy/spdy_network_transaction_spdy3_unittest.cc b/net/spdy/spdy_network_transaction_spdy3_unittest.cc
index e66bad9a3999c159b24e4f063b5e4dd41cbeaa7f..7597ccf68375e1b11ab2daa2bc946e943115072d 100644
--- a/net/spdy/spdy_network_transaction_spdy3_unittest.cc
+++ b/net/spdy/spdy_network_transaction_spdy3_unittest.cc
@@ -5536,7 +5536,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushClaimBeforeHeaders) {
CreateMockRead(*stream2_headers, 4),
MockRead(ASYNC, reinterpret_cast<const char*>(kPushBodyFrame),
arraysize(kPushBodyFrame), 5),
- MockRead(ASYNC, 0, 5), // EOF
+ MockRead(ASYNC, 0, 6), // EOF
};
HttpResponseInfo response;
@@ -5585,10 +5585,6 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushClaimBeforeHeaders) {
std::string result;
ReadResult(trans, data.get(), &result);
- // Verify that we consumed all test data.
- EXPECT_TRUE(data->at_read_eof());
- EXPECT_TRUE(data->at_write_eof());
-
// Verify that the received push data is same as the expected push data.
EXPECT_EQ(result2.compare(expected_push_result), 0)
<< "Received data: "
@@ -5610,6 +5606,13 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushClaimBeforeHeaders) {
// Verify the pushed stream.
EXPECT_TRUE(response2.headers != NULL);
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine());
+
+ // Read the final EOF (which will close the session)
+ data->RunFor(1);
+
+ // Verify that we consumed all test data.
+ EXPECT_TRUE(data->at_read_eof());
+ EXPECT_TRUE(data->at_write_eof());
}
TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) {
@@ -5686,7 +5689,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) {
CreateMockRead(*stream2_headers2, 5),
MockRead(ASYNC, reinterpret_cast<const char*>(kPushBodyFrame),
arraysize(kPushBodyFrame), 6),
- MockRead(ASYNC, 0, 6), // EOF
+ MockRead(ASYNC, 0, 7), // EOF
};
HttpResponseInfo response;
@@ -5735,10 +5738,6 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) {
std::string result;
ReadResult(trans, data.get(), &result);
- // Verify that we consumed all test data.
- EXPECT_TRUE(data->at_read_eof());
- EXPECT_TRUE(data->at_write_eof());
-
// Verify that the received push data is same as the expected push data.
EXPECT_EQ(result2.compare(expected_push_result), 0)
<< "Received data: "
@@ -5771,6 +5770,13 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) {
EXPECT_TRUE(response2.headers->HasHeaderValue("hello", "bye"));
EXPECT_TRUE(response2.headers->HasHeaderValue("status", "200"));
EXPECT_TRUE(response2.headers->HasHeaderValue("version", "HTTP/1.1"));
+
+ // Read the final EOF (which will close the session)
+ data->RunFor(1);
+
+ // Verify that we consumed all test data.
+ EXPECT_TRUE(data->at_read_eof());
+ EXPECT_TRUE(data->at_write_eof());
}
TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyWithHeaders) {

Powered by Google App Engine
This is Rietveld 408576698