diff options
Diffstat (limited to 'chromium/third_party/webrtc/modules/video_coding/main/source/media_optimization_unittest.cc')
-rw-r--r-- | chromium/third_party/webrtc/modules/video_coding/main/source/media_optimization_unittest.cc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/chromium/third_party/webrtc/modules/video_coding/main/source/media_optimization_unittest.cc b/chromium/third_party/webrtc/modules/video_coding/main/source/media_optimization_unittest.cc index 1425dad837b..bacfdc604ca 100644 --- a/chromium/third_party/webrtc/modules/video_coding/main/source/media_optimization_unittest.cc +++ b/chromium/third_party/webrtc/modules/video_coding/main/source/media_optimization_unittest.cc @@ -18,9 +18,6 @@ namespace media_optimization { class TestMediaOptimization : public ::testing::Test { protected: enum { - kId = 4711 // Id number for the MediaOptimization class. - }; - enum { kSampleRate = 90000 // RTP timestamps per second. }; @@ -28,14 +25,13 @@ class TestMediaOptimization : public ::testing::Test { // a special case (e.g. frame rate in media optimization). TestMediaOptimization() : clock_(1000), - media_opt_(kId, &clock_), + media_opt_(&clock_), frame_time_ms_(33), next_timestamp_(0) {} // This method mimics what happens in VideoSender::AddVideoFrame. void AddFrameAndAdvanceTime(int bitrate_bps, bool expect_frame_drop) { ASSERT_GE(bitrate_bps, 0); - media_opt_.UpdateIncomingFrameRate(); bool frame_dropped = media_opt_.DropFrame(); EXPECT_EQ(expect_frame_drop, frame_dropped); if (!frame_dropped) { @@ -63,12 +59,14 @@ TEST_F(TestMediaOptimization, VerifyMuting) { media_opt_.SuspendBelowMinBitrate(kThresholdBps, kWindowBps); // The video should not be suspended from the start. - EXPECT_FALSE(media_opt_.video_suspended()); + EXPECT_FALSE(media_opt_.IsVideoSuspended()); int target_bitrate_kbps = 100; media_opt_.SetTargetRates(target_bitrate_kbps * 1000, 0, // Lossrate. - 100); // RTT in ms. + 100, + NULL, + NULL); // RTT in ms. media_opt_.EnableFrameDropper(true); for (int time = 0; time < 2000; time += frame_time_ms_) { ASSERT_NO_FATAL_FAILURE(AddFrameAndAdvanceTime(target_bitrate_kbps, false)); @@ -77,11 +75,13 @@ TEST_F(TestMediaOptimization, VerifyMuting) { // Set the target rate below the limit for muting. media_opt_.SetTargetRates(kThresholdBps - 1000, 0, // Lossrate. - 100); // RTT in ms. + 100, + NULL, + NULL); // RTT in ms. // Expect the muter to engage immediately and stay muted. // Test during 2 seconds. for (int time = 0; time < 2000; time += frame_time_ms_) { - EXPECT_TRUE(media_opt_.video_suspended()); + EXPECT_TRUE(media_opt_.IsVideoSuspended()); ASSERT_NO_FATAL_FAILURE(AddFrameAndAdvanceTime(target_bitrate_kbps, true)); } @@ -89,22 +89,26 @@ TEST_F(TestMediaOptimization, VerifyMuting) { // limit + window. media_opt_.SetTargetRates(kThresholdBps + 1000, 0, // Lossrate. - 100); // RTT in ms. - // Expect the muter to stay muted. + 100, + NULL, + NULL); // RTT in ms. + // Expect the muter to stay muted. // Test during 2 seconds. for (int time = 0; time < 2000; time += frame_time_ms_) { - EXPECT_TRUE(media_opt_.video_suspended()); + EXPECT_TRUE(media_opt_.IsVideoSuspended()); ASSERT_NO_FATAL_FAILURE(AddFrameAndAdvanceTime(target_bitrate_kbps, true)); } // Set the target above limit + window. media_opt_.SetTargetRates(kThresholdBps + kWindowBps + 1000, 0, // Lossrate. - 100); // RTT in ms. + 100, + NULL, + NULL); // RTT in ms. // Expect the muter to disengage immediately. // Test during 2 seconds. for (int time = 0; time < 2000; time += frame_time_ms_) { - EXPECT_FALSE(media_opt_.video_suspended()); + EXPECT_FALSE(media_opt_.IsVideoSuspended()); ASSERT_NO_FATAL_FAILURE( AddFrameAndAdvanceTime((kThresholdBps + kWindowBps) / 1000, false)); } |