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

Unified Diff: webrtc/modules/pacing/paced_sender_unittest.cc

Issue 1993113003: Refactor how padding is calculated. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed unitialized memory. Created 4 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698