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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 2915263002: Revert "Revert of Wire up BWE stats through WebrtcSession so that they are filled in both for audio… (Closed)
Patch Set: . Created 3 years, 6 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 3691 matching lines...) Expand 10 before | Expand all | Expand 10 after
3702 stats2.media_bitrate_bps = 321; 3702 stats2.media_bitrate_bps = 321;
3703 stats2.substreams[13].total_bitrate_bps = 5; 3703 stats2.substreams[13].total_bitrate_bps = 5;
3704 stats2.substreams[13].retransmit_bitrate_bps = 6; 3704 stats2.substreams[13].retransmit_bitrate_bps = 6;
3705 stats2.substreams[21].total_bitrate_bps = 7; 3705 stats2.substreams[21].total_bitrate_bps = 7;
3706 stats2.substreams[21].retransmit_bitrate_bps = 8; 3706 stats2.substreams[21].retransmit_bitrate_bps = 8;
3707 stream2->SetStats(stats2); 3707 stream2->SetStats(stats2);
3708 3708
3709 cricket::VideoMediaInfo info; 3709 cricket::VideoMediaInfo info;
3710 ASSERT_TRUE(channel_->GetStats(&info)); 3710 ASSERT_TRUE(channel_->GetStats(&info));
3711 ASSERT_EQ(2u, info.senders.size()); 3711 ASSERT_EQ(2u, info.senders.size());
3712 BandwidthEstimationInfo bwe_info;
3713 channel_->FillBitrateInfo(&bwe_info);
3712 // Assuming stream and stream2 corresponds to senders[0] and [1] respectively 3714 // Assuming stream and stream2 corresponds to senders[0] and [1] respectively
3713 // is OK as std::maps are sorted and AddSendStream() gives increasing SSRCs. 3715 // is OK as std::maps are sorted and AddSendStream() gives increasing SSRCs.
3714 EXPECT_EQ(stats.media_bitrate_bps, info.senders[0].nominal_bitrate); 3716 EXPECT_EQ(stats.media_bitrate_bps, info.senders[0].nominal_bitrate);
3715 EXPECT_EQ(stats2.media_bitrate_bps, info.senders[1].nominal_bitrate); 3717 EXPECT_EQ(stats2.media_bitrate_bps, info.senders[1].nominal_bitrate);
3716 EXPECT_EQ(stats.target_media_bitrate_bps + stats2.target_media_bitrate_bps, 3718 EXPECT_EQ(stats.target_media_bitrate_bps + stats2.target_media_bitrate_bps,
3717 info.bw_estimations[0].target_enc_bitrate); 3719 bwe_info.target_enc_bitrate);
3718 EXPECT_EQ(stats.media_bitrate_bps + stats2.media_bitrate_bps, 3720 EXPECT_EQ(stats.media_bitrate_bps + stats2.media_bitrate_bps,
3719 info.bw_estimations[0].actual_enc_bitrate); 3721 bwe_info.actual_enc_bitrate);
3720 EXPECT_EQ(1 + 3 + 5 + 7, info.bw_estimations[0].transmit_bitrate) 3722 EXPECT_EQ(1 + 3 + 5 + 7, bwe_info.transmit_bitrate)
3721 << "Bandwidth stats should take all streams into account."; 3723 << "Bandwidth stats should take all streams into account.";
3722 EXPECT_EQ(2 + 4 + 6 + 8, info.bw_estimations[0].retransmit_bitrate) 3724 EXPECT_EQ(2 + 4 + 6 + 8, bwe_info.retransmit_bitrate)
3723 << "Bandwidth stats should take all streams into account."; 3725 << "Bandwidth stats should take all streams into account.";
3724 } 3726 }
3725 3727
3726 TEST_F(WebRtcVideoChannel2Test, DefaultReceiveStreamReconfiguresToUseRtx) { 3728 TEST_F(WebRtcVideoChannel2Test, DefaultReceiveStreamReconfiguresToUseRtx) {
3727 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 3729 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
3728 3730
3729 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1); 3731 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1);
3730 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); 3732 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
3731 3733
3732 ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); 3734 ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
4624 4626
4625 TEST_F(WebRtcVideoChannel2SimulcastTest, 4627 TEST_F(WebRtcVideoChannel2SimulcastTest,
4626 NoSimulcastScreenshareWithoutConference) { 4628 NoSimulcastScreenshareWithoutConference) {
4627 webrtc::test::ScopedFieldTrials override_field_trials_( 4629 webrtc::test::ScopedFieldTrials override_field_trials_(
4628 "WebRTC-SimulcastScreenshare/Enabled/"); 4630 "WebRTC-SimulcastScreenshare/Enabled/");
4629 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, 4631 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true,
4630 false); 4632 false);
4631 } 4633 }
4632 4634
4633 } // namespace cricket 4635 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698