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

Side by Side Diff: webrtc/pc/statscollector_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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 StatsReports reports; // returned values. 2012 StatsReports reports; // returned values.
2013 cricket::VideoReceiverInfo video_receiver_info; 2013 cricket::VideoReceiverInfo video_receiver_info;
2014 cricket::VideoMediaInfo stats_read; 2014 cricket::VideoMediaInfo stats_read;
2015 2015
2016 AddIncomingVideoTrackStats(); 2016 AddIncomingVideoTrackStats();
2017 stats.AddStream(stream_); 2017 stats.AddStream(stream_);
2018 2018
2019 // Construct a stats value to read. 2019 // Construct a stats value to read.
2020 video_receiver_info.add_ssrc(1234); 2020 video_receiver_info.add_ssrc(1234);
2021 video_receiver_info.frames_decoded = 10; 2021 video_receiver_info.frames_decoded = 10;
2022 video_receiver_info.qp_sum = rtc::Optional<uint64_t>(11);
2022 stats_read.receivers.push_back(video_receiver_info); 2023 stats_read.receivers.push_back(video_receiver_info);
2023 2024
2024 EXPECT_CALL(session_, video_channel()).WillRepeatedly(Return(&video_channel)); 2025 EXPECT_CALL(session_, video_channel()).WillRepeatedly(Return(&video_channel));
2025 EXPECT_CALL(session_, voice_channel()).WillRepeatedly(ReturnNull()); 2026 EXPECT_CALL(session_, voice_channel()).WillRepeatedly(ReturnNull());
2026 EXPECT_CALL(*media_channel, GetStats(_)) 2027 EXPECT_CALL(*media_channel, GetStats(_))
2027 .WillOnce(DoAll(SetArgPointee<0>(stats_read), Return(true))); 2028 .WillOnce(DoAll(SetArgPointee<0>(stats_read), Return(true)));
2028 stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard); 2029 stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard);
2029 stats.GetStats(NULL, &reports); 2030 stats.GetStats(NULL, &reports);
2030 EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded), 2031 EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded),
2031 ExtractSsrcStatsValue(reports, 2032 ExtractSsrcStatsValue(reports,
2032 StatsReport::kStatsValueNameFramesDecoded)); 2033 StatsReport::kStatsValueNameFramesDecoded));
2034 EXPECT_EQ(rtc::ToString(*video_receiver_info.qp_sum),
2035 ExtractSsrcStatsValue(reports, StatsReport::kStatsValueNameQpSum));
2033 } 2036 }
2034 2037
2035 } // namespace webrtc 2038 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698