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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_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, generalized InvokeOnWorker(). 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after
3582 stats2.media_bitrate_bps = 321; 3582 stats2.media_bitrate_bps = 321;
3583 stats2.substreams[13].total_bitrate_bps = 5; 3583 stats2.substreams[13].total_bitrate_bps = 5;
3584 stats2.substreams[13].retransmit_bitrate_bps = 6; 3584 stats2.substreams[13].retransmit_bitrate_bps = 6;
3585 stats2.substreams[21].total_bitrate_bps = 7; 3585 stats2.substreams[21].total_bitrate_bps = 7;
3586 stats2.substreams[21].retransmit_bitrate_bps = 8; 3586 stats2.substreams[21].retransmit_bitrate_bps = 8;
3587 stream2->SetStats(stats2); 3587 stream2->SetStats(stats2);
3588 3588
3589 cricket::VideoMediaInfo info; 3589 cricket::VideoMediaInfo info;
3590 ASSERT_TRUE(channel_->GetStats(&info)); 3590 ASSERT_TRUE(channel_->GetStats(&info));
3591 ASSERT_EQ(2u, info.senders.size()); 3591 ASSERT_EQ(2u, info.senders.size());
3592 BandwidthEstimationInfo bwe_info;
3593 channel_->FillBitrateInfo(&bwe_info);
3592 // Assuming stream and stream2 corresponds to senders[0] and [1] respectively 3594 // Assuming stream and stream2 corresponds to senders[0] and [1] respectively
3593 // is OK as std::maps are sorted and AddSendStream() gives increasing SSRCs. 3595 // is OK as std::maps are sorted and AddSendStream() gives increasing SSRCs.
3594 EXPECT_EQ(stats.media_bitrate_bps, info.senders[0].nominal_bitrate); 3596 EXPECT_EQ(stats.media_bitrate_bps, info.senders[0].nominal_bitrate);
3595 EXPECT_EQ(stats2.media_bitrate_bps, info.senders[1].nominal_bitrate); 3597 EXPECT_EQ(stats2.media_bitrate_bps, info.senders[1].nominal_bitrate);
3596 EXPECT_EQ(stats.target_media_bitrate_bps + stats2.target_media_bitrate_bps, 3598 EXPECT_EQ(stats.target_media_bitrate_bps + stats2.target_media_bitrate_bps,
3597 info.bw_estimations[0].target_enc_bitrate); 3599 bwe_info.target_enc_bitrate);
3598 EXPECT_EQ(stats.media_bitrate_bps + stats2.media_bitrate_bps, 3600 EXPECT_EQ(stats.media_bitrate_bps + stats2.media_bitrate_bps,
3599 info.bw_estimations[0].actual_enc_bitrate); 3601 bwe_info.actual_enc_bitrate);
3600 EXPECT_EQ(1 + 3 + 5 + 7, info.bw_estimations[0].transmit_bitrate) 3602 EXPECT_EQ(1 + 3 + 5 + 7, bwe_info.transmit_bitrate)
3601 << "Bandwidth stats should take all streams into account."; 3603 << "Bandwidth stats should take all streams into account.";
3602 EXPECT_EQ(2 + 4 + 6 + 8, info.bw_estimations[0].retransmit_bitrate) 3604 EXPECT_EQ(2 + 4 + 6 + 8, bwe_info.retransmit_bitrate)
3603 << "Bandwidth stats should take all streams into account."; 3605 << "Bandwidth stats should take all streams into account.";
3604 } 3606 }
3605 3607
3606 TEST_F(WebRtcVideoChannel2Test, DefaultReceiveStreamReconfiguresToUseRtx) { 3608 TEST_F(WebRtcVideoChannel2Test, DefaultReceiveStreamReconfiguresToUseRtx) {
3607 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 3609 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
3608 3610
3609 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1); 3611 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
3610 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); 3612 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
3611 3613
3612 ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); 3614 ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
4457 4459
4458 TEST_F(WebRtcVideoChannel2SimulcastTest, 4460 TEST_F(WebRtcVideoChannel2SimulcastTest,
4459 NoSimulcastScreenshareWithoutConference) { 4461 NoSimulcastScreenshareWithoutConference) {
4460 webrtc::test::ScopedFieldTrials override_field_trials_( 4462 webrtc::test::ScopedFieldTrials override_field_trials_(
4461 "WebRTC-SimulcastScreenshare/Enabled/"); 4463 "WebRTC-SimulcastScreenshare/Enabled/");
4462 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, 4464 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true,
4463 false); 4465 false);
4464 } 4466 }
4465 4467
4466 } // namespace cricket 4468 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698