OLD | NEW |
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 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1867 int expected_bitrate) { | 1867 int expected_bitrate) { |
1868 EXPECT_EQ(1UL, parameters.encodings.size()); | 1868 EXPECT_EQ(1UL, parameters.encodings.size()); |
1869 EXPECT_EQ(expected_bitrate, parameters.encodings[0].max_bitrate_bps); | 1869 EXPECT_EQ(expected_bitrate, parameters.encodings[0].max_bitrate_bps); |
1870 } | 1870 } |
1871 | 1871 |
1872 void DefaultMaxBitrateIsUnlimited() { | 1872 void DefaultMaxBitrateIsUnlimited() { |
1873 CreateChannels(0, 0); | 1873 CreateChannels(0, 0); |
1874 EXPECT_TRUE( | 1874 EXPECT_TRUE( |
1875 channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); | 1875 channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); |
1876 EXPECT_EQ(media_channel1_->max_bps(), -1); | 1876 EXPECT_EQ(media_channel1_->max_bps(), -1); |
1877 VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), -1); | 1877 VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), -1); |
1878 } | 1878 } |
1879 | 1879 |
1880 void CanChangeMaxBitrate() { | 1880 void CanChangeMaxBitrate() { |
1881 CreateChannels(0, 0); | 1881 CreateChannels(0, 0); |
1882 EXPECT_TRUE( | 1882 EXPECT_TRUE( |
1883 channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); | 1883 channel1_->SetLocalContent(&local_media_content1_, CA_OFFER, NULL)); |
1884 | 1884 |
1885 EXPECT_TRUE( | 1885 EXPECT_TRUE(channel1_->SetRtpSendParameters( |
1886 channel1_->SetRtpParameters(kSsrc1, BitrateLimitedParameters(1000))); | 1886 kSsrc1, BitrateLimitedParameters(1000))); |
1887 VerifyMaxBitrate(channel1_->GetRtpParameters(kSsrc1), 1000); | 1887 VerifyMaxBitrate(channel1_->GetRtpSendParameters(kSsrc1), 1000); |
1888 VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), 1000); | 1888 VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), 1000); |
1889 EXPECT_EQ(-1, media_channel1_->max_bps()); | 1889 EXPECT_EQ(-1, media_channel1_->max_bps()); |
1890 | 1890 |
1891 EXPECT_TRUE( | 1891 EXPECT_TRUE( |
1892 channel1_->SetRtpParameters(kSsrc1, BitrateLimitedParameters(-1))); | 1892 channel1_->SetRtpSendParameters(kSsrc1, BitrateLimitedParameters(-1))); |
1893 VerifyMaxBitrate(channel1_->GetRtpParameters(kSsrc1), -1); | 1893 VerifyMaxBitrate(channel1_->GetRtpSendParameters(kSsrc1), -1); |
1894 VerifyMaxBitrate(media_channel1_->GetRtpParameters(kSsrc1), -1); | 1894 VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), -1); |
1895 EXPECT_EQ(-1, media_channel1_->max_bps()); | 1895 EXPECT_EQ(-1, media_channel1_->max_bps()); |
1896 } | 1896 } |
1897 | 1897 |
1898 protected: | 1898 protected: |
1899 void WaitForThreads() { WaitForThreads(rtc::ArrayView<rtc::Thread*>()); } | 1899 void WaitForThreads() { WaitForThreads(rtc::ArrayView<rtc::Thread*>()); } |
1900 static void ProcessThreadQueue(rtc::Thread* thread) { | 1900 static void ProcessThreadQueue(rtc::Thread* thread) { |
1901 RTC_DCHECK(thread->IsCurrent()); | 1901 RTC_DCHECK(thread->IsCurrent()); |
1902 while (!thread->empty()) { | 1902 while (!thread->empty()) { |
1903 thread->ProcessMessages(0); | 1903 thread->ProcessMessages(0); |
1904 } | 1904 } |
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3549 }; | 3549 }; |
3550 rtc::CopyOnWriteBuffer payload(data, 3); | 3550 rtc::CopyOnWriteBuffer payload(data, 3); |
3551 cricket::SendDataResult result; | 3551 cricket::SendDataResult result; |
3552 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 3552 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
3553 EXPECT_EQ(params.ssrc, | 3553 EXPECT_EQ(params.ssrc, |
3554 media_channel1_->last_sent_data_params().ssrc); | 3554 media_channel1_->last_sent_data_params().ssrc); |
3555 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 3555 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
3556 } | 3556 } |
3557 | 3557 |
3558 // TODO(pthatcher): TestSetReceiver? | 3558 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |