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

Unified Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 2649133005: Add QP sum stats for received streams. (Closed)
Patch Set: Add DecodedWithQp to interface. Created 3 years, 11 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
Index: webrtc/video/receive_statistics_proxy_unittest.cc
diff --git a/webrtc/video/receive_statistics_proxy_unittest.cc b/webrtc/video/receive_statistics_proxy_unittest.cc
index d431bc4afbcacb72e68f765e6564546ede02980a..76ccced820c13de8848bc5372368de317d70a7fc 100644
--- a/webrtc/video/receive_statistics_proxy_unittest.cc
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -54,11 +54,26 @@ class ReceiveStatisticsProxyTest : public ::testing::Test {
TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesFramesDecoded) {
EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_decoded);
for (uint32_t i = 1; i <= 3; ++i) {
- statistics_proxy_->OnDecodedFrame();
+ statistics_proxy_->OnDecodedFrame(-1);
EXPECT_EQ(i, statistics_proxy_->GetStats().frames_decoded);
}
}
+TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesQpSum) {
+ EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum);
+ statistics_proxy_->OnDecodedFrame(3);
+ EXPECT_EQ(rtc::Optional<uint64_t>(3u), statistics_proxy_->GetStats().qp_sum);
+ statistics_proxy_->OnDecodedFrame(127);
+ EXPECT_EQ(rtc::Optional<uint64_t>(130u),
+ statistics_proxy_->GetStats().qp_sum);
+}
+
+TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpQpSumWontExist) {
+ EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum);
+ statistics_proxy_->OnDecodedFrame(-1);
+ EXPECT_EQ(rtc::Optional<uint64_t>(), statistics_proxy_->GetStats().qp_sum);
+}
+
TEST_F(ReceiveStatisticsProxyTest, OnRenderedFrameIncreasesFramesRendered) {
EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_rendered);
webrtc::VideoFrame frame(

Powered by Google App Engine
This is Rietveld 408576698