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

Unified Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 2064593002: Change SPDY to call request_callback after data is sent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: call cb only after the whole data has been sent if there was data Created 4 years, 6 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
« net/spdy/spdy_http_stream.cc ('K') | « net/spdy/spdy_http_stream_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_network_transaction_unittest.cc
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 85b17e50b16f102b9a4d3149d051bd41ccaa3fde..cf86f6954b208e37a68591d747d582f63186b2dc 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -280,7 +280,7 @@ class SpdyNetworkTransactionTest
session_->spdy_session_pool()->CloseCurrentSessions(ERR_ABORTED);
}
- void WaitForHeaders() { output_.rv = callback_.WaitForResult(); }
+ void WaitForCallbackToComplete() { output_.rv = callback_.WaitForResult(); }
// Most tests will want to call this function. In particular, the MockReads
// should end with an empty read, and that read needs to be processed to
@@ -2051,8 +2051,7 @@ TEST_P(SpdyNetworkTransactionTest, ResponseBeforePostCompletes) {
ASSERT_TRUE(helper.StartDefaultTest());
- helper.WaitForHeaders();
- EXPECT_EQ(OK, helper.output().rv);
+ base::RunLoop().RunUntilIdle();
// Process the request headers, SYN_REPLY, and response body.
// The request body is still in flight.
@@ -2061,6 +2060,8 @@ TEST_P(SpdyNetworkTransactionTest, ResponseBeforePostCompletes) {
// Finish sending the request body.
upload_chunked_data_stream()->AppendData(kUploadData, kUploadDataSize, true);
+ helper.WaitForCallbackToComplete();
+ EXPECT_EQ(OK, helper.output().rv);
std::string response_body;
EXPECT_EQ(OK, ReadTransaction(helper.trans(), &response_body));
« net/spdy/spdy_http_stream.cc ('K') | « net/spdy/spdy_http_stream_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698