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

Unified Diff: webrtc/api/statscollector_unittest.cc

Issue 2423823003: Implement framesDecoded stat in video receive ssrc stats. (Closed)
Patch Set: Add #include <memory> to receive_statistics_proxy_unittest.cc. Created 4 years, 2 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/api/statscollector.cc ('k') | webrtc/api/statstypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/statscollector_unittest.cc
diff --git a/webrtc/api/statscollector_unittest.cc b/webrtc/api/statscollector_unittest.cc
index f92db736668350dcf9ef59c77eb09199ffbc1a6e..8c82811d7699a217fd5cddaf8221e115d5054c90 100644
--- a/webrtc/api/statscollector_unittest.cc
+++ b/webrtc/api/statscollector_unittest.cc
@@ -1939,4 +1939,46 @@ TEST_F(StatsCollectorTest, VerifyVideoSendSsrcStats) {
StatsReport::kStatsValueNameFramesEncoded));
}
+// This test verifies that stats are correctly set in video receive ssrc stats.
+TEST_F(StatsCollectorTest, VerifyVideoReceiveSsrcStats) {
+ StatsCollectorForTest stats(&pc_);
+
+ EXPECT_CALL(session_, GetLocalCertificate(_, _))
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(session_, GetRemoteSSLCertificate_ReturnsRawPointer(_))
+ .WillRepeatedly(Return(nullptr));
+
+ const char kVideoChannelName[] = "video";
+
+ InitSessionStats(kVideoChannelName);
+ EXPECT_CALL(session_, GetTransportStats(_))
+ .WillRepeatedly(DoAll(SetArgPointee<0>(session_stats_), Return(true)));
+
+ MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
+ cricket::VideoChannel video_channel(worker_thread_, network_thread_,
+ media_channel, nullptr, kVideoChannelName,
+ false);
+ StatsReports reports; // returned values.
+ cricket::VideoReceiverInfo video_receiver_info;
+ cricket::VideoMediaInfo stats_read;
+
+ AddIncomingVideoTrackStats();
+ stats.AddStream(stream_);
+
+ // Construct a stats value to read.
+ video_receiver_info.add_ssrc(1234);
+ video_receiver_info.frames_decoded = 10;
+ stats_read.receivers.push_back(video_receiver_info);
+
+ EXPECT_CALL(session_, video_channel()).WillRepeatedly(Return(&video_channel));
+ EXPECT_CALL(session_, voice_channel()).WillRepeatedly(ReturnNull());
+ EXPECT_CALL(*media_channel, GetStats(_))
+ .WillOnce(DoAll(SetArgPointee<0>(stats_read), Return(true)));
+ stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard);
+ stats.GetStats(NULL, &reports);
+ EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded),
+ ExtractSsrcStatsValue(reports,
+ StatsReport::kStatsValueNameFramesDecoded));
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/api/statscollector.cc ('k') | webrtc/api/statstypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698