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

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

Issue 1412293003: Allow pacer to boost bitrate in order to meet time constraints. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Cast Created 5 years, 1 month 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 | « webrtc/modules/pacing/paced_sender.cc ('k') | webrtc/video_engine/vie_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 78a49cd4c39b34ac9c00b02c7b3d02927a34073b..1a2936df530914e6d9607b62005f6b36ed4aa4ec 100644
--- a/webrtc/modules/pacing/paced_sender_unittest.cc
+++ b/webrtc/modules/pacing/paced_sender_unittest.cc
@@ -560,20 +560,16 @@ TEST_F(PacedSenderTest, Pause) {
EXPECT_CALL(callback_, TimeToSendPacket(_, _, capture_time_ms, false))
.Times(3)
.WillRepeatedly(Return(true));
- send_bucket_->Resume();
-
- EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess());
- clock_.AdvanceTimeMilliseconds(5);
- EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess());
- EXPECT_EQ(0, send_bucket_->Process());
-
EXPECT_CALL(callback_, TimeToSendPacket(_, _, second_capture_time_ms, false))
.Times(1)
.WillRepeatedly(Return(true));
+ send_bucket_->Resume();
+
EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess());
clock_.AdvanceTimeMilliseconds(5);
EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess());
EXPECT_EQ(0, send_bucket_->Process());
+
EXPECT_EQ(0, send_bucket_->QueueInMs());
}
@@ -664,10 +660,9 @@ TEST_F(PacedSenderTest, ExpectedQueueTimeMs) {
EXPECT_EQ(0, send_bucket_->ExpectedQueueTimeMs());
- // Allow for aliasing, duration should be in [expected(n - 1), expected(n)].
- EXPECT_LE(duration, queue_in_ms);
- EXPECT_GE(duration,
- queue_in_ms - static_cast<int64_t>(kPacketSize * 8 / kMaxBitrate));
+ // Allow for aliasing, duration should be within one pack of max time limit.
+ EXPECT_NEAR(duration, PacedSender::kMaxQueueLengthMs,
+ static_cast<int64_t>(kPacketSize * 8 / kMaxBitrate));
}
TEST_F(PacedSenderTest, QueueTimeGrowsOverTime) {
« no previous file with comments | « webrtc/modules/pacing/paced_sender.cc ('k') | webrtc/video_engine/vie_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698