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

Unified Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 2946413002: Report timing frames info in GetStats. (Closed)
Patch Set: rebase 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
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2c4d3301950c40d952a4cba08827b6148184ecdd 100644
--- a/webrtc/video/receive_statistics_proxy_unittest.cc
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -247,6 +247,48 @@ TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsNoCNameForUnknownSsrc) {
EXPECT_STREQ("", statistics_proxy_->GetStats().c_name.c_str());
}
+TEST_F(ReceiveStatisticsProxyTest,
+ GetTimingFrameInfoReportsLongestTimingFrame) {
+ const int64_t kShortEndToEndDelay = 10;
+ const int64_t kMedEndToEndDelay = 20;
+ const int64_t kLongEndToEndDelay = 100;
+ const uint32_t kExpectedRtpTimestamp = 2;
+ TimingFrameInfo info;
+ rtc::Optional<TimingFrameInfo> result;
+ info.rtp_timestamp = kExpectedRtpTimestamp - 1;
+ info.capture_time_ms = 0;
+ info.decode_finish_ms = kShortEndToEndDelay;
+ statistics_proxy_->OnTimingFrameInfoUpdated(info);
+ info.rtp_timestamp =
+ kExpectedRtpTimestamp; // this frame should be reported in the end.
+ info.capture_time_ms = 0;
+ info.decode_finish_ms = kLongEndToEndDelay;
+ statistics_proxy_->OnTimingFrameInfoUpdated(info);
+ info.rtp_timestamp = kExpectedRtpTimestamp + 1;
+ info.capture_time_ms = 0;
+ info.decode_finish_ms = kMedEndToEndDelay;
+ statistics_proxy_->OnTimingFrameInfoUpdated(info);
+ result = statistics_proxy_->GetAndResetTimingFrameInfo();
+ EXPECT_TRUE(result);
+ EXPECT_EQ(kExpectedRtpTimestamp, result->rtp_timestamp);
+}
+
+TEST_F(ReceiveStatisticsProxyTest, GetTimingFrameInfoTimingFramesReportedOnce) {
+ const int64_t kShortEndToEndDelay = 10;
+ const uint32_t kExpectedRtpTimestamp = 2;
+ TimingFrameInfo info;
+ rtc::Optional<TimingFrameInfo> result;
+ info.rtp_timestamp = kExpectedRtpTimestamp;
+ info.capture_time_ms = 0;
+ info.decode_finish_ms = kShortEndToEndDelay;
+ statistics_proxy_->OnTimingFrameInfoUpdated(info);
+ result = statistics_proxy_->GetAndResetTimingFrameInfo();
+ EXPECT_TRUE(result);
+ EXPECT_EQ(kExpectedRtpTimestamp, result->rtp_timestamp);
+ result = statistics_proxy_->GetAndResetTimingFrameInfo();
+ EXPECT_FALSE(result);
+}
+
TEST_F(ReceiveStatisticsProxyTest, LifetimeHistogramIsUpdated) {
const int64_t kTimeSec = 3;
fake_clock_.AdvanceTimeMilliseconds(kTimeSec * 1000);
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698