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

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

Issue 2183493002: Add a merely pass-through QuicMultipathSentPacketManager. Protected behind blocked flag FLAGS_quic_… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 <memory> 7 #include <memory>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // This test will generate two WINDOW_UPDATE frames. 160 // This test will generate two WINDOW_UPDATE frames.
161 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2); 161 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2);
162 162
163 Initialize(); 163 Initialize();
164 flow_controller_->set_auto_tune_receive_window(true); 164 flow_controller_->set_auto_tune_receive_window(true);
165 165
166 // Make sure clock is inititialized. 166 // Make sure clock is inititialized.
167 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 167 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
168 168
169 QuicSentPacketManagerInterface* manager = 169 QuicSentPacketManagerInterface* manager =
170 QuicConnectionPeer::GetSentPacketManager(&connection_); 170 QuicConnectionPeer::GetSentPacketManager(&connection_, kDefaultPathId);
171 171
172 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats()); 172 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats());
173 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt), 173 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt),
174 QuicTime::Delta::Zero(), QuicTime::Zero()); 174 QuicTime::Delta::Zero(), QuicTime::Zero());
175 175
176 EXPECT_FALSE(flow_controller_->IsBlocked()); 176 EXPECT_FALSE(flow_controller_->IsBlocked());
177 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 177 EXPECT_FALSE(flow_controller_->FlowControlViolation());
178 EXPECT_EQ(kInitialSessionFlowControlWindowForTest, 178 EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
179 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 179 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
180 180
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // This test will generate two WINDOW_UPDATE frames. 214 // This test will generate two WINDOW_UPDATE frames.
215 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2); 215 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2);
216 216
217 Initialize(); 217 Initialize();
218 flow_controller_->set_auto_tune_receive_window(true); 218 flow_controller_->set_auto_tune_receive_window(true);
219 219
220 // Make sure clock is inititialized. 220 // Make sure clock is inititialized.
221 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 221 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
222 222
223 QuicSentPacketManagerInterface* manager = 223 QuicSentPacketManagerInterface* manager =
224 QuicConnectionPeer::GetSentPacketManager(&connection_); 224 QuicConnectionPeer::GetSentPacketManager(&connection_, kDefaultPathId);
225 225
226 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats()); 226 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats());
227 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt), 227 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt),
228 QuicTime::Delta::Zero(), QuicTime::Zero()); 228 QuicTime::Delta::Zero(), QuicTime::Zero());
229 229
230 EXPECT_FALSE(flow_controller_->IsBlocked()); 230 EXPECT_FALSE(flow_controller_->IsBlocked());
231 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 231 EXPECT_FALSE(flow_controller_->FlowControlViolation());
232 EXPECT_EQ(kInitialSessionFlowControlWindowForTest, 232 EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
233 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 233 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
234 234
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // This test will generate two WINDOW_UPDATE frames. 268 // This test will generate two WINDOW_UPDATE frames.
269 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2); 269 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2);
270 270
271 Initialize(); 271 Initialize();
272 flow_controller_->set_auto_tune_receive_window(true); 272 flow_controller_->set_auto_tune_receive_window(true);
273 273
274 // Make sure clock is inititialized. 274 // Make sure clock is inititialized.
275 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 275 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
276 276
277 QuicSentPacketManagerInterface* manager = 277 QuicSentPacketManagerInterface* manager =
278 QuicConnectionPeer::GetSentPacketManager(&connection_); 278 QuicConnectionPeer::GetSentPacketManager(&connection_, kDefaultPathId);
279 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats()); 279 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats());
280 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt), 280 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt),
281 QuicTime::Delta::Zero(), QuicTime::Zero()); 281 QuicTime::Delta::Zero(), QuicTime::Zero());
282 282
283 EXPECT_FALSE(flow_controller_->IsBlocked()); 283 EXPECT_FALSE(flow_controller_->IsBlocked());
284 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 284 EXPECT_FALSE(flow_controller_->FlowControlViolation());
285 EXPECT_EQ(kInitialSessionFlowControlWindowForTest, 285 EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
286 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 286 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
287 287
288 QuicByteCount threshold = 288 QuicByteCount threshold =
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 // This test will generate two WINDOW_UPDATE frames. 324 // This test will generate two WINDOW_UPDATE frames.
325 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2); 325 EXPECT_CALL(connection_, SendWindowUpdate(stream_id_, ::testing::_)).Times(2);
326 326
327 Initialize(); 327 Initialize();
328 flow_controller_->set_auto_tune_receive_window(true); 328 flow_controller_->set_auto_tune_receive_window(true);
329 329
330 // Make sure clock is inititialized. 330 // Make sure clock is inititialized.
331 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 331 connection_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
332 332
333 QuicSentPacketManagerInterface* manager = 333 QuicSentPacketManagerInterface* manager =
334 QuicConnectionPeer::GetSentPacketManager(&connection_); 334 QuicConnectionPeer::GetSentPacketManager(&connection_, kDefaultPathId);
335 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats()); 335 RttStats* rtt_stats = const_cast<RttStats*>(manager->GetRttStats());
336 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt), 336 rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(kRtt),
337 QuicTime::Delta::Zero(), QuicTime::Zero()); 337 QuicTime::Delta::Zero(), QuicTime::Zero());
338 338
339 EXPECT_FALSE(flow_controller_->IsBlocked()); 339 EXPECT_FALSE(flow_controller_->IsBlocked());
340 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 340 EXPECT_FALSE(flow_controller_->FlowControlViolation());
341 EXPECT_EQ(kInitialSessionFlowControlWindowForTest, 341 EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
342 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get())); 342 QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
343 343
344 QuicByteCount threshold = 344 QuicByteCount threshold =
(...skipping 25 matching lines...) Expand all
370 EXPECT_FALSE(flow_controller_->FlowControlViolation()); 370 EXPECT_FALSE(flow_controller_->FlowControlViolation());
371 371
372 QuicByteCount new_threshold = 372 QuicByteCount new_threshold =
373 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get()); 373 QuicFlowControllerPeer::WindowUpdateThreshold(flow_controller_.get());
374 374
375 EXPECT_EQ(new_threshold, threshold); 375 EXPECT_EQ(new_threshold, threshold);
376 } 376 }
377 377
378 } // namespace test 378 } // namespace test
379 } // namespace net 379 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698