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 cb3bde442647856fab6cea7b41e575148105b45e..d8eaf3342ee526e49f57b2a25bb50b223f32c5d5 100644 |
--- a/webrtc/video/send_statistics_proxy_unittest.cc |
+++ b/webrtc/video/send_statistics_proxy_unittest.cc |
@@ -311,6 +311,28 @@ TEST_F(SendStatisticsProxyTest, OnSendEncodedImageIncreasesFramesEncoded) { |
} |
} |
+TEST_F(SendStatisticsProxyTest, OnSendEncodedImageIncreasesQpSum) { |
+ EncodedImage encoded_image; |
+ CodecSpecificInfo codec_info; |
+ EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); |
+ encoded_image.qp_ = 3; |
+ statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); |
+ EXPECT_EQ(rtc::Optional<uint64_t>(3u), statistics_proxy_->GetStats().qp_sum); |
+ encoded_image.qp_ = 127; |
+ statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); |
+ EXPECT_EQ(rtc::Optional<uint64_t>(130u), |
+ statistics_proxy_->GetStats().qp_sum); |
+} |
+ |
+TEST_F(SendStatisticsProxyTest, OnSendEncodedImageWithoutQpQpSumWontExist) { |
+ EncodedImage encoded_image; |
+ CodecSpecificInfo codec_info; |
+ encoded_image.qp_ = -1; |
+ EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); |
+ statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); |
+ EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum); |
+} |
+ |
TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) { |
const int kWidth = 640; |
const int kHeight = 480; |