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

Side by Side Diff: net/quic/quic_session_test.cc

Issue 639713007: Fix a QUIC flow control bug where a stream is flow control blocked when (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Set_server_idle_timeout_76821863_2
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/reliable_quic_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/reliable_quic_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698