Index: webrtc/video/vie_encoder_unittest.cc |
diff --git a/webrtc/video/vie_encoder_unittest.cc b/webrtc/video/vie_encoder_unittest.cc |
index 79a08b354a37195d2b94c17966c09c67677b0334..765efbc99ed2d71ec721beaa2ec7463006ab862c 100644 |
--- a/webrtc/video/vie_encoder_unittest.cc |
+++ b/webrtc/video/vie_encoder_unittest.cc |
@@ -1425,9 +1425,8 @@ TEST_F(ViEEncoderTest, DoesNotScaleBelowSetLimit) { |
vie_encoder_->Stop(); |
} |
-TEST_F(ViEEncoderTest, UMACpuLimitedResolutionInPercent) { |
+TEST_F(ViEEncoderTest, CpuLimitedHistogramIsReported) { |
vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
- |
const int kWidth = 640; |
const int kHeight = 360; |
@@ -1454,6 +1453,28 @@ TEST_F(ViEEncoderTest, UMACpuLimitedResolutionInPercent) { |
1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50)); |
} |
+TEST_F(ViEEncoderTest, CpuLimitedHistogramIsNotReportedForDisabledDegradation) { |
+ vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
+ const int kWidth = 640; |
+ const int kHeight = 360; |
+ |
+ vie_encoder_->SetSource( |
+ &video_source_, |
+ VideoSendStream::DegradationPreference::kDegradationDisabled); |
+ |
+ for (int i = 1; i <= SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) { |
+ video_source_.IncomingCapturedFrame(CreateFrame(i, kWidth, kHeight)); |
+ sink_.WaitForEncodedFrame(i); |
+ } |
+ |
+ vie_encoder_->Stop(); |
+ vie_encoder_.reset(); |
+ stats_proxy_.reset(); |
+ |
+ EXPECT_EQ(0, |
+ metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent")); |
+} |
+ |
TEST_F(ViEEncoderTest, CallsBitrateObserver) { |
class MockBitrateObserver : public VideoBitrateAllocationObserver { |
public: |