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

Unified Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 3008983002: Change reporting of timing frames conditions in GetStats on receive side (Closed)
Patch Set: Implement Tommi@ comments Created 3 years, 3 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 98ec7eddad24409ec3097b6c6568c3190be064a3..06a19669b17cd7177089bd18400d8c8348d3ae72 100644
--- a/webrtc/video/receive_statistics_proxy_unittest.cc
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -308,7 +308,7 @@ TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsNoCNameForUnknownSsrc) {
}
TEST_F(ReceiveStatisticsProxyTest,
- GetTimingFrameInfoReportsLongestTimingFrame) {
+ ReportsLongestTimingFrameInfo) {
const int64_t kShortEndToEndDelay = 10;
const int64_t kMedEndToEndDelay = 20;
const int64_t kLongEndToEndDelay = 100;
@@ -328,24 +328,28 @@ TEST_F(ReceiveStatisticsProxyTest,
info.capture_time_ms = 0;
info.decode_finish_ms = kMedEndToEndDelay;
statistics_proxy_->OnTimingFrameInfoUpdated(info);
- result = statistics_proxy_->GetAndResetTimingFrameInfo();
+ result = statistics_proxy_->GetStats().timing_frame_info;
EXPECT_TRUE(result);
EXPECT_EQ(kExpectedRtpTimestamp, result->rtp_timestamp);
}
-TEST_F(ReceiveStatisticsProxyTest, GetTimingFrameInfoTimingFramesReportedOnce) {
+TEST_F(ReceiveStatisticsProxyTest, RespectsReportingIntervalForTimingFrames) {
+ TimingFrameInfo info;
const int64_t kShortEndToEndDelay = 10;
const uint32_t kExpectedRtpTimestamp = 2;
- TimingFrameInfo info;
+ const int64_t kShortDelayMs = 1000;
+ const int64_t kLongDelayMs = 10000;
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();
+ fake_clock_.AdvanceTimeMilliseconds(kShortDelayMs);
+ result = statistics_proxy_->GetStats().timing_frame_info;
EXPECT_TRUE(result);
EXPECT_EQ(kExpectedRtpTimestamp, result->rtp_timestamp);
- result = statistics_proxy_->GetAndResetTimingFrameInfo();
+ fake_clock_.AdvanceTimeMilliseconds(kLongDelayMs);
+ result = statistics_proxy_->GetStats().timing_frame_info;
EXPECT_FALSE(result);
}
« 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