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

Unified Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 2965033002: Report interframe delay sum in old GetStats (Closed)
Patch Set: fix identation Created 3 years, 5 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/video/receive_statistics_proxy_unittest.cc
diff --git a/webrtc/video/receive_statistics_proxy_unittest.cc b/webrtc/video/receive_statistics_proxy_unittest.cc
index e219542768ecc630b361d2db6413710039ed5cbe..c7e5b90d587e4f73f6f2a93bb9225241220e2bce 100644
--- a/webrtc/video/receive_statistics_proxy_unittest.cc
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -97,6 +97,28 @@ TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesQpSum) {
statistics_proxy_->GetStats().qp_sum);
}
+TEST_F(ReceiveStatisticsProxyTest,
+ OnDecodedFrameIncreasesInterframeDelayMsSum) {
+ const uint64_t kInterframeDelayMs1 = 100;
+ const uint64_t kInterframeDelayMs2 = 200;
+ EXPECT_EQ(0u, statistics_proxy_->GetStats().interframe_delay_sum_ms);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(3u),
+ VideoContentType::UNSPECIFIED);
+ EXPECT_EQ(0u, statistics_proxy_->GetStats().interframe_delay_sum_ms);
+
+ fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs1);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
+ VideoContentType::UNSPECIFIED);
+ EXPECT_EQ(kInterframeDelayMs1,
+ statistics_proxy_->GetStats().interframe_delay_sum_ms);
+
+ fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs2);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(127u),
+ VideoContentType::UNSPECIFIED);
+ EXPECT_EQ(kInterframeDelayMs1 + kInterframeDelayMs2,
+ statistics_proxy_->GetStats().interframe_delay_sum_ms);
+}
+
TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpQpSumWontExist) {
EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum);
statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(),

Powered by Google App Engine
This is Rietveld 408576698