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

Unified Diff: webrtc/modules/video_coding/frame_buffer2_unittest.cc

Issue 2138873003: Wire up VCMTiming in FrameBuffer2. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Protection mode unittest. Created 4 years, 4 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
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | webrtc/modules/video_coding/jitter_estimator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | webrtc/modules/video_coding/jitter_estimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698