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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 // blocking). | 637 // blocking). |
638 session_.set_writev_consumes_all_data(true); | 638 session_.set_writev_consumes_all_data(true); |
639 | 639 |
640 // Create a stream, and send enough data to make it flow control blocked. | 640 // Create a stream, and send enough data to make it flow control blocked. |
641 TestStream* stream2 = session_.CreateOutgoingDataStream(); | 641 TestStream* stream2 = session_.CreateOutgoingDataStream(); |
642 string body(kDefaultFlowControlSendWindow, '.'); | 642 string body(kDefaultFlowControlSendWindow, '.'); |
643 EXPECT_FALSE(stream2->flow_controller()->IsBlocked()); | 643 EXPECT_FALSE(stream2->flow_controller()->IsBlocked()); |
644 stream2->SendBody(body, false); | 644 stream2->SendBody(body, false); |
645 EXPECT_TRUE(stream2->flow_controller()->IsBlocked()); | 645 EXPECT_TRUE(stream2->flow_controller()->IsBlocked()); |
646 | 646 |
| 647 // The handshake message will call OnCanWrite, so the stream can resume |
| 648 // writing. |
| 649 EXPECT_CALL(*stream2, OnCanWrite()); |
647 // Now complete the crypto handshake, resulting in an increased flow control | 650 // Now complete the crypto handshake, resulting in an increased flow control |
648 // send window. | 651 // send window. |
649 CryptoHandshakeMessage msg; | 652 CryptoHandshakeMessage msg; |
650 session_.GetCryptoStream()->OnHandshakeMessage(msg); | 653 session_.GetCryptoStream()->OnHandshakeMessage(msg); |
651 | 654 |
652 // Stream is now unblocked. | 655 // Stream is now unblocked. |
653 EXPECT_FALSE(stream2->flow_controller()->IsBlocked()); | 656 EXPECT_FALSE(stream2->flow_controller()->IsBlocked()); |
654 } | 657 } |
655 | 658 |
656 TEST_P(QuicSessionTest, InvalidFlowControlWindowInHandshake) { | 659 TEST_P(QuicSessionTest, InvalidFlowControlWindowInHandshake) { |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 } | 948 } |
946 | 949 |
947 // Called after any new data is received by the session, and triggers the call | 950 // Called after any new data is received by the session, and triggers the call |
948 // to close the connection. | 951 // to close the connection. |
949 session_.PostProcessAfterData(); | 952 session_.PostProcessAfterData(); |
950 } | 953 } |
951 | 954 |
952 } // namespace | 955 } // namespace |
953 } // namespace test | 956 } // namespace test |
954 } // namespace net | 957 } // namespace net |
OLD | NEW |