OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/quic_session.h" | 5 #include "net/quic/quic_session.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 TEST_P(QuicSessionTest, HandshakeUnblocksFlowControlBlockedCryptoStream) { | 661 TEST_P(QuicSessionTest, HandshakeUnblocksFlowControlBlockedCryptoStream) { |
662 if (version() <= QUIC_VERSION_19) { | 662 if (version() <= QUIC_VERSION_19) { |
663 return; | 663 return; |
664 } | 664 } |
665 // Test that if the crypto stream is flow control blocked, then if the SHLO | 665 // Test that if the crypto stream is flow control blocked, then if the SHLO |
666 // contains a larger send window offset, the stream becomes unblocked. | 666 // contains a larger send window offset, the stream becomes unblocked. |
667 session_.set_writev_consumes_all_data(true); | 667 session_.set_writev_consumes_all_data(true); |
668 TestCryptoStream* crypto_stream = session_.GetCryptoStream(); | 668 TestCryptoStream* crypto_stream = session_.GetCryptoStream(); |
669 EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); | 669 EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); |
670 QuicHeadersStream* headers_stream = | 670 QuicHeadersStream* headers_stream = |
671 QuicSessionPeer::GetHeadersStream(&session_); | 671 QuicSessionPeer::GetHeadersStream(&session_); |
672 EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked()); | 672 EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked()); |
673 // Write until the crypto stream is flow control blocked. | 673 // Write until the crypto stream is flow control blocked. |
674 int i = 0; | 674 int i = 0; |
675 while (!crypto_stream->flow_controller()->IsBlocked() && i < 1000) { | 675 while (!crypto_stream->flow_controller()->IsBlocked() && i < 1000) { |
676 QuicConfig config; | 676 QuicConfig config; |
677 CryptoHandshakeMessage crypto_message; | 677 CryptoHandshakeMessage crypto_message; |
678 config.ToHandshakeMessage(&crypto_message); | 678 config.ToHandshakeMessage(&crypto_message); |
679 crypto_stream->SendHandshakeMessage(crypto_message); | 679 crypto_stream->SendHandshakeMessage(crypto_message); |
680 ++i; | 680 ++i; |
681 } | 681 } |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 } | 1025 } |
1026 | 1026 |
1027 // Called after any new data is received by the session, and triggers the call | 1027 // Called after any new data is received by the session, and triggers the call |
1028 // to close the connection. | 1028 // to close the connection. |
1029 session_.PostProcessAfterData(); | 1029 session_.PostProcessAfterData(); |
1030 } | 1030 } |
1031 | 1031 |
1032 } // namespace | 1032 } // namespace |
1033 } // namespace test | 1033 } // namespace test |
1034 } // namespace net | 1034 } // namespace net |
OLD | NEW |