| 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 8b3bc0aa7eabfc9ac5c47e5dcf8b40e0eaa0039a..42ad79ccfa39a264fcca6f6f5fdc82a495ae9395 100644
|
| --- a/webrtc/video/receive_statistics_proxy_unittest.cc
|
| +++ b/webrtc/video/receive_statistics_proxy_unittest.cc
|
| @@ -740,23 +740,20 @@ 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();
|
| + if (content_type == VideoContentType::UNSPECIFIED) {
|
| + EXPECT_EQ(kExpectedInterFrame,
|
| + metrics::MinSample("WebRTC.Video.InterframeDelayInMs"));
|
| + EXPECT_EQ(kInterFrameDelayMs * 2,
|
| + metrics::MinSample("WebRTC.Video.InterframeDelayMaxInMs"));
|
| + } else if (content_type == VideoContentType::SCREENSHARE) {
|
| + EXPECT_EQ(
|
| + kExpectedInterFrame,
|
| + metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayInMs"));
|
| + EXPECT_EQ(
|
| + kInterFrameDelayMs * 2,
|
| + metrics::MinSample("WebRTC.Video.Screenshare.InterframeDelayMaxInMs"));
|
| + } else {
|
| + RTC_NOTREACHED();
|
| }
|
| }
|
|
|
| @@ -820,4 +817,53 @@ TEST_P(ReceiveStatisticsProxyTest, MaxInterFrameDelayOnlyWithPause) {
|
| }
|
| }
|
|
|
| +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.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.Screenshare.InterframeDelayInMs"
|
| + ".ExperimentGroup0"));
|
| + EXPECT_EQ(
|
| + 1, metrics::NumSamples("WebRTC.Video.Screenshare.InterframeDelayMaxInMs"
|
| + ".ExperimentGroup0"));
|
| + } else {
|
| + 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"));
|
| + }
|
| +}
|
| +
|
| } // namespace webrtc
|
|
|