Index: webrtc/modules/video_coding/frame_buffer2_unittest.cc |
diff --git a/webrtc/modules/video_coding/frame_buffer2_unittest.cc b/webrtc/modules/video_coding/frame_buffer2_unittest.cc |
index 5c81d0284d4d34956aea4499e8631b5cb96a931c..674ae29bfc9c8945da69224bdadef33e0cc5e7c3 100644 |
--- a/webrtc/modules/video_coding/frame_buffer2_unittest.cc |
+++ b/webrtc/modules/video_coding/frame_buffer2_unittest.cc |
@@ -70,6 +70,7 @@ class VCMJitterEstimatorMock : public VCMJitterEstimator { |
void(int64_t frameDelayMs, |
uint32_t frameSizeBytes, |
bool incompleteFrame)); |
+ MOCK_METHOD1(GetJitterEstimate, int(double rttMultiplier)); |
stefan-webrtc
2016/08/02 14:19:03
rtt_multiplier
|
}; |
class FrameObjectFake : public FrameObject { |
@@ -178,7 +179,7 @@ class TestFrameBuffer2 : public ::testing::Test { |
SimulatedClock clock_; |
VCMTimingFake timing_; |
- VCMJitterEstimatorMock jitter_estimator_; |
+ ::testing::NiceMock<VCMJitterEstimatorMock> jitter_estimator_; |
FrameBuffer buffer_; |
std::vector<std::unique_ptr<FrameObject>> frames_; |
Random rand_; |
@@ -336,5 +337,19 @@ TEST_F(TestFrameBuffer2, InsertLateFrame) { |
CheckNoFrame(2); |
} |
+TEST_F(TestFrameBuffer2, ProtectionMode) { |
+ uint16_t pid = Rand(); |
+ uint32_t ts = Rand(); |
+ |
+ EXPECT_CALL(jitter_estimator_, GetJitterEstimate(1.0)); |
+ InsertFrame(pid, 0, ts, false); |
+ ExtractFrame(); |
+ |
+ buffer_.SetProtectionMode(kProtectionNackFEC); |
+ EXPECT_CALL(jitter_estimator_, GetJitterEstimate(0.0)); |
+ InsertFrame(pid + 1, 0, ts, false); |
+ ExtractFrame(); |
+} |
+ |
} // namespace video_coding |
} // namespace webrtc |