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

Unified Diff: webrtc/pc/rtcstatscollector_unittest.cc

Issue 2863123002: Wire up BWE stats through WebrtcSession so that they are filled in both for audio and video calls. (Closed)
Patch Set: Comments addressed." Created 3 years, 7 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/pc/rtcstatscollector.cc ('k') | webrtc/pc/statscollector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/rtcstatscollector_unittest.cc
diff --git a/webrtc/pc/rtcstatscollector_unittest.cc b/webrtc/pc/rtcstatscollector_unittest.cc
index 1940da69daed9e4f519ea39e287f0360b3184a50..7b7863212658fbd442e70b8ac5c7116b6db374a3 100644
--- a/webrtc/pc/rtcstatscollector_unittest.cc
+++ b/webrtc/pc/rtcstatscollector_unittest.cc
@@ -1263,9 +1263,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidatePairStats) {
// Mock the session to return bandwidth estimation info. These should only
// be used for a selected candidate pair.
cricket::VideoMediaInfo video_media_info;
- video_media_info.bw_estimations.push_back(cricket::BandwidthEstimationInfo());
- video_media_info.bw_estimations[0].available_send_bandwidth = 8888;
- video_media_info.bw_estimations[0].available_recv_bandwidth = 9999;
EXPECT_CALL(*video_media_channel, GetStats(_))
.WillOnce(DoAll(SetArgPointee<0>(video_media_info), Return(true)));
EXPECT_CALL(test_->session(), video_channel())
@@ -1345,8 +1342,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidatePairStats) {
.channel_stats[0]
.connection_infos[0]
.best_connection = true;
- video_media_info.bw_estimations[0].available_send_bandwidth = 0;
- video_media_info.bw_estimations[0].available_recv_bandwidth = 0;
EXPECT_CALL(*video_media_channel, GetStats(_))
.WillOnce(DoAll(SetArgPointee<0>(video_media_info), Return(true)));
collector_->ClearCachedStatsReport();
@@ -1360,14 +1355,19 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidatePairStats) {
EXPECT_TRUE(report->Get(*expected_pair.transport_id));
// Set bandwidth and "GetStats" again.
- video_media_info.bw_estimations[0].available_send_bandwidth = 888;
- video_media_info.bw_estimations[0].available_recv_bandwidth = 999;
+ webrtc::Call::Stats call_stats;
+ const int kSendBandwidth = 888;
+ call_stats.send_bandwidth_bps = kSendBandwidth;
+ const int kRecvBandwidth = 999;
+ call_stats.recv_bandwidth_bps = kRecvBandwidth;
+ EXPECT_CALL(test_->session(), GetCallStats())
+ .WillRepeatedly(Return(call_stats));
EXPECT_CALL(*video_media_channel, GetStats(_))
.WillOnce(DoAll(SetArgPointee<0>(video_media_info), Return(true)));
collector_->ClearCachedStatsReport();
report = GetStatsReport();
- expected_pair.available_outgoing_bitrate = 888;
- expected_pair.available_incoming_bitrate = 999;
+ expected_pair.available_outgoing_bitrate = kSendBandwidth;
+ expected_pair.available_incoming_bitrate = kRecvBandwidth;
ASSERT_TRUE(report->Get(expected_pair.id()));
EXPECT_EQ(
expected_pair,
« no previous file with comments | « webrtc/pc/rtcstatscollector.cc ('k') | webrtc/pc/statscollector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698