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

Unified Diff: net/quic/core/congestion_control/pacing_sender_test.cc

Issue 2228613002: Rollback of internal changelist 128865569. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@129053230
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/congestion_control/pacing_sender.cc ('k') | net/quic/core/quic_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/congestion_control/pacing_sender_test.cc
diff --git a/net/quic/core/congestion_control/pacing_sender_test.cc b/net/quic/core/congestion_control/pacing_sender_test.cc
index cefcdae861b4d934d9c6ad0fe08da731568a6de8..046c157b73b6168cd7700176dcd12668f6c17ee4 100644
--- a/net/quic/core/congestion_control/pacing_sender_test.cc
+++ b/net/quic/core/congestion_control/pacing_sender_test.cc
@@ -29,8 +29,9 @@ class PacingSenderTest : public ::testing::Test {
infinite_time_(QuicTime::Delta::Infinite()),
packet_number_(1),
mock_sender_(new StrictMock<MockSendAlgorithm>()),
- pacing_sender_(new PacingSender) {
- pacing_sender_->SetSender(mock_sender_, true);
+ pacing_sender_(new PacingSender(mock_sender_,
+ QuicTime::Delta::FromMilliseconds(1),
+ 0)) {
// Pick arbitrary time.
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(9));
}
@@ -38,19 +39,11 @@ class PacingSenderTest : public ::testing::Test {
~PacingSenderTest() override {}
void InitPacingRate(QuicPacketCount burst_size, QuicBandwidth bandwidth) {
+ pacing_sender_.reset();
mock_sender_ = new StrictMock<MockSendAlgorithm>();
- pacing_sender_.reset(new PacingSender);
- pacing_sender_->SetSender(mock_sender_, true);
+ pacing_sender_.reset(new PacingSender(
+ mock_sender_, QuicTime::Delta::FromMilliseconds(1), burst_size));
EXPECT_CALL(*mock_sender_, PacingRate(_)).WillRepeatedly(Return(bandwidth));
- if (burst_size == 0) {
- EXPECT_CALL(*mock_sender_, OnCongestionEvent(_, _, _, _));
- SendAlgorithmInterface::CongestionVector lost_packets;
- lost_packets.push_back(std::make_pair(1, kMaxPacketSize));
- SendAlgorithmInterface::CongestionVector empty;
- pacing_sender_->OnCongestionEvent(true, 1234, empty, lost_packets);
- } else if (burst_size != kInitialBurstPackets) {
- LOG(FATAL) << "Unsupported burst_size specificied.";
- }
}
void CheckPacketIsSentImmediately(HasRetransmittableData retransmittable_data,
@@ -344,9 +337,6 @@ TEST_F(PacingSenderTest, NoBurstInRecovery) {
}
TEST_F(PacingSenderTest, VerifyInnerSenderCalled) {
- // Configure pacing rate of 1 packet per 1 ms with no burst tokens.
- InitPacingRate(0, QuicBandwidth::FromBytesAndTimeDelta(
- kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1)));
QuicBandwidth kBandwidth = QuicBandwidth::FromBitsPerSecond(1000);
QuicTime kTime = QuicTime::Infinite();
QuicTime::Delta kTimeDelta = QuicTime::Delta::Infinite();
« no previous file with comments | « net/quic/core/congestion_control/pacing_sender.cc ('k') | net/quic/core/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698