| Index: webrtc/video/send_statistics_proxy_unittest.cc
|
| diff --git a/webrtc/video/send_statistics_proxy_unittest.cc b/webrtc/video/send_statistics_proxy_unittest.cc
|
| index 46a984b4148eb95076105a46c4926b1ce9a666cf..e6d4ed67df06fd1fde2d65ffc1ec1168dc38f190 100644
|
| --- a/webrtc/video/send_statistics_proxy_unittest.cc
|
| +++ b/webrtc/video/send_statistics_proxy_unittest.cc
|
| @@ -26,7 +26,6 @@ const uint32_t kSecondSsrc = 42;
|
| const uint32_t kFirstRtxSsrc = 18;
|
| const uint32_t kSecondRtxSsrc = 43;
|
|
|
| -const int kMinRequiredSamples = 200;
|
| const int kQpIdx0 = 21;
|
| const int kQpIdx1 = 39;
|
| } // namespace
|
| @@ -305,8 +304,8 @@ TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) {
|
| const int kWidth = 640;
|
| const int kHeight = 480;
|
|
|
| - for (int i = 0; i < kMinRequiredSamples; ++i)
|
| - statistics_proxy_->OnIncomingFrame(kWidth, kHeight);
|
| + for (int i = 0; i < SendStatisticsProxy::kMinRequiredUMASamples; ++i)
|
| + statistics_proxy_->OnIncomingFrame(kWidth, kHeight, false);
|
|
|
| // No switch, stats should not be updated.
|
| VideoEncoderConfig config;
|
| @@ -320,6 +319,23 @@ TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) {
|
| EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.InputWidthInPixels"));
|
| }
|
|
|
| +TEST_F(SendStatisticsProxyTest, CpuLimitedResolutionUpdated) {
|
| + const int kWidth = 640;
|
| + const int kHeight = 480;
|
| +
|
| + for (int i = 0; i < SendStatisticsProxy::kMinRequiredUMASamples; ++i)
|
| + statistics_proxy_->OnIncomingFrame(kWidth, kHeight, false);
|
| +
|
| + for (int i = 0; i < SendStatisticsProxy::kMinRequiredUMASamples; ++i)
|
| + statistics_proxy_->OnIncomingFrame(kWidth, kHeight, true);
|
| +
|
| + statistics_proxy_.reset();
|
| + EXPECT_EQ(1,
|
| + metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent"));
|
| + EXPECT_EQ(
|
| + 1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50));
|
| +}
|
| +
|
| TEST_F(SendStatisticsProxyTest, LifetimeHistogramIsUpdated) {
|
| const int64_t kTimeSec = 3;
|
| fake_clock_.AdvanceTimeMilliseconds(kTimeSec * 1000);
|
| @@ -340,7 +356,7 @@ TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_Vp8) {
|
| CodecSpecificInfo codec_info;
|
| codec_info.codecType = kVideoCodecVP8;
|
|
|
| - for (int i = 0; i < kMinRequiredSamples; ++i) {
|
| + for (int i = 0; i < SendStatisticsProxy::kMinRequiredUMASamples; ++i) {
|
| codec_info.codecSpecific.VP8.simulcastIdx = 0;
|
| encoded_image.qp_ = kQpIdx0;
|
| statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
|
| @@ -365,7 +381,7 @@ TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_Vp8OneSsrc) {
|
| CodecSpecificInfo codec_info;
|
| codec_info.codecType = kVideoCodecVP8;
|
|
|
| - for (int i = 0; i < kMinRequiredSamples; ++i) {
|
| + for (int i = 0; i < SendStatisticsProxy::kMinRequiredUMASamples; ++i) {
|
| codec_info.codecSpecific.VP8.simulcastIdx = 0;
|
| encoded_image.qp_ = kQpIdx0;
|
| statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
|
| @@ -381,7 +397,7 @@ TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_Vp9) {
|
| codec_info.codecType = kVideoCodecVP9;
|
| codec_info.codecSpecific.VP9.num_spatial_layers = 2;
|
|
|
| - for (int i = 0; i < kMinRequiredSamples; ++i) {
|
| + for (int i = 0; i < SendStatisticsProxy::kMinRequiredUMASamples; ++i) {
|
| encoded_image.qp_ = kQpIdx0;
|
| codec_info.codecSpecific.VP9.spatial_idx = 0;
|
| statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
|
| @@ -407,7 +423,7 @@ TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_Vp9OneSpatialLayer) {
|
| codec_info.codecType = kVideoCodecVP9;
|
| codec_info.codecSpecific.VP9.num_spatial_layers = 1;
|
|
|
| - for (int i = 0; i < kMinRequiredSamples; ++i) {
|
| + for (int i = 0; i < SendStatisticsProxy::kMinRequiredUMASamples; ++i) {
|
| encoded_image.qp_ = kQpIdx0;
|
| codec_info.codecSpecific.VP9.spatial_idx = 0;
|
| statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
|
|
|