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

Unified Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 3002103002: Ignore inter-frame delay stats samples when stream is inactive (Closed)
Patch Set: remove missed copy/paste comment that makes no sense Created 3 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/video/receive_statistics_proxy.cc ('k') | webrtc/video/video_receive_stream.cc » ('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 d37d2035485334127083b21c5d572b70b1c588a2..8b3bc0aa7eabfc9ac5c47e5dcf8b40e0eaa0039a 100644
--- a/webrtc/video/receive_statistics_proxy_unittest.cc
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -779,4 +779,45 @@ TEST_P(ReceiveStatisticsProxyTest, MaxInterFrameDelayOnlyWithValidAverage) {
"WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
}
+TEST_P(ReceiveStatisticsProxyTest, MaxInterFrameDelayOnlyWithPause) {
+ const VideoContentType content_type = GetParam();
+ const int kInterFrameDelayMs = 33;
+ for (int i = 0; i <= kMinRequiredSamples; ++i) {
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
+ fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs);
+ }
+
+ // At this state, we should have a valid inter-frame delay.
+ // Indicate stream paused and make a large jump in time.
+ statistics_proxy_->OnStreamInactive();
+ fake_clock_.AdvanceTimeMilliseconds(5000);
+
+ // Insert two more frames. The interval during the pause should be disregarded
+ // in the stats.
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
+ fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs);
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
+
+ statistics_proxy_.reset();
+ if (content_type == VideoContentType::SCREENSHARE) {
+ EXPECT_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.Screenshare.InterframeDelayInMs"));
+ EXPECT_EQ(1, metrics::NumSamples(
+ "WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
+ EXPECT_EQ(
+ kInterFrameDelayMs,
+ metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayInMs"));
+ EXPECT_EQ(
+ kInterFrameDelayMs,
+ metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
+ } else {
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs"));
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs"));
+ EXPECT_EQ(kInterFrameDelayMs,
+ metrics::MinSample("WebRTC.Video.InterframeDelayInMs"));
+ EXPECT_EQ(kInterFrameDelayMs,
+ metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs"));
+ }
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | webrtc/video/video_receive_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698