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

Unified Diff: net/spdy/spdy_session_spdy3_unittest.cc

Issue 15740018: [SPDY] Change SpdyStream::QueueStreamData() To SendStreamData() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 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_proxy_client_socket.cc ('k') | net/spdy/spdy_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_spdy3_unittest.cc
diff --git a/net/spdy/spdy_session_spdy3_unittest.cc b/net/spdy/spdy_session_spdy3_unittest.cc
index 21fe59ae66c47b59adae6e85e6c957d73f681843..ec8c7e91cceb152dcceb059e8423b1c0ffac416e 100644
--- a/net/spdy/spdy_session_spdy3_unittest.cc
+++ b/net/spdy/spdy_session_spdy3_unittest.cc
@@ -2995,7 +2995,7 @@ void SpdySessionSpdy3Test::RunResumeAfterUnstallTest31(
EXPECT_EQ("200", delegate.GetResponseHeaderValue(":status"));
EXPECT_EQ("HTTP/1.1", delegate.GetResponseHeaderValue(":version"));
EXPECT_EQ(std::string(), delegate.TakeReceivedData());
- EXPECT_EQ(static_cast<int>(kBodyDataSize), delegate.body_data_sent());
+ EXPECT_TRUE(data.at_write_eof());
}
// Run the resume-after-unstall test with all possible stall and
@@ -3178,13 +3178,13 @@ TEST_F(SpdySessionSpdy3Test, ResumeByPriorityAfterSendWindowSizeIncrease31) {
EXPECT_EQ("200", delegate1.GetResponseHeaderValue(":status"));
EXPECT_EQ("HTTP/1.1", delegate1.GetResponseHeaderValue(":version"));
EXPECT_EQ(std::string(), delegate1.TakeReceivedData());
- EXPECT_EQ(static_cast<int>(kBodyDataSize), delegate1.body_data_sent());
EXPECT_TRUE(delegate2.send_headers_completed());
EXPECT_EQ("200", delegate2.GetResponseHeaderValue(":status"));
EXPECT_EQ("HTTP/1.1", delegate2.GetResponseHeaderValue(":version"));
EXPECT_EQ(std::string(), delegate2.TakeReceivedData());
- EXPECT_EQ(static_cast<int>(kBodyDataSize), delegate2.body_data_sent());
+
+ EXPECT_TRUE(data.at_write_eof());
}
// Delegate that closes a given stream after sending its body.
@@ -3200,12 +3200,13 @@ class StreamClosingDelegate : public test::StreamDelegateWithBody {
stream_to_close_ = stream_to_close;
}
- virtual void OnSendBody() OVERRIDE {
- test::StreamDelegateWithBody::OnSendBody();
+ virtual SpdySendStatus OnSendBodyComplete() OVERRIDE {
+ SpdySendStatus status = test::StreamDelegateWithBody::OnSendBodyComplete();
if (stream_to_close_) {
stream_to_close_->Close();
EXPECT_EQ(NULL, stream_to_close_.get());
}
+ return status;
}
private:
@@ -3342,6 +3343,8 @@ TEST_F(SpdySessionSpdy3Test, SendWindowSizeIncreaseWithDeletedStreams31) {
// Unstall stream2, which should then close stream3.
delegate2.set_stream_to_close(stream3);
UnstallSessionSend(session, kBodyDataSize);
+
+ data.RunFor(1);
EXPECT_EQ(NULL, stream3.get());
EXPECT_FALSE(stream2->send_stalled_by_flow_control());
@@ -3349,7 +3352,7 @@ TEST_F(SpdySessionSpdy3Test, SendWindowSizeIncreaseWithDeletedStreams31) {
EXPECT_TRUE(session->IsStreamActive(stream_id2));
EXPECT_FALSE(session->IsStreamActive(stream_id3));
- data.RunFor(3);
+ data.RunFor(2);
EXPECT_EQ(NULL, stream2.get());
EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate1.WaitForClose());
@@ -3358,17 +3361,16 @@ TEST_F(SpdySessionSpdy3Test, SendWindowSizeIncreaseWithDeletedStreams31) {
EXPECT_TRUE(delegate1.send_headers_completed());
EXPECT_EQ(std::string(), delegate1.TakeReceivedData());
- EXPECT_EQ(0, delegate1.body_data_sent());
EXPECT_TRUE(delegate2.send_headers_completed());
EXPECT_EQ("200", delegate2.GetResponseHeaderValue(":status"));
EXPECT_EQ("HTTP/1.1", delegate2.GetResponseHeaderValue(":version"));
EXPECT_EQ(std::string(), delegate2.TakeReceivedData());
- EXPECT_EQ(static_cast<int>(kBodyDataSize), delegate2.body_data_sent());
EXPECT_TRUE(delegate3.send_headers_completed());
EXPECT_EQ(std::string(), delegate3.TakeReceivedData());
- EXPECT_EQ(0, delegate3.body_data_sent());
+
+ EXPECT_TRUE(data.at_write_eof());
}
// Cause a stall by reducing the flow control send window to
@@ -3477,11 +3479,11 @@ TEST_F(SpdySessionSpdy3Test, SendWindowSizeIncreaseWithDeletedSession31) {
EXPECT_TRUE(delegate1.send_headers_completed());
EXPECT_EQ(std::string(), delegate1.TakeReceivedData());
- EXPECT_EQ(0, delegate1.body_data_sent());
EXPECT_TRUE(delegate2.send_headers_completed());
EXPECT_EQ(std::string(), delegate2.TakeReceivedData());
- EXPECT_EQ(0, delegate2.body_data_sent());
+
+ EXPECT_TRUE(data.at_write_eof());
}
// Tests the case of a non-SPDY request closing an idle SPDY session when no
« no previous file with comments | « net/spdy/spdy_proxy_client_socket.cc ('k') | net/spdy/spdy_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698