Index: net/quic/quic_session_test.cc |
diff --git a/net/quic/quic_session_test.cc b/net/quic/quic_session_test.cc |
index 0a5032e70885846adb43ec89de5e6c7415a9c675..471262072c0532c287d0297ad311af1dedc8fdfc 100644 |
--- a/net/quic/quic_session_test.cc |
+++ b/net/quic/quic_session_test.cc |
@@ -729,23 +729,26 @@ TEST_P(QuicSessionTest, HandshakeUnblocksFlowControlBlockedHeadersStream) { |
EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); |
QuicStreamId stream_id = 5; |
// Write until the header stream is flow control blocked. |
+ SpdyHeaderBlock headers; |
while (!headers_stream->flow_controller()->IsBlocked() && stream_id < 2010) { |
EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); |
EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); |
- SpdyHeaderBlock headers; |
headers["header"] = base::Uint64ToString(base::RandUint64()) + |
base::Uint64ToString(base::RandUint64()) + |
base::Uint64ToString(base::RandUint64()); |
headers_stream->WriteHeaders(stream_id, headers, true, nullptr); |
stream_id += 2; |
} |
+ // Write one more to ensure that the headers stream has buffered data. The |
+ // random headers may have exactly filled the flow control window. |
+ headers_stream->WriteHeaders(stream_id, headers, true, nullptr); |
+ EXPECT_TRUE(headers_stream->HasBufferedData()); |
+ |
EXPECT_TRUE(headers_stream->flow_controller()->IsBlocked()); |
EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); |
EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); |
EXPECT_TRUE(session_.IsStreamFlowControlBlocked()); |
EXPECT_FALSE(session_.HasDataToWrite()); |
- // TODO(rtenneti): crbug.com/423586 headers_stream->HasBufferedData is flaky. |
- // EXPECT_TRUE(headers_stream->HasBufferedData()); |
// Now complete the crypto handshake, resulting in an increased flow control |
// send window. |