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

Unified Diff: webrtc/video/vie_encoder_unittest.cc

Issue 2807133002: Do not report cpu limited resolution stats when degradation preference is disabled and no scaling i… (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « webrtc/video/send_statistics_proxy_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « webrtc/video/send_statistics_proxy_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698