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

Unified Diff: webrtc/api/rtcstatscollector_unittest.cc

Issue 2602033002: RTCMediaStreamTrackStats.frameWidth/Height,framesPerSecond,framesDecoded (Closed)
Patch Set: Created 4 years 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/api/rtcstatscollector_unittest.cc
diff --git a/webrtc/api/rtcstatscollector_unittest.cc b/webrtc/api/rtcstatscollector_unittest.cc
index bbcb2bed162247e1174b99e65b0ca685892877b6..b6290187c911dc279bd94101a67e60e4cbf7f782 100644
--- a/webrtc/api/rtcstatscollector_unittest.cc
+++ b/webrtc/api/rtcstatscollector_unittest.cc
@@ -1417,29 +1417,19 @@ TEST_F(RTCStatsCollectorTest,
remote_streams->AddStream(remote_stream);
// Local video track
- VideoTrackSourceInterface::Stats local_video_track_source_stats;
- local_video_track_source_stats.input_width = 1234;
- local_video_track_source_stats.input_height = 4321;
- rtc::scoped_refptr<FakeVideoTrackSourceForStats> local_video_track_source =
- new FakeVideoTrackSourceForStats(local_video_track_source_stats);
rtc::scoped_refptr<FakeVideoTrackForStats> local_video_track =
FakeVideoTrackForStats::Create(
"LocalVideoTrackID",
MediaStreamTrackInterface::TrackState::kLive,
- local_video_track_source);
+ nullptr);
local_stream->AddTrack(local_video_track);
// Remote video track
- VideoTrackSourceInterface::Stats remote_video_track_source_stats;
- remote_video_track_source_stats.input_width = 1234;
- remote_video_track_source_stats.input_height = 4321;
- rtc::scoped_refptr<FakeVideoTrackSourceForStats> remote_video_track_source =
- new FakeVideoTrackSourceForStats(remote_video_track_source_stats);
rtc::scoped_refptr<FakeVideoTrackForStats> remote_video_track =
FakeVideoTrackForStats::Create(
"RemoteVideoTrackID",
MediaStreamTrackInterface::TrackState::kEnded,
- remote_video_track_source);
+ nullptr);
remote_stream->AddTrack(remote_video_track);
// RTP sender/receivers for local/remote track to wire up SSRCs.
@@ -1469,6 +1459,9 @@ TEST_F(RTCStatsCollectorTest,
video_media_info.senders.push_back(cricket::VideoSenderInfo());
video_media_info.senders[0].local_stats.push_back(cricket::SsrcSenderInfo());
video_media_info.senders[0].local_stats[0].ssrc = 42;
+ video_media_info.senders[0].send_frame_width = 1234;
+ video_media_info.senders[0].send_frame_height = 4321;
+ video_media_info.senders[0].framerate_sent = 55;
video_media_info.receivers.push_back(cricket::VideoReceiverInfo());
video_media_info.receivers[0].local_stats.push_back(
cricket::SsrcReceiverInfo());
@@ -1476,6 +1469,10 @@ TEST_F(RTCStatsCollectorTest,
video_media_info.receivers[0].local_stats.push_back(
cricket::SsrcReceiverInfo());
video_media_info.receivers[0].local_stats[1].ssrc = 44;
+ video_media_info.receivers[0].frame_width = 4321;
+ video_media_info.receivers[0].frame_height = 1234;
+ video_media_info.receivers[0].framerate_output = 66;
+ video_media_info.receivers[0].frames_decoded = 1337;
EXPECT_CALL(*video_media_channel, GetStats(_))
.WillOnce(DoAll(SetArgPointee<0>(video_media_info), Return(true)));
SessionStats session_stats;
@@ -1522,6 +1519,7 @@ TEST_F(RTCStatsCollectorTest,
expected_local_video_track.ssrc_ids = std::vector<std::string>({ "42" });
expected_local_video_track.frame_width = 1234;
expected_local_video_track.frame_height = 4321;
+ expected_local_video_track.frames_per_second = 55.0;
ASSERT_TRUE(report->Get(expected_local_video_track.id()));
EXPECT_EQ(expected_local_video_track,
report->Get(expected_local_video_track.id())->cast_to<
@@ -1535,8 +1533,10 @@ TEST_F(RTCStatsCollectorTest,
expected_remote_video_track.detached = false;
expected_remote_video_track.ssrc_ids =
std::vector<std::string>({ "43", "44" });
- expected_remote_video_track.frame_width = 1234;
- expected_remote_video_track.frame_height = 4321;
+ expected_remote_video_track.frame_width = 4321;
+ expected_remote_video_track.frame_height = 1234;
+ expected_remote_video_track.frames_per_second = 66.0;
+ expected_remote_video_track.frames_decoded = 1337;
ASSERT_TRUE(report->Get(expected_remote_video_track.id()));
EXPECT_EQ(expected_remote_video_track,
report->Get(expected_remote_video_track.id())->cast_to<

Powered by Google App Engine
This is Rietveld 408576698