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

Side by Side Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 2986893002: Piggybacking simulcast id and ALR experiment id into video content type extension. (Closed)
Patch Set: Add metrics sliced on AlrExperiment group 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 unified diff | Download patch
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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 } 733 }
734 // One extra with with double the interval. 734 // One extra with with double the interval.
735 fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs); 735 fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs);
736 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type); 736 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
737 737
738 statistics_proxy_.reset(); 738 statistics_proxy_.reset();
739 const int kExpectedInterFrame = 739 const int kExpectedInterFrame =
740 (kInterFrameDelayMs * (kMinRequiredSamples - 1) + 740 (kInterFrameDelayMs * (kMinRequiredSamples - 1) +
741 kInterFrameDelayMs * 2) / 741 kInterFrameDelayMs * 2) /
742 kMinRequiredSamples; 742 kMinRequiredSamples;
743 switch (content_type) { 743 if (content_type == VideoContentType::UNSPECIFIED) {
744 case VideoContentType::UNSPECIFIED: 744 EXPECT_EQ(kExpectedInterFrame,
745 EXPECT_EQ(kExpectedInterFrame, 745 metrics::MinSample("WebRTC.Video.InterframeDelayInMs"));
746 metrics::MinSample("WebRTC.Video.InterframeDelayInMs")); 746 EXPECT_EQ(kInterFrameDelayMs * 2,
747 EXPECT_EQ(kInterFrameDelayMs * 2, 747 metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs"));
748 metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs")); 748 } else if (content_type == VideoContentType::SCREENSHARE) {
749 break; 749 EXPECT_EQ(
750 case VideoContentType::SCREENSHARE: 750 kExpectedInterFrame,
751 EXPECT_EQ( 751 metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayInMs"));
752 kExpectedInterFrame, 752 EXPECT_EQ(
753 metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayInMs")); 753 kInterFrameDelayMs * 2,
754 EXPECT_EQ(kInterFrameDelayMs * 2, 754 metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
755 metrics::MinSample( 755 } else {
756 "WebRTC.Video.Screenshare.InterframeDelayMaxInMs")); 756 RTC_NOTREACHED();
757 break;
758 default:
759 RTC_NOTREACHED();
760 } 757 }
sprang_webrtc 2017/08/24 09:13:16 Please add tests for stats sliced on layer and exp
ilnik 2017/08/25 12:35:07 Done.
761 } 758 }
762 759
763 TEST_P(ReceiveStatisticsProxyTest, MaxInterFrameDelayOnlyWithValidAverage) { 760 TEST_P(ReceiveStatisticsProxyTest, MaxInterFrameDelayOnlyWithValidAverage) {
764 const VideoContentType content_type = GetParam(); 761 const VideoContentType content_type = GetParam();
765 const int kInterFrameDelayMs = 33; 762 const int kInterFrameDelayMs = 33;
766 for (int i = 0; i < kMinRequiredSamples; ++i) { 763 for (int i = 0; i < kMinRequiredSamples; ++i) {
767 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type); 764 statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
768 fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs); 765 fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs);
769 } 766 }
770 767
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs")); 811 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs"));
815 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs")); 812 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs"));
816 EXPECT_EQ(kInterFrameDelayMs, 813 EXPECT_EQ(kInterFrameDelayMs,
817 metrics::MinSample("WebRTC.Video.InterframeDelayInMs")); 814 metrics::MinSample("WebRTC.Video.InterframeDelayInMs"));
818 EXPECT_EQ(kInterFrameDelayMs, 815 EXPECT_EQ(kInterFrameDelayMs,
819 metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs")); 816 metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs"));
820 } 817 }
821 } 818 }
822 819
823 } // namespace webrtc 820 } // namespace webrtc
OLDNEW
« webrtc/video/receive_statistics_proxy.cc ('K') | « webrtc/video/receive_statistics_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698