 Chromium Code Reviews
 Chromium Code Reviews Issue 2863123002:
  Wire up BWE stats through WebrtcSession so that they are filled in both for audio and video calls.  (Closed)
    
  
    Issue 2863123002:
  Wire up BWE stats through WebrtcSession so that they are filled in both for audio and video calls.  (Closed) 
  | Index: webrtc/pc/rtcstatscollector_unittest.cc | 
| diff --git a/webrtc/pc/rtcstatscollector_unittest.cc b/webrtc/pc/rtcstatscollector_unittest.cc | 
| index 1940da69daed9e4f519ea39e287f0360b3184a50..34111af60ae0443513ed8081a8f5946f9d56e568 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,8 @@ 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; | 
| + // video_media_info.bw_estimations[0].available_send_bandwidth = 0; | 
| + // video_media_info.bw_estimations[0].available_recv_bandwidth = 0; | 
| 
Taylor Brandstetter
2017/05/07 21:30:44
Remember to remove this before landing
 
stefan-webrtc
2017/05/08 07:12:57
Done.
 | 
| EXPECT_CALL(*video_media_channel, GetStats(_)) | 
| .WillOnce(DoAll(SetArgPointee<0>(video_media_info), Return(true))); | 
| collector_->ClearCachedStatsReport(); | 
| @@ -1360,14 +1357,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, |