Index: webrtc/modules/pacing/paced_sender_unittest.cc |
diff --git a/webrtc/modules/pacing/paced_sender_unittest.cc b/webrtc/modules/pacing/paced_sender_unittest.cc |
index 063ec1e1947f566578850b24646b9e79c285a329..12f621aa7d4e357a6f132ff29e88fc70d6c31190 100644 |
--- a/webrtc/modules/pacing/paced_sender_unittest.cc |
+++ b/webrtc/modules/pacing/paced_sender_unittest.cc |
@@ -357,6 +357,29 @@ TEST_F(PacedSenderTest, Padding) { |
send_bucket_->Process(); |
} |
+TEST_F(PacedSenderTest, NoPaddingBeforeNormalPacket) { |
+ send_bucket_->SetEstimatedBitrate(kTargetBitrateBps); |
+ send_bucket_->SetAllocatedSendBitrate(kTargetBitrateBps, kTargetBitrateBps); |
+ |
+ EXPECT_CALL(callback_, TimeToSendPadding(_, _)).Times(0); |
+ send_bucket_->Process(); |
+ clock_.AdvanceTimeMilliseconds(send_bucket_->TimeUntilNextProcess()); |
+ |
+ send_bucket_->Process(); |
+ clock_.AdvanceTimeMilliseconds(send_bucket_->TimeUntilNextProcess()); |
+ |
+ uint32_t ssrc = 12345; |
+ uint16_t sequence_number = 1234; |
+ int64_t capture_time_ms = 56789; |
+ |
+ SendAndExpectPacket(PacedSender::kNormalPriority, ssrc, sequence_number++, |
+ capture_time_ms, 250, false); |
+ EXPECT_CALL(callback_, TimeToSendPadding(250, _)) |
+ .Times(1) |
+ .WillOnce(Return(250)); |
+ send_bucket_->Process(); |
+} |
+ |
TEST_F(PacedSenderTest, VerifyPaddingUpToBitrate) { |
uint32_t ssrc = 12345; |
uint16_t sequence_number = 1234; |
@@ -392,7 +415,10 @@ TEST_F(PacedSenderTest, VerifyAverageBitrateVaryingMediaPayload) { |
send_bucket_.reset(new PacedSender(&clock_, &callback)); |
send_bucket_->SetProbingEnabled(false); |
send_bucket_->SetEstimatedBitrate(kTargetBitrateBps); |
- send_bucket_->SetAllocatedSendBitrate(kTargetBitrateBps, kTargetBitrateBps); |
+ |
+ send_bucket_->SetAllocatedSendBitrate( |
+ 0 /*allocated_bitrate_bps*/, |
+ kTargetBitrateBps * 2 /* max_padding_bitrate_bps */); |
int64_t start_time = clock_.TimeInMilliseconds(); |
size_t media_bytes = 0; |