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

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

Issue 335433002: Minor change to keep the code similar between chromium and internal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/quic/test_tools/quic_test_utils.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_flow_controller.h" 5 #include "net/quic/quic_flow_controller.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "net/quic/quic_flags.h" 8 #include "net/quic/quic_flags.h"
9 #include "net/quic/quic_utils.h" 9 #include "net/quic/quic_utils.h"
10 #include "net/quic/test_tools/quic_connection_peer.h" 10 #include "net/quic/test_tools/quic_connection_peer.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 // Result is that once again we have a fully open receive window. 114 // Result is that once again we have a fully open receive window.
115 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 115 EXPECT_FALSE(flow_controller_->FlowControlViolation());
116 EXPECT_EQ(kInitialFlowControlWindowForTest, 116 EXPECT_EQ(kInitialFlowControlWindowForTest,
117 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 117 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
118 } 118 }
119 119
120 TEST_F(QuicFlowControllerTest, 120 TEST_F(QuicFlowControllerTest,
121 DisabledWhenQuicVersionDoesNotSupportFlowControl) { 121 DisabledWhenQuicVersionDoesNotSupportFlowControl) {
122 // Only support version 16: no flow control. 122 // Only support version 16: no flow control.
123 QuicVersionVector supported_versions; 123 QuicConnectionPeer::SetSupportedVersions(&connection_,
124 supported_versions.push_back(QUIC_VERSION_16); 124 SupportedVersions(QUIC_VERSION_16));
125 QuicConnectionPeer::SetSupportedVersions(&connection_, supported_versions);
126 125
127 Initialize(); 126 Initialize();
128 127
129 MockConnection connection(false); 128 MockConnection connection(false);
130 129
131 // Should not be enabled, and should not report as blocked. 130 // Should not be enabled, and should not report as blocked.
132 EXPECT_FALSE(flow_controller_->IsEnabled()); 131 EXPECT_FALSE(flow_controller_->IsEnabled());
133 EXPECT_FALSE(flow_controller_->IsBlocked()); 132 EXPECT_FALSE(flow_controller_->IsBlocked());
134 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 133 EXPECT_FALSE(flow_controller_->FlowControlViolation());
135 134
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 flow_controller_->AddBytesSent(send_window_); 215 flow_controller_->AddBytesSent(send_window_);
217 EXPECT_TRUE(flow_controller_->IsBlocked()); 216 EXPECT_TRUE(flow_controller_->IsBlocked());
218 EXPECT_EQ(0u, flow_controller_->SendWindowSize()); 217 EXPECT_EQ(0u, flow_controller_->SendWindowSize());
219 218
220 // BLOCKED frame should get sent as send offset has changed. 219 // BLOCKED frame should get sent as send offset has changed.
221 flow_controller_->MaybeSendBlocked(); 220 flow_controller_->MaybeSendBlocked();
222 } 221 }
223 222
224 } // namespace test 223 } // namespace test
225 } // namespace net 224 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698