OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/congestion_control/pacing_sender.h" | 5 #include "net/quic/congestion_control/pacing_sender.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 QuicConfig config; | 347 QuicConfig config; |
348 pacing_sender_->SetFromConfig(config, Perspective::IS_SERVER); | 348 pacing_sender_->SetFromConfig(config, Perspective::IS_SERVER); |
349 | 349 |
350 EXPECT_CALL(*mock_sender_, ResumeConnectionState(_, true)); | 350 EXPECT_CALL(*mock_sender_, ResumeConnectionState(_, true)); |
351 CachedNetworkParameters cached_network_params; | 351 CachedNetworkParameters cached_network_params; |
352 pacing_sender_->ResumeConnectionState(cached_network_params, true); | 352 pacing_sender_->ResumeConnectionState(cached_network_params, true); |
353 | 353 |
354 EXPECT_CALL(*mock_sender_, SetNumEmulatedConnections(2)); | 354 EXPECT_CALL(*mock_sender_, SetNumEmulatedConnections(2)); |
355 pacing_sender_->SetNumEmulatedConnections(2); | 355 pacing_sender_->SetNumEmulatedConnections(2); |
356 | 356 |
357 EXPECT_CALL(*mock_sender_, SetMaxCongestionWindow(kBytes)); | |
358 pacing_sender_->SetMaxCongestionWindow(kBytes); | |
359 | |
360 SendAlgorithmInterface::CongestionVector packets; | 357 SendAlgorithmInterface::CongestionVector packets; |
361 EXPECT_CALL(*mock_sender_, OnCongestionEvent(true, kBytes, packets, packets)); | 358 EXPECT_CALL(*mock_sender_, OnCongestionEvent(true, kBytes, packets, packets)); |
362 pacing_sender_->OnCongestionEvent(true, kBytes, packets, packets); | 359 pacing_sender_->OnCongestionEvent(true, kBytes, packets, packets); |
363 | 360 |
364 EXPECT_CALL(*mock_sender_, OnPacketSent(kTime, kBytes, 123u, kBytes, | 361 EXPECT_CALL(*mock_sender_, OnPacketSent(kTime, kBytes, 123u, kBytes, |
365 HAS_RETRANSMITTABLE_DATA)); | 362 HAS_RETRANSMITTABLE_DATA)); |
366 EXPECT_CALL(*mock_sender_, PacingRate(_)).WillOnce(Return(kBandwidth)); | 363 EXPECT_CALL(*mock_sender_, PacingRate(_)).WillOnce(Return(kBandwidth)); |
367 pacing_sender_->OnPacketSent(kTime, kBytes, 123u, kBytes, | 364 pacing_sender_->OnPacketSent(kTime, kBytes, 123u, kBytes, |
368 HAS_RETRANSMITTABLE_DATA); | 365 HAS_RETRANSMITTABLE_DATA); |
369 | 366 |
(...skipping 29 matching lines...) Expand all Loading... |
399 EXPECT_CALL(*mock_sender_, GetSlowStartThreshold()).WillOnce(Return(kBytes)); | 396 EXPECT_CALL(*mock_sender_, GetSlowStartThreshold()).WillOnce(Return(kBytes)); |
400 EXPECT_EQ(kBytes, pacing_sender_->GetSlowStartThreshold()); | 397 EXPECT_EQ(kBytes, pacing_sender_->GetSlowStartThreshold()); |
401 | 398 |
402 EXPECT_CALL(*mock_sender_, GetCongestionControlType()) | 399 EXPECT_CALL(*mock_sender_, GetCongestionControlType()) |
403 .WillOnce(Return(kReno)); | 400 .WillOnce(Return(kReno)); |
404 EXPECT_EQ(kReno, pacing_sender_->GetCongestionControlType()); | 401 EXPECT_EQ(kReno, pacing_sender_->GetCongestionControlType()); |
405 } | 402 } |
406 | 403 |
407 } // namespace test | 404 } // namespace test |
408 } // namespace net | 405 } // namespace net |
OLD | NEW |