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

Unified Diff: net/quic/reliable_quic_stream_test.cc

Issue 242583002: Disable QuicFlowController for QUIC versions < QUIC_VERSION_17 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/quic/reliable_quic_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/reliable_quic_stream_test.cc
diff --git a/net/quic/reliable_quic_stream_test.cc b/net/quic/reliable_quic_stream_test.cc
index 8ee03b58126e6687aba5da83bb751c7109f18f56..5e07e8d34722d8a4b2da76d5c7d1e8ca63c8fe5b 100644
--- a/net/quic/reliable_quic_stream_test.cc
+++ b/net/quic/reliable_quic_stream_test.cc
@@ -73,7 +73,8 @@ class ReliableQuicStreamTest : public ::testing::TestWithParam<bool> {
public:
ReliableQuicStreamTest()
: initial_flow_control_window_bytes_(kMaxPacketSize),
- zero_(QuicTime::Delta::Zero()) {
+ zero_(QuicTime::Delta::Zero()),
+ supported_versions_(QuicSupportedVersions()) {
headers_[":host"] = "www.google.com";
headers_[":path"] = "/index.hml";
headers_[":scheme"] = "https";
@@ -103,8 +104,13 @@ class ReliableQuicStreamTest : public ::testing::TestWithParam<bool> {
"JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo ";
}
+ void set_supported_versions(const QuicVersionVector& versions) {
+ supported_versions_ = versions;
+ }
+
void Initialize(bool stream_should_process_data) {
- connection_ = new StrictMock<MockConnection>(kIsServer);
+ connection_ =
+ new StrictMock<MockConnection>(kIsServer, supported_versions_);
session_.reset(new StrictMock<MockSession>(connection_));
// New streams rely on having the peer's flow control receive window
@@ -136,6 +142,7 @@ class ReliableQuicStreamTest : public ::testing::TestWithParam<bool> {
QuicWriteBlockedList* write_blocked_list_;
uint32 initial_flow_control_window_bytes_;
QuicTime::Delta zero_;
+ QuicVersionVector supported_versions_;
};
TEST_F(ReliableQuicStreamTest, WriteAllData) {
@@ -341,6 +348,26 @@ TEST_F(ReliableQuicStreamTest, StreamFlowControlMultipleWindowUpdates) {
stream_.get()->flow_controller()));
}
+TEST_F(ReliableQuicStreamTest, StreamFlowControlShouldNotBlockInLessThanQ017) {
+ // TODO(rjshade): Remove this test when we no longer have any versions <
+ // QUIC_VERSION_17.
+ ValueRestore<bool> old_flag(&FLAGS_enable_quic_stream_flow_control, true);
+
+ // Make sure we are using a version which does not support flow control.
+ const QuicVersionVector versions = {QUIC_VERSION_16};
+ set_supported_versions(versions);
+
+ // Peer is not talking QUIC_VERSION_17 so assumes that it can send a zero
+ // length flow control receive window with no consequences.
+ set_initial_flow_control_window_bytes(0);
+
+ Initialize(kShouldProcessData);
+
+ // The stream should _not_ be flow control blocked, because we are not talking
+ // a version which has flow control enabled.
+ EXPECT_FALSE(stream_->flow_controller()->IsBlocked());
+}
+
void SaveProxyAckNotifierDelegate(
scoped_refptr<QuicAckNotifier::DelegateInterface>* delegate_out,
QuicAckNotifier::DelegateInterface* delegate) {
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698