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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 // means we're one frame short of having a valid data set. 772 // means we're one frame short of having a valid data set.
773 statistics_proxy_.reset(); 773 statistics_proxy_.reset();
774 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs")); 774 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs"));
775 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs")); 775 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs"));
776 EXPECT_EQ( 776 EXPECT_EQ(
777 0, metrics::NumSamples("WebRTC.Video.Screenshare.InterframeDelayInMs")); 777 0, metrics::NumSamples("WebRTC.Video.Screenshare.InterframeDelayInMs"));
778 EXPECT_EQ(0, metrics::NumSamples( 778 EXPECT_EQ(0, metrics::NumSamples(
779 "WebRTC.Video.Screenshare.InterframeDelayMaxInMs")); 779 "WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
780 } 780 }
781 781
782 TEST_P(ReceiveStatisticsProxyTest, MaxInterFrameDelayOnlyWithPause) {
783 const VideoContentType content_type = GetParam();
784 const int kInterFrameDelayMs = 33;
785 for (int i = 0; i <= kMinRequiredSamples; ++i) {
786 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
787 fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs);
788 }
789
790 // At this state, we should have a valid inter-frame delay.
791 // Indicate stream paused and make a large jump in time.
792 statistics_proxy_->OnStreamInactive();
793 fake_clock_.AdvanceTimeMilliseconds(5000);
794
795 // Insert two more frames. The interval during the pause should be disregarded
796 // in the stats.
797 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
798 fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs);
799 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
800
801 statistics_proxy_.reset();
802 if (content_type == VideoContentType::SCREENSHARE) {
803 EXPECT_EQ(
804 1, metrics::NumSamples("WebRTC.Video.Screenshare.InterframeDelayInMs"));
805 EXPECT_EQ(1, metrics::NumSamples(
806 "WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
807 EXPECT_EQ(
808 kInterFrameDelayMs,
809 metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayInMs"));
810 EXPECT_EQ(
811 kInterFrameDelayMs,
812 metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
813 } else {
814 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs"));
815 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs"));
816 EXPECT_EQ(kInterFrameDelayMs,
817 metrics::MinSample("WebRTC.Video.InterframeDelayInMs"));
818 EXPECT_EQ(kInterFrameDelayMs,
819 metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs"));
820 }
821 }
822
782 } // namespace webrtc 823 } // namespace webrtc
OLDNEW
« 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