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

Unified Diff: webrtc/video/send_statistics_proxy_unittest.cc

Issue 2775173004: Add number of quality adapt changes to VideoSendStream stats. (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_unittest.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 08a2fd26f08e881b4e261cca6b78aaaddec3fcc1..7b44dde4697a09ad4cf421efe78ae2b8694ace3a 100644
--- a/webrtc/video/send_statistics_proxy_unittest.cc
+++ b/webrtc/video/send_statistics_proxy_unittest.cc
@@ -385,6 +385,40 @@ TEST_F(SendStatisticsProxyTest, SetQualityScalingUpdatesStats) {
EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution);
}
+TEST_F(SendStatisticsProxyTest, GetStatsReportsCpuResolutionChanges) {
+ EXPECT_FALSE(statistics_proxy_->GetStats().cpu_limited_resolution);
+ EXPECT_EQ(0, statistics_proxy_->GetStats().number_of_cpu_adapt_changes);
+
+ statistics_proxy_->OnCpuRestrictedResolutionChanged(true);
+ EXPECT_TRUE(statistics_proxy_->GetStats().cpu_limited_resolution);
+ EXPECT_EQ(1, statistics_proxy_->GetStats().number_of_cpu_adapt_changes);
+
+ statistics_proxy_->OnCpuRestrictedResolutionChanged(false);
+ EXPECT_FALSE(statistics_proxy_->GetStats().cpu_limited_resolution);
+ EXPECT_EQ(2, statistics_proxy_->GetStats().number_of_cpu_adapt_changes);
+}
+
+TEST_F(SendStatisticsProxyTest, GetStatsReportsQualityResolutionChanges) {
+ EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution);
+ EXPECT_EQ(0, statistics_proxy_->GetStats().number_of_quality_adapt_changes);
+
+ statistics_proxy_->OnQualityRestrictedResolutionChanged(1);
+ EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution);
+ EXPECT_EQ(1, statistics_proxy_->GetStats().number_of_quality_adapt_changes);
+
+ statistics_proxy_->OnQualityRestrictedResolutionChanged(2);
+ EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution);
+ EXPECT_EQ(2, statistics_proxy_->GetStats().number_of_quality_adapt_changes);
+
+ statistics_proxy_->OnQualityRestrictedResolutionChanged(1);
+ EXPECT_TRUE(statistics_proxy_->GetStats().bw_limited_resolution);
+ EXPECT_EQ(3, statistics_proxy_->GetStats().number_of_quality_adapt_changes);
+
+ statistics_proxy_->OnQualityRestrictedResolutionChanged(0);
+ EXPECT_FALSE(statistics_proxy_->GetStats().bw_limited_resolution);
+ EXPECT_EQ(4, statistics_proxy_->GetStats().number_of_quality_adapt_changes);
+}
+
TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) {
for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i)
statistics_proxy_->OnIncomingFrame(kWidth, kHeight);
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video/vie_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698