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

Side by Side Diff: webrtc/pc/channel_unittest.cc

Issue 1917193008: Adding getParameters/setParameters APIs to RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 2009 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2009 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 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 int expected_bitrate) { 1865 int expected_bitrate) {
1866 EXPECT_EQ(1UL, parameters.encodings.size()); 1866 EXPECT_EQ(1UL, parameters.encodings.size());
1867 EXPECT_EQ(expected_bitrate, parameters.encodings[0].max_bitrate_bps); 1867 EXPECT_EQ(expected_bitrate, parameters.encodings[0].max_bitrate_bps);
1868 } 1868 }
1869 1869
1870 void DefaultMaxBitrateIsUnlimited() { 1870 void DefaultMaxBitrateIsUnlimited() {
1871 CreateChannels(0, 0); 1871 CreateChannels(0, 0);
1872 EXPECT_TRUE( 1872 EXPECT_TRUE(
1873 channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); 1873 channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL));
1874 EXPECT_EQ(media_channel1_->max_bps(), -1); 1874 EXPECT_EQ(media_channel1_->max_bps(), -1);
1875 VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), -1); 1875 VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), -1);
1876 } 1876 }
1877 1877
1878 void CanChangeMaxBitrate() { 1878 void CanChangeMaxBitrate() {
1879 CreateChannels(0, 0); 1879 CreateChannels(0, 0);
1880 EXPECT_TRUE( 1880 EXPECT_TRUE(
1881 channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); 1881 channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL));
1882 1882
1883 EXPECT_TRUE( 1883 EXPECT_TRUE(channel1_->SetRtpSendParameters(
1884 channel1_->SetRtpParameters(kSsrc1, BitrateLimitedParameters(1000))); 1884 kSsrc1, BitrateLimitedParameters(1000)));
1885 VerifyMaxBitrate(channel1_->GetRtpParameters(kSsrc1), 1000); 1885 VerifyMaxBitrate(channel1_->GetRtpSendParameters(kSsrc1), 1000);
1886 VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), 1000); 1886 VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), 1000);
1887 EXPECT_EQ(-1, media_channel1_->max_bps()); 1887 EXPECT_EQ(-1, media_channel1_->max_bps());
1888 1888
1889 EXPECT_TRUE( 1889 EXPECT_TRUE(
1890 channel1_->SetRtpParameters(kSsrc1, BitrateLimitedParameters(-1))); 1890 channel1_->SetRtpSendParameters(kSsrc1, BitrateLimitedParameters(-1)));
1891 VerifyMaxBitrate(channel1_->GetRtpParameters(kSsrc1), -1); 1891 VerifyMaxBitrate(channel1_->GetRtpSendParameters(kSsrc1), -1);
1892 VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), -1); 1892 VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), -1);
1893 EXPECT_EQ(-1, media_channel1_->max_bps()); 1893 EXPECT_EQ(-1, media_channel1_->max_bps());
1894 } 1894 }
1895 1895
1896 protected: 1896 protected:
1897 // TODO(pbos): Remove playout from all media channels and let renderers mute 1897 // TODO(pbos): Remove playout from all media channels and let renderers mute
1898 // themselves. 1898 // themselves.
1899 const bool verify_playout_; 1899 const bool verify_playout_;
1900 cricket::FakeTransportController transport_controller1_; 1900 cricket::FakeTransportController transport_controller1_;
1901 cricket::FakeTransportController transport_controller2_; 1901 cricket::FakeTransportController transport_controller2_;
1902 cricket::FakeMediaEngine media_engine_; 1902 cricket::FakeMediaEngine media_engine_;
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 }; 2810 };
2811 rtc::CopyOnWriteBuffer payload(data, 3); 2811 rtc::CopyOnWriteBuffer payload(data, 3);
2812 cricket::SendDataResult result; 2812 cricket::SendDataResult result;
2813 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2813 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2814 EXPECT_EQ(params.ssrc, 2814 EXPECT_EQ(params.ssrc,
2815 media_channel1_->last_sent_data_params().ssrc); 2815 media_channel1_->last_sent_data_params().ssrc);
2816 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2816 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2817 } 2817 }
2818 2818
2819 // TODO(pthatcher): TestSetReceiver? 2819 // TODO(pthatcher): TestSetReceiver?
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698