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

Unified 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: Fix tests 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
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..1eb5469c26955f40bb2d7b1eb0841cfe49e09c37 100644
--- a/webrtc/video/receive_statistics_proxy_unittest.cc
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -777,24 +777,10 @@ TEST_P(ReceiveStatisticsProxyTest, InterFrameDelaysAreReported) {
(kInterFrameDelayMs * (kMinRequiredSamples - 1) +
kInterFrameDelayMs * 2) /
kMinRequiredSamples;
- switch (content_type) {
- case VideoContentType::UNSPECIFIED:
- EXPECT_EQ(kExpectedInterFrame,
- metrics::MinSample("WebRTC.Video.InterframeDelayInMs"));
- EXPECT_EQ(kInterFrameDelayMs * 2,
- metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs"));
- break;
- case VideoContentType::SCREENSHARE:
- EXPECT_EQ(
- kExpectedInterFrame,
- metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayInMs"));
- EXPECT_EQ(kInterFrameDelayMs * 2,
- metrics::MinSample(
- "WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
- break;
- default:
- RTC_NOTREACHED();
- }
+ EXPECT_EQ(kExpectedInterFrame,
+ metrics::MinSample("WebRTC.Video.InterframeDelayInMs"));
+ EXPECT_EQ(kInterFrameDelayMs * 2,
+ metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs"));
}
TEST_P(ReceiveStatisticsProxyTest, MaxInterFrameDelayOnlyWithValidAverage) {
@@ -836,24 +822,61 @@ TEST_P(ReceiveStatisticsProxyTest, MaxInterFrameDelayOnlyWithPause) {
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.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"));
+}
+
+TEST_P(ReceiveStatisticsProxyTest, StatsAreSlicedOnSimulcastAndExperiment) {
+ VideoContentType content_type = GetParam();
+ const uint8_t experiment_id = 1;
+ content_type.SetExperimentId(experiment_id);
+ const int kInterFrameDelayMs = 33;
+
+ content_type.SetSimulcastId(1);
+ for (int i = 0; i <= kMinRequiredSamples; ++i) {
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
+ fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs);
+ }
+
+ content_type.SetSimulcastId(2);
+ for (int i = 0; i <= kMinRequiredSamples; ++i) {
+ statistics_proxy_->OnDecodedFrame(rtc::Optional<uint8_t>(), content_type);
+ fake_clock_.AdvanceTimeMilliseconds(kInterFrameDelayMs);
+ }
+ statistics_proxy_.reset();
+ EXPECT_EQ(
+ 0, metrics::NumSamples("WebRTC.Video.Screenshare.InterframeDelayInMs"));
+ EXPECT_EQ(0, metrics::NumSamples(
+ "WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
+ if (content_type.IsScreenshare()) {
EXPECT_EQ(1, metrics::NumSamples(
- "WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
- EXPECT_EQ(
- kInterFrameDelayMs,
- metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayInMs"));
+ "WebRTC.Video.Screenshare.InterframeDelayInMs.S0"));
+ EXPECT_EQ(1, metrics::NumSamples(
+ "WebRTC.Video.Screenshare.InterframeDelayMaxInMs.S0"));
+ EXPECT_EQ(1, metrics::NumSamples(
+ "WebRTC.Video.Screenshare.InterframeDelayInMs.S1"));
+ EXPECT_EQ(1, metrics::NumSamples(
+ "WebRTC.Video.Screenshare.InterframeDelayMaxInMs.S1"));
+ EXPECT_EQ(1,
+ metrics::NumSamples("WebRTC.Video.InterframeDelayInMs"
+ ".ExperimentGroup0"));
EXPECT_EQ(
- kInterFrameDelayMs,
- metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
+ 1, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs"
+ ".ExperimentGroup0"));
} 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"));
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs.S0"));
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs.S0"));
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs.S1"));
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs.S1"));
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayInMs"
+ ".ExperimentGroup0"));
+ EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InterframeDelayMaxInMs"
+ ".ExperimentGroup0"));
}
}
« 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