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

Unified Diff: webrtc/video/send_statistics_proxy_unittest.cc

Issue 2783213002: Do not report quality limited resolution stats when quality scaler is disabled. (Closed)
Patch Set: rebase Created 3 years, 9 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.cc ('k') | webrtc/video/vie_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 778514a083f7a66cafac048b3fa3fd9a57e6847c..08a2fd26f08e881b4e261cca6b78aaaddec3fcc1 100644
--- a/webrtc/video/send_statistics_proxy_unittest.cc
+++ b/webrtc/video/send_statistics_proxy_unittest.cc
@@ -367,6 +367,24 @@ TEST_F(SendStatisticsProxyTest, OnSendEncodedImageWithoutQpQpSumWontExist) {
EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum);
}
+TEST_F(SendStatisticsProxyTest, SetCpuScalingUpdatesStats) {
+ EXPECT_FALSE(statistics_proxy_->GetStats().cpu_limited_resolution);
+ statistics_proxy_->SetCpuScalingStats(true);
+ EXPECT_TRUE(statistics_proxy_->GetStats().cpu_limited_resolution);
+ statistics_proxy_->SetCpuScalingStats(false);
+ EXPECT_FALSE(statistics_proxy_->GetStats().cpu_limited_resolution);
+}
+
+TEST_F(SendStatisticsProxyTest, SetQualityScalingUpdatesStats) {
+ EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution);
+ statistics_proxy_->SetQualityScalingStats(-1);
+ EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution);
+ statistics_proxy_->SetQualityScalingStats(0);
+ EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution);
+ statistics_proxy_->SetQualityScalingStats(1);
+ EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution);
+}
+
TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) {
for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i)
statistics_proxy_->OnIncomingFrame(kWidth, kHeight);
@@ -779,9 +797,9 @@ TEST_F(SendStatisticsProxyTest,
TEST_F(SendStatisticsProxyTest,
QualityLimitedHistogramsNotUpdatedWhenDisabled) {
+ const int kNumDownscales = -1;
EncodedImage encoded_image;
- statistics_proxy_->SetResolutionRestrictionStats(false /* scaling_enabled */,
- 0, 0);
+ statistics_proxy_->SetQualityScalingStats(kNumDownscales);
for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i)
statistics_proxy_->OnSendEncodedImage(encoded_image, &kDefaultCodecInfo);
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video/vie_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698