| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 cricket::FakeDataMediaChannel, | 88 cricket::FakeDataMediaChannel, |
| 89 cricket::DataContentDescription, | 89 cricket::DataContentDescription, |
| 90 cricket::DataCodec, | 90 cricket::DataCodec, |
| 91 cricket::DataMediaInfo, | 91 cricket::DataMediaInfo, |
| 92 cricket::DataOptions> {}; | 92 cricket::DataOptions> {}; |
| 93 | 93 |
| 94 // Base class for Voice/Video/RtpDataChannel tests | 94 // Base class for Voice/Video/RtpDataChannel tests |
| 95 template<class T> | 95 template<class T> |
| 96 class ChannelTest : public testing::Test, public sigslot::has_slots<> { | 96 class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
| 97 public: | 97 public: |
| 98 enum Flags { RTCP = 0x1, RTCP_MUX = 0x2, SECURE = 0x4, SSRC_MUX = 0x8, | 98 enum Flags { |
| 99 DTLS = 0x10, GCM_CIPHER = 0x20 }; | 99 RTCP_MUX = 0x1, |
| 100 RTCP_MUX_REQUIRED = 0x2, |
| 101 SECURE = 0x4, |
| 102 SSRC_MUX = 0x8, |
| 103 DTLS = 0x10, |
| 104 GCM_CIPHER = 0x20 |
| 105 }; |
| 100 | 106 |
| 101 ChannelTest(bool verify_playout, | 107 ChannelTest(bool verify_playout, |
| 102 rtc::ArrayView<const uint8_t> rtp_data, | 108 rtc::ArrayView<const uint8_t> rtp_data, |
| 103 rtc::ArrayView<const uint8_t> rtcp_data, | 109 rtc::ArrayView<const uint8_t> rtcp_data, |
| 104 NetworkIsWorker network_is_worker) | 110 NetworkIsWorker network_is_worker) |
| 105 : verify_playout_(verify_playout), | 111 : verify_playout_(verify_playout), |
| 106 media_channel1_(NULL), | 112 media_channel1_(NULL), |
| 107 media_channel2_(NULL), | 113 media_channel2_(NULL), |
| 108 rtp_packet_(rtp_data.data(), rtp_data.size()), | 114 rtp_packet_(rtp_data.data(), rtp_data.size()), |
| 109 rtcp_packet_(rtcp_data.data(), rtcp_data.size()), | 115 rtcp_packet_(rtcp_data.data(), rtcp_data.size()), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 125 | 131 |
| 126 void CreateChannels(int flags1, int flags2) { | 132 void CreateChannels(int flags1, int flags2) { |
| 127 CreateChannels(new typename T::MediaChannel(NULL, typename T::Options()), | 133 CreateChannels(new typename T::MediaChannel(NULL, typename T::Options()), |
| 128 new typename T::MediaChannel(NULL, typename T::Options()), | 134 new typename T::MediaChannel(NULL, typename T::Options()), |
| 129 flags1, flags2); | 135 flags1, flags2); |
| 130 } | 136 } |
| 131 void CreateChannels(typename T::MediaChannel* ch1, | 137 void CreateChannels(typename T::MediaChannel* ch1, |
| 132 typename T::MediaChannel* ch2, | 138 typename T::MediaChannel* ch2, |
| 133 int flags1, | 139 int flags1, |
| 134 int flags2) { | 140 int flags2) { |
| 141 // Make sure RTCP_MUX_REQUIRED isn't set without RTCP_MUX. |
| 142 ASSERT_NE(RTCP_MUX_REQUIRED, flags1 & (RTCP_MUX | RTCP_MUX_REQUIRED)); |
| 143 ASSERT_NE(RTCP_MUX_REQUIRED, flags2 & (RTCP_MUX | RTCP_MUX_REQUIRED)); |
| 135 rtc::Thread* worker_thread = rtc::Thread::Current(); | 144 rtc::Thread* worker_thread = rtc::Thread::Current(); |
| 136 media_channel1_ = ch1; | 145 media_channel1_ = ch1; |
| 137 media_channel2_ = ch2; | 146 media_channel2_ = ch2; |
| 138 channel1_.reset( | 147 channel1_.reset( |
| 139 CreateChannel(worker_thread, network_thread_, &media_engine_, ch1, | 148 CreateChannel(worker_thread, network_thread_, &media_engine_, ch1, |
| 140 transport_controller1_.get(), flags1)); | 149 transport_controller1_.get(), flags1)); |
| 141 channel2_.reset( | 150 channel2_.reset( |
| 142 CreateChannel(worker_thread, network_thread_, &media_engine_, ch2, | 151 CreateChannel(worker_thread, network_thread_, &media_engine_, ch2, |
| 143 transport_controller2_.get(), flags2)); | 152 transport_controller2_.get(), flags2)); |
| 144 channel1_->SignalMediaMonitor.connect(this, | 153 channel1_->SignalMediaMonitor.connect(this, |
| 145 &ChannelTest<T>::OnMediaMonitor1); | 154 &ChannelTest<T>::OnMediaMonitor1); |
| 146 channel2_->SignalMediaMonitor.connect(this, | 155 channel2_->SignalMediaMonitor.connect(this, |
| 147 &ChannelTest<T>::OnMediaMonitor2); | 156 &ChannelTest<T>::OnMediaMonitor2); |
| 148 channel1_->SignalDestroyRtcpTransport.connect( | 157 channel1_->SignalRtcpMuxFullyActive.connect( |
| 149 transport_controller1_.get(), | 158 transport_controller1_.get(), |
| 150 &cricket::FakeTransportController::DestroyRtcpTransport); | 159 &cricket::FakeTransportController::DestroyRtcpTransport); |
| 151 channel2_->SignalDestroyRtcpTransport.connect( | 160 channel2_->SignalRtcpMuxFullyActive.connect( |
| 152 transport_controller2_.get(), | 161 transport_controller2_.get(), |
| 153 &cricket::FakeTransportController::DestroyRtcpTransport); | 162 &cricket::FakeTransportController::DestroyRtcpTransport); |
| 154 if ((flags1 & DTLS) && (flags2 & DTLS)) { | 163 if ((flags1 & DTLS) && (flags2 & DTLS)) { |
| 155 flags1 = (flags1 & ~SECURE); | 164 flags1 = (flags1 & ~SECURE); |
| 156 flags2 = (flags2 & ~SECURE); | 165 flags2 = (flags2 & ~SECURE); |
| 157 } | 166 } |
| 158 CreateContent(flags1, kPcmuCodec, kH264Codec, | 167 CreateContent(flags1, kPcmuCodec, kH264Codec, |
| 159 &local_media_content1_); | 168 &local_media_content1_); |
| 160 CreateContent(flags2, kPcmuCodec, kH264Codec, | 169 CreateContent(flags2, kPcmuCodec, kH264Codec, |
| 161 &local_media_content2_); | 170 &local_media_content2_); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 rtc::Thread* network_thread, | 203 rtc::Thread* network_thread, |
| 195 cricket::MediaEngineInterface* engine, | 204 cricket::MediaEngineInterface* engine, |
| 196 typename T::MediaChannel* ch, | 205 typename T::MediaChannel* ch, |
| 197 cricket::TransportController* transport_controller, | 206 cricket::TransportController* transport_controller, |
| 198 int flags) { | 207 int flags) { |
| 199 rtc::Thread* signaling_thread = | 208 rtc::Thread* signaling_thread = |
| 200 transport_controller ? transport_controller->signaling_thread() | 209 transport_controller ? transport_controller->signaling_thread() |
| 201 : nullptr; | 210 : nullptr; |
| 202 typename T::Channel* channel = new typename T::Channel( | 211 typename T::Channel* channel = new typename T::Channel( |
| 203 worker_thread, network_thread, signaling_thread, engine, ch, | 212 worker_thread, network_thread, signaling_thread, engine, ch, |
| 204 cricket::CN_AUDIO, (flags & RTCP) != 0, (flags & SECURE) != 0); | 213 cricket::CN_AUDIO, (flags & RTCP_MUX_REQUIRED) != 0, |
| 214 (flags & SECURE) != 0); |
| 205 rtc::CryptoOptions crypto_options; | 215 rtc::CryptoOptions crypto_options; |
| 206 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; | 216 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; |
| 207 channel->SetCryptoOptions(crypto_options); | 217 channel->SetCryptoOptions(crypto_options); |
| 208 cricket::TransportChannel* rtp_transport = | 218 cricket::TransportChannel* rtp_transport = |
| 209 transport_controller->CreateTransportChannel( | 219 transport_controller->CreateTransportChannel( |
| 210 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTP); | 220 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTP); |
| 211 cricket::TransportChannel* rtcp_transport = nullptr; | 221 cricket::TransportChannel* rtcp_transport = nullptr; |
| 212 if (channel->NeedsRtcpTransport()) { | 222 if (channel->NeedsRtcpTransport()) { |
| 213 rtcp_transport = transport_controller->CreateTransportChannel( | 223 rtcp_transport = transport_controller->CreateTransportChannel( |
| 214 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTCP); | 224 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTCP); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 EXPECT_EQ(0U, media_channel1_->codecs().size()); | 532 EXPECT_EQ(0U, media_channel1_->codecs().size()); |
| 523 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); | 533 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); |
| 524 ASSERT_EQ(1U, media_channel1_->codecs().size()); | 534 ASSERT_EQ(1U, media_channel1_->codecs().size()); |
| 525 EXPECT_TRUE(CodecMatches(content.codecs()[0], | 535 EXPECT_TRUE(CodecMatches(content.codecs()[0], |
| 526 media_channel1_->codecs()[0])); | 536 media_channel1_->codecs()[0])); |
| 527 } | 537 } |
| 528 | 538 |
| 529 // Test that SetLocalContent and SetRemoteContent properly set RTCP | 539 // Test that SetLocalContent and SetRemoteContent properly set RTCP |
| 530 // mux. | 540 // mux. |
| 531 void TestSetContentsRtcpMux() { | 541 void TestSetContentsRtcpMux() { |
| 532 CreateChannels(RTCP, RTCP); | 542 CreateChannels(0, 0); |
| 533 EXPECT_TRUE(channel1_->rtcp_transport() != NULL); | 543 EXPECT_TRUE(channel1_->rtcp_transport() != NULL); |
| 534 EXPECT_TRUE(channel2_->rtcp_transport() != NULL); | 544 EXPECT_TRUE(channel2_->rtcp_transport() != NULL); |
| 535 typename T::Content content; | 545 typename T::Content content; |
| 536 CreateContent(0, kPcmuCodec, kH264Codec, &content); | 546 CreateContent(0, kPcmuCodec, kH264Codec, &content); |
| 537 // Both sides agree on mux. Should no longer be a separate RTCP channel. | 547 // Both sides agree on mux. Should no longer be a separate RTCP channel. |
| 538 content.set_rtcp_mux(true); | 548 content.set_rtcp_mux(true); |
| 539 EXPECT_TRUE(channel1_->SetLocalContent(&content, CA_OFFER, NULL)); | 549 EXPECT_TRUE(channel1_->SetLocalContent(&content, CA_OFFER, NULL)); |
| 540 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); | 550 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); |
| 541 EXPECT_TRUE(channel1_->rtcp_transport() == NULL); | 551 EXPECT_TRUE(channel1_->rtcp_transport() == NULL); |
| 542 // Only initiator supports mux. Should still have a separate RTCP channel. | 552 // Only initiator supports mux. Should still have a separate RTCP channel. |
| 543 EXPECT_TRUE(channel2_->SetLocalContent(&content, CA_OFFER, NULL)); | 553 EXPECT_TRUE(channel2_->SetLocalContent(&content, CA_OFFER, NULL)); |
| 544 content.set_rtcp_mux(false); | 554 content.set_rtcp_mux(false); |
| 545 EXPECT_TRUE(channel2_->SetRemoteContent(&content, CA_ANSWER, NULL)); | 555 EXPECT_TRUE(channel2_->SetRemoteContent(&content, CA_ANSWER, NULL)); |
| 546 EXPECT_TRUE(channel2_->rtcp_transport() != NULL); | 556 EXPECT_TRUE(channel2_->rtcp_transport() != NULL); |
| 547 } | 557 } |
| 548 | 558 |
| 549 // Test that SetLocalContent and SetRemoteContent properly set RTCP | 559 // Test that SetLocalContent and SetRemoteContent properly set RTCP |
| 550 // mux when a provisional answer is received. | 560 // mux when a provisional answer is received. |
| 551 void TestSetContentsRtcpMuxWithPrAnswer() { | 561 void TestSetContentsRtcpMuxWithPrAnswer() { |
| 552 CreateChannels(RTCP, RTCP); | 562 CreateChannels(0, 0); |
| 553 EXPECT_TRUE(channel1_->rtcp_transport() != NULL); | 563 EXPECT_TRUE(channel1_->rtcp_transport() != NULL); |
| 554 EXPECT_TRUE(channel2_->rtcp_transport() != NULL); | 564 EXPECT_TRUE(channel2_->rtcp_transport() != NULL); |
| 555 typename T::Content content; | 565 typename T::Content content; |
| 556 CreateContent(0, kPcmuCodec, kH264Codec, &content); | 566 CreateContent(0, kPcmuCodec, kH264Codec, &content); |
| 557 content.set_rtcp_mux(true); | 567 content.set_rtcp_mux(true); |
| 558 EXPECT_TRUE(channel1_->SetLocalContent(&content, CA_OFFER, NULL)); | 568 EXPECT_TRUE(channel1_->SetLocalContent(&content, CA_OFFER, NULL)); |
| 559 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_PRANSWER, NULL)); | 569 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_PRANSWER, NULL)); |
| 560 EXPECT_TRUE(channel1_->rtcp_transport() != NULL); | 570 EXPECT_TRUE(channel1_->rtcp_transport() != NULL); |
| 561 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); | 571 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); |
| 562 // Both sides agree on mux. Should no longer be a separate RTCP channel. | 572 // Both sides agree on mux. Should no longer be a separate RTCP channel. |
| 563 EXPECT_TRUE(channel1_->rtcp_transport() == NULL); | 573 EXPECT_TRUE(channel1_->rtcp_transport() == NULL); |
| 564 // Only initiator supports mux. Should still have a separate RTCP channel. | 574 // Only initiator supports mux. Should still have a separate RTCP channel. |
| 565 EXPECT_TRUE(channel2_->SetLocalContent(&content, CA_OFFER, NULL)); | 575 EXPECT_TRUE(channel2_->SetLocalContent(&content, CA_OFFER, NULL)); |
| 566 content.set_rtcp_mux(false); | 576 content.set_rtcp_mux(false); |
| 567 EXPECT_TRUE(channel2_->SetRemoteContent(&content, CA_PRANSWER, NULL)); | 577 EXPECT_TRUE(channel2_->SetRemoteContent(&content, CA_PRANSWER, NULL)); |
| 568 EXPECT_TRUE(channel2_->SetRemoteContent(&content, CA_ANSWER, NULL)); | 578 EXPECT_TRUE(channel2_->SetRemoteContent(&content, CA_ANSWER, NULL)); |
| 569 EXPECT_TRUE(channel2_->rtcp_transport() != NULL); | 579 EXPECT_TRUE(channel2_->rtcp_transport() != NULL); |
| 570 } | 580 } |
| 571 | 581 |
| 572 // Test that SetRemoteContent properly deals with a content update. | 582 // Test that SetRemoteContent properly deals with a content update. |
| 573 void TestSetRemoteContentUpdate() { | 583 void TestSetRemoteContentUpdate() { |
| 574 CreateChannels(0, 0); | 584 CreateChannels(0, 0); |
| 575 typename T::Content content; | 585 typename T::Content content; |
| 576 CreateContent(RTCP | RTCP_MUX | SECURE, | 586 CreateContent(RTCP_MUX | SECURE, kPcmuCodec, kH264Codec, &content); |
| 577 kPcmuCodec, kH264Codec, | |
| 578 &content); | |
| 579 EXPECT_EQ(0U, media_channel1_->codecs().size()); | 587 EXPECT_EQ(0U, media_channel1_->codecs().size()); |
| 580 EXPECT_TRUE(channel1_->SetLocalContent(&content, CA_OFFER, NULL)); | 588 EXPECT_TRUE(channel1_->SetLocalContent(&content, CA_OFFER, NULL)); |
| 581 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); | 589 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); |
| 582 ASSERT_EQ(1U, media_channel1_->codecs().size()); | 590 ASSERT_EQ(1U, media_channel1_->codecs().size()); |
| 583 EXPECT_TRUE(CodecMatches(content.codecs()[0], | 591 EXPECT_TRUE(CodecMatches(content.codecs()[0], |
| 584 media_channel1_->codecs()[0])); | 592 media_channel1_->codecs()[0])); |
| 585 // Now update with other codecs. | 593 // Now update with other codecs. |
| 586 typename T::Content update_content; | 594 typename T::Content update_content; |
| 587 update_content.set_partial(true); | 595 update_content.set_partial(true); |
| 588 CreateContent(0, kIsacCodec, kH264SvcCodec, | 596 CreateContent(0, kIsacCodec, kH264SvcCodec, |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 class LastWordMediaChannel : public T::MediaChannel { | 1025 class LastWordMediaChannel : public T::MediaChannel { |
| 1018 public: | 1026 public: |
| 1019 LastWordMediaChannel() : T::MediaChannel(NULL, typename T::Options()) {} | 1027 LastWordMediaChannel() : T::MediaChannel(NULL, typename T::Options()) {} |
| 1020 ~LastWordMediaChannel() { | 1028 ~LastWordMediaChannel() { |
| 1021 T::MediaChannel::SendRtp(kPcmuFrame, sizeof(kPcmuFrame), | 1029 T::MediaChannel::SendRtp(kPcmuFrame, sizeof(kPcmuFrame), |
| 1022 rtc::PacketOptions()); | 1030 rtc::PacketOptions()); |
| 1023 T::MediaChannel::SendRtcp(kRtcpReport, sizeof(kRtcpReport)); | 1031 T::MediaChannel::SendRtcp(kRtcpReport, sizeof(kRtcpReport)); |
| 1024 } | 1032 } |
| 1025 }; | 1033 }; |
| 1026 CreateChannels(new LastWordMediaChannel(), new LastWordMediaChannel(), | 1034 CreateChannels(new LastWordMediaChannel(), new LastWordMediaChannel(), |
| 1027 RTCP | RTCP_MUX, RTCP | RTCP_MUX); | 1035 RTCP_MUX, RTCP_MUX); |
| 1028 EXPECT_TRUE(SendInitiate()); | 1036 EXPECT_TRUE(SendInitiate()); |
| 1029 EXPECT_TRUE(SendAccept()); | 1037 EXPECT_TRUE(SendAccept()); |
| 1030 EXPECT_TRUE(SendTerminate()); | 1038 EXPECT_TRUE(SendTerminate()); |
| 1031 } | 1039 } |
| 1032 | 1040 |
| 1033 // Send voice RTP data to the other side and ensure it gets there. | 1041 // Send voice RTP data to the other side and ensure it gets there. |
| 1034 void SendRtpToRtp() { | 1042 void SendRtpToRtp() { |
| 1035 CreateChannels(0, 0); | 1043 CreateChannels(RTCP_MUX | RTCP_MUX_REQUIRED, RTCP_MUX | RTCP_MUX_REQUIRED); |
| 1036 EXPECT_TRUE(SendInitiate()); | 1044 EXPECT_TRUE(SendInitiate()); |
| 1037 EXPECT_TRUE(SendAccept()); | 1045 EXPECT_TRUE(SendAccept()); |
| 1038 EXPECT_EQ(1U, GetChannels1().size()); | 1046 EXPECT_EQ(1U, GetChannels1().size()); |
| 1039 EXPECT_EQ(1U, GetChannels2().size()); | 1047 EXPECT_EQ(1U, GetChannels2().size()); |
| 1040 SendRtp1(); | 1048 SendRtp1(); |
| 1041 SendRtp2(); | 1049 SendRtp2(); |
| 1042 WaitForThreads(); | 1050 WaitForThreads(); |
| 1043 EXPECT_TRUE(CheckRtp1()); | 1051 EXPECT_TRUE(CheckRtp1()); |
| 1044 EXPECT_TRUE(CheckRtp2()); | 1052 EXPECT_TRUE(CheckRtp2()); |
| 1045 EXPECT_TRUE(CheckNoRtp1()); | 1053 EXPECT_TRUE(CheckNoRtp1()); |
| 1046 EXPECT_TRUE(CheckNoRtp2()); | 1054 EXPECT_TRUE(CheckNoRtp2()); |
| 1047 } | 1055 } |
| 1048 | 1056 |
| 1049 void TestDeinit() { | 1057 void TestDeinit() { |
| 1050 CreateChannels(RTCP, RTCP); | 1058 CreateChannels(0, 0); |
| 1051 EXPECT_TRUE(SendInitiate()); | 1059 EXPECT_TRUE(SendInitiate()); |
| 1052 EXPECT_TRUE(SendAccept()); | 1060 EXPECT_TRUE(SendAccept()); |
| 1053 SendRtp1(); | 1061 SendRtp1(); |
| 1054 SendRtp2(); | 1062 SendRtp2(); |
| 1055 SendRtcp1(); | 1063 SendRtcp1(); |
| 1056 SendRtcp2(); | 1064 SendRtcp2(); |
| 1057 // Do not wait, destroy channels. | 1065 // Do not wait, destroy channels. |
| 1058 channel1_.reset(nullptr); | 1066 channel1_.reset(nullptr); |
| 1059 channel2_.reset(nullptr); | 1067 channel2_.reset(nullptr); |
| 1060 } | 1068 } |
| 1061 | 1069 |
| 1062 // Check that RTCP is not transmitted if both sides don't support RTCP. | 1070 // Check that RTCP can be transmitted between both sides. |
| 1063 void SendNoRtcpToNoRtcp() { | 1071 void SendRtcpToRtcp() { |
| 1064 CreateChannels(0, 0); | 1072 CreateChannels(0, 0); |
| 1065 EXPECT_TRUE(SendInitiate()); | 1073 EXPECT_TRUE(SendInitiate()); |
| 1066 EXPECT_TRUE(SendAccept()); | 1074 EXPECT_TRUE(SendAccept()); |
| 1067 EXPECT_EQ(1U, GetChannels1().size()); | |
| 1068 EXPECT_EQ(1U, GetChannels2().size()); | |
| 1069 SendRtcp1(); | |
| 1070 SendRtcp2(); | |
| 1071 WaitForThreads(); | |
| 1072 EXPECT_TRUE(CheckNoRtcp1()); | |
| 1073 EXPECT_TRUE(CheckNoRtcp2()); | |
| 1074 } | |
| 1075 | |
| 1076 // Check that RTCP is not transmitted if the callee doesn't support RTCP. | |
| 1077 void SendNoRtcpToRtcp() { | |
| 1078 CreateChannels(0, RTCP); | |
| 1079 EXPECT_TRUE(SendInitiate()); | |
| 1080 EXPECT_TRUE(SendAccept()); | |
| 1081 EXPECT_EQ(1U, GetChannels1().size()); | |
| 1082 EXPECT_EQ(2U, GetChannels2().size()); | |
| 1083 SendRtcp1(); | |
| 1084 SendRtcp2(); | |
| 1085 WaitForThreads(); | |
| 1086 EXPECT_TRUE(CheckNoRtcp1()); | |
| 1087 EXPECT_TRUE(CheckNoRtcp2()); | |
| 1088 } | |
| 1089 | |
| 1090 // Check that RTCP is not transmitted if the caller doesn't support RTCP. | |
| 1091 void SendRtcpToNoRtcp() { | |
| 1092 CreateChannels(RTCP, 0); | |
| 1093 EXPECT_TRUE(SendInitiate()); | |
| 1094 EXPECT_TRUE(SendAccept()); | |
| 1095 EXPECT_EQ(2U, GetChannels1().size()); | 1075 EXPECT_EQ(2U, GetChannels1().size()); |
| 1096 EXPECT_EQ(1U, GetChannels2().size()); | |
| 1097 SendRtcp1(); | |
| 1098 SendRtcp2(); | |
| 1099 WaitForThreads(); | |
| 1100 EXPECT_TRUE(CheckNoRtcp1()); | |
| 1101 EXPECT_TRUE(CheckNoRtcp2()); | |
| 1102 } | |
| 1103 | |
| 1104 // Check that RTCP is transmitted if both sides support RTCP. | |
| 1105 void SendRtcpToRtcp() { | |
| 1106 CreateChannels(RTCP, RTCP); | |
| 1107 EXPECT_TRUE(SendInitiate()); | |
| 1108 EXPECT_TRUE(SendAccept()); | |
| 1109 EXPECT_EQ(2U, GetChannels1().size()); | |
| 1110 EXPECT_EQ(2U, GetChannels2().size()); | 1076 EXPECT_EQ(2U, GetChannels2().size()); |
| 1111 SendRtcp1(); | 1077 SendRtcp1(); |
| 1112 SendRtcp2(); | 1078 SendRtcp2(); |
| 1113 WaitForThreads(); | 1079 WaitForThreads(); |
| 1114 EXPECT_TRUE(CheckRtcp1()); | 1080 EXPECT_TRUE(CheckRtcp1()); |
| 1115 EXPECT_TRUE(CheckRtcp2()); | 1081 EXPECT_TRUE(CheckRtcp2()); |
| 1116 EXPECT_TRUE(CheckNoRtcp1()); | 1082 EXPECT_TRUE(CheckNoRtcp1()); |
| 1117 EXPECT_TRUE(CheckNoRtcp2()); | 1083 EXPECT_TRUE(CheckNoRtcp2()); |
| 1118 } | 1084 } |
| 1119 | 1085 |
| 1120 // Check that RTCP is transmitted if only the initiator supports mux. | 1086 // Check that RTCP is transmitted if only the initiator supports mux. |
| 1121 void SendRtcpMuxToRtcp() { | 1087 void SendRtcpMuxToRtcp() { |
| 1122 CreateChannels(RTCP | RTCP_MUX, RTCP); | 1088 CreateChannels(RTCP_MUX, 0); |
| 1123 EXPECT_TRUE(SendInitiate()); | 1089 EXPECT_TRUE(SendInitiate()); |
| 1124 EXPECT_TRUE(SendAccept()); | 1090 EXPECT_TRUE(SendAccept()); |
| 1125 EXPECT_EQ(2U, GetChannels1().size()); | 1091 EXPECT_EQ(2U, GetChannels1().size()); |
| 1126 EXPECT_EQ(2U, GetChannels2().size()); | 1092 EXPECT_EQ(2U, GetChannels2().size()); |
| 1127 SendRtcp1(); | 1093 SendRtcp1(); |
| 1128 SendRtcp2(); | 1094 SendRtcp2(); |
| 1129 WaitForThreads(); | 1095 WaitForThreads(); |
| 1130 EXPECT_TRUE(CheckRtcp1()); | 1096 EXPECT_TRUE(CheckRtcp1()); |
| 1131 EXPECT_TRUE(CheckRtcp2()); | 1097 EXPECT_TRUE(CheckRtcp2()); |
| 1132 EXPECT_TRUE(CheckNoRtcp1()); | 1098 EXPECT_TRUE(CheckNoRtcp1()); |
| 1133 EXPECT_TRUE(CheckNoRtcp2()); | 1099 EXPECT_TRUE(CheckNoRtcp2()); |
| 1134 } | 1100 } |
| 1135 | 1101 |
| 1136 // Check that RTP and RTCP are transmitted ok when both sides support mux. | 1102 // Check that RTP and RTCP are transmitted ok when both sides support mux. |
| 1137 void SendRtcpMuxToRtcpMux() { | 1103 void SendRtcpMuxToRtcpMux() { |
| 1138 CreateChannels(RTCP | RTCP_MUX, RTCP | RTCP_MUX); | 1104 CreateChannels(RTCP_MUX, RTCP_MUX); |
| 1139 EXPECT_TRUE(SendInitiate()); | 1105 EXPECT_TRUE(SendInitiate()); |
| 1140 EXPECT_EQ(2U, GetChannels1().size()); | 1106 EXPECT_EQ(2U, GetChannels1().size()); |
| 1141 EXPECT_EQ(1U, GetChannels2().size()); | 1107 EXPECT_EQ(1U, GetChannels2().size()); |
| 1142 EXPECT_TRUE(SendAccept()); | 1108 EXPECT_TRUE(SendAccept()); |
| 1143 EXPECT_EQ(1U, GetChannels1().size()); | 1109 EXPECT_EQ(1U, GetChannels1().size()); |
| 1144 SendRtp1(); | 1110 SendRtp1(); |
| 1145 SendRtp2(); | 1111 SendRtp2(); |
| 1146 SendRtcp1(); | 1112 SendRtcp1(); |
| 1147 SendRtcp2(); | 1113 SendRtcp2(); |
| 1148 WaitForThreads(); | 1114 WaitForThreads(); |
| 1149 EXPECT_TRUE(CheckRtp1()); | 1115 EXPECT_TRUE(CheckRtp1()); |
| 1150 EXPECT_TRUE(CheckRtp2()); | 1116 EXPECT_TRUE(CheckRtp2()); |
| 1151 EXPECT_TRUE(CheckNoRtp1()); | 1117 EXPECT_TRUE(CheckNoRtp1()); |
| 1152 EXPECT_TRUE(CheckNoRtp2()); | 1118 EXPECT_TRUE(CheckNoRtp2()); |
| 1153 EXPECT_TRUE(CheckRtcp1()); | 1119 EXPECT_TRUE(CheckRtcp1()); |
| 1154 EXPECT_TRUE(CheckRtcp2()); | 1120 EXPECT_TRUE(CheckRtcp2()); |
| 1155 EXPECT_TRUE(CheckNoRtcp1()); | 1121 EXPECT_TRUE(CheckNoRtcp1()); |
| 1156 EXPECT_TRUE(CheckNoRtcp2()); | 1122 EXPECT_TRUE(CheckNoRtcp2()); |
| 1157 } | 1123 } |
| 1158 | 1124 |
| 1159 // Check that RTP and RTCP are transmitted ok when both sides | 1125 // Check that RTP and RTCP are transmitted ok when both sides |
| 1160 // support mux and one the offerer requires mux. | 1126 // support mux and one the offerer requires mux. |
| 1161 void SendRequireRtcpMuxToRtcpMux() { | 1127 void SendRequireRtcpMuxToRtcpMux() { |
| 1162 CreateChannels(RTCP | RTCP_MUX, RTCP | RTCP_MUX); | 1128 CreateChannels(RTCP_MUX | RTCP_MUX_REQUIRED, RTCP_MUX); |
| 1163 channel1_->ActivateRtcpMux(); | |
| 1164 EXPECT_TRUE(SendInitiate()); | 1129 EXPECT_TRUE(SendInitiate()); |
| 1165 EXPECT_EQ(1U, GetChannels1().size()); | 1130 EXPECT_EQ(1U, GetChannels1().size()); |
| 1166 EXPECT_EQ(1U, GetChannels2().size()); | 1131 EXPECT_EQ(1U, GetChannels2().size()); |
| 1167 EXPECT_TRUE(SendAccept()); | 1132 EXPECT_TRUE(SendAccept()); |
| 1168 SendRtp1(); | 1133 SendRtp1(); |
| 1169 SendRtp2(); | 1134 SendRtp2(); |
| 1170 SendRtcp1(); | 1135 SendRtcp1(); |
| 1171 SendRtcp2(); | 1136 SendRtcp2(); |
| 1172 WaitForThreads(); | 1137 WaitForThreads(); |
| 1173 EXPECT_TRUE(CheckRtp1()); | 1138 EXPECT_TRUE(CheckRtp1()); |
| 1174 EXPECT_TRUE(CheckRtp2()); | 1139 EXPECT_TRUE(CheckRtp2()); |
| 1175 EXPECT_TRUE(CheckNoRtp1()); | 1140 EXPECT_TRUE(CheckNoRtp1()); |
| 1176 EXPECT_TRUE(CheckNoRtp2()); | 1141 EXPECT_TRUE(CheckNoRtp2()); |
| 1177 EXPECT_TRUE(CheckRtcp1()); | 1142 EXPECT_TRUE(CheckRtcp1()); |
| 1178 EXPECT_TRUE(CheckRtcp2()); | 1143 EXPECT_TRUE(CheckRtcp2()); |
| 1179 EXPECT_TRUE(CheckNoRtcp1()); | 1144 EXPECT_TRUE(CheckNoRtcp1()); |
| 1180 EXPECT_TRUE(CheckNoRtcp2()); | 1145 EXPECT_TRUE(CheckNoRtcp2()); |
| 1181 } | 1146 } |
| 1182 | 1147 |
| 1183 // Check that RTP and RTCP are transmitted ok when both sides | 1148 // Check that RTP and RTCP are transmitted ok when both sides |
| 1184 // support mux and one the answerer requires rtcp mux. | 1149 // support mux and only the answerer requires rtcp mux. |
| 1185 void SendRtcpMuxToRequireRtcpMux() { | 1150 void SendRtcpMuxToRequireRtcpMux() { |
| 1186 CreateChannels(RTCP | RTCP_MUX, RTCP | RTCP_MUX); | 1151 CreateChannels(RTCP_MUX, RTCP_MUX | RTCP_MUX_REQUIRED); |
| 1187 channel2_->ActivateRtcpMux(); | |
| 1188 EXPECT_TRUE(SendInitiate()); | 1152 EXPECT_TRUE(SendInitiate()); |
| 1189 EXPECT_EQ(2U, GetChannels1().size()); | 1153 EXPECT_EQ(2U, GetChannels1().size()); |
| 1190 EXPECT_EQ(1U, GetChannels2().size()); | 1154 EXPECT_EQ(1U, GetChannels2().size()); |
| 1191 EXPECT_TRUE(SendAccept()); | 1155 EXPECT_TRUE(SendAccept()); |
| 1192 EXPECT_EQ(1U, GetChannels1().size()); | 1156 EXPECT_EQ(1U, GetChannels1().size()); |
| 1193 SendRtp1(); | 1157 SendRtp1(); |
| 1194 SendRtp2(); | 1158 SendRtp2(); |
| 1195 SendRtcp1(); | 1159 SendRtcp1(); |
| 1196 SendRtcp2(); | 1160 SendRtcp2(); |
| 1197 WaitForThreads(); | 1161 WaitForThreads(); |
| 1198 EXPECT_TRUE(CheckRtp1()); | 1162 EXPECT_TRUE(CheckRtp1()); |
| 1199 EXPECT_TRUE(CheckRtp2()); | 1163 EXPECT_TRUE(CheckRtp2()); |
| 1200 EXPECT_TRUE(CheckNoRtp1()); | 1164 EXPECT_TRUE(CheckNoRtp1()); |
| 1201 EXPECT_TRUE(CheckNoRtp2()); | 1165 EXPECT_TRUE(CheckNoRtp2()); |
| 1202 EXPECT_TRUE(CheckRtcp1()); | 1166 EXPECT_TRUE(CheckRtcp1()); |
| 1203 EXPECT_TRUE(CheckRtcp2()); | 1167 EXPECT_TRUE(CheckRtcp2()); |
| 1204 EXPECT_TRUE(CheckNoRtcp1()); | 1168 EXPECT_TRUE(CheckNoRtcp1()); |
| 1205 EXPECT_TRUE(CheckNoRtcp2()); | 1169 EXPECT_TRUE(CheckNoRtcp2()); |
| 1206 } | 1170 } |
| 1207 | 1171 |
| 1208 // Check that RTP and RTCP are transmitted ok when both sides | 1172 // Check that RTP and RTCP are transmitted ok when both sides |
| 1209 // require mux. | 1173 // require mux. |
| 1210 void SendRequireRtcpMuxToRequireRtcpMux() { | 1174 void SendRequireRtcpMuxToRequireRtcpMux() { |
| 1211 CreateChannels(RTCP | RTCP_MUX, RTCP | RTCP_MUX); | 1175 CreateChannels(RTCP_MUX | RTCP_MUX_REQUIRED, RTCP_MUX | RTCP_MUX_REQUIRED); |
| 1212 channel1_->ActivateRtcpMux(); | |
| 1213 channel2_->ActivateRtcpMux(); | |
| 1214 EXPECT_TRUE(SendInitiate()); | 1176 EXPECT_TRUE(SendInitiate()); |
| 1215 EXPECT_EQ(1U, GetChannels1().size()); | 1177 EXPECT_EQ(1U, GetChannels1().size()); |
| 1216 EXPECT_EQ(1U, GetChannels2().size()); | 1178 EXPECT_EQ(1U, GetChannels2().size()); |
| 1217 EXPECT_TRUE(SendAccept()); | 1179 EXPECT_TRUE(SendAccept()); |
| 1218 EXPECT_EQ(1U, GetChannels1().size()); | 1180 EXPECT_EQ(1U, GetChannels1().size()); |
| 1219 SendRtp1(); | 1181 SendRtp1(); |
| 1220 SendRtp2(); | 1182 SendRtp2(); |
| 1221 SendRtcp1(); | 1183 SendRtcp1(); |
| 1222 SendRtcp2(); | 1184 SendRtcp2(); |
| 1223 WaitForThreads(); | 1185 WaitForThreads(); |
| 1224 EXPECT_TRUE(CheckRtp1()); | 1186 EXPECT_TRUE(CheckRtp1()); |
| 1225 EXPECT_TRUE(CheckRtp2()); | 1187 EXPECT_TRUE(CheckRtp2()); |
| 1226 EXPECT_TRUE(CheckNoRtp1()); | 1188 EXPECT_TRUE(CheckNoRtp1()); |
| 1227 EXPECT_TRUE(CheckNoRtp2()); | 1189 EXPECT_TRUE(CheckNoRtp2()); |
| 1228 EXPECT_TRUE(CheckRtcp1()); | 1190 EXPECT_TRUE(CheckRtcp1()); |
| 1229 EXPECT_TRUE(CheckRtcp2()); | 1191 EXPECT_TRUE(CheckRtcp2()); |
| 1230 EXPECT_TRUE(CheckNoRtcp1()); | 1192 EXPECT_TRUE(CheckNoRtcp1()); |
| 1231 EXPECT_TRUE(CheckNoRtcp2()); | 1193 EXPECT_TRUE(CheckNoRtcp2()); |
| 1232 } | 1194 } |
| 1233 | 1195 |
| 1234 // Check that SendAccept fails if the answerer doesn't support mux | 1196 // Check that SendAccept fails if the answerer doesn't support mux |
| 1235 // and the offerer requires it. | 1197 // and the offerer requires it. |
| 1236 void SendRequireRtcpMuxToNoRtcpMux() { | 1198 void SendRequireRtcpMuxToNoRtcpMux() { |
| 1237 CreateChannels(RTCP | RTCP_MUX, RTCP); | 1199 CreateChannels(RTCP_MUX | RTCP_MUX_REQUIRED, 0); |
| 1238 channel1_->ActivateRtcpMux(); | |
| 1239 EXPECT_TRUE(SendInitiate()); | 1200 EXPECT_TRUE(SendInitiate()); |
| 1240 EXPECT_EQ(1U, GetChannels1().size()); | 1201 EXPECT_EQ(1U, GetChannels1().size()); |
| 1241 EXPECT_EQ(2U, GetChannels2().size()); | 1202 EXPECT_EQ(2U, GetChannels2().size()); |
| 1242 EXPECT_FALSE(SendAccept()); | 1203 EXPECT_FALSE(SendAccept()); |
| 1243 } | 1204 } |
| 1244 | 1205 |
| 1245 // Check that RTCP data sent by the initiator before the accept is not muxed. | 1206 // Check that RTCP data sent by the initiator before the accept is not muxed. |
| 1246 void SendEarlyRtcpMuxToRtcp() { | 1207 void SendEarlyRtcpMuxToRtcp() { |
| 1247 CreateChannels(RTCP | RTCP_MUX, RTCP); | 1208 CreateChannels(RTCP_MUX, 0); |
| 1248 EXPECT_TRUE(SendInitiate()); | 1209 EXPECT_TRUE(SendInitiate()); |
| 1249 EXPECT_EQ(2U, GetChannels1().size()); | 1210 EXPECT_EQ(2U, GetChannels1().size()); |
| 1250 EXPECT_EQ(2U, GetChannels2().size()); | 1211 EXPECT_EQ(2U, GetChannels2().size()); |
| 1251 | 1212 |
| 1252 // RTCP can be sent before the call is accepted, if the transport is ready. | 1213 // RTCP can be sent before the call is accepted, if the transport is ready. |
| 1253 // It should not be muxed though, as the remote side doesn't support mux. | 1214 // It should not be muxed though, as the remote side doesn't support mux. |
| 1254 SendRtcp1(); | 1215 SendRtcp1(); |
| 1255 WaitForThreads(); | 1216 WaitForThreads(); |
| 1256 EXPECT_TRUE(CheckNoRtp2()); | 1217 EXPECT_TRUE(CheckNoRtp2()); |
| 1257 EXPECT_TRUE(CheckRtcp2()); | 1218 EXPECT_TRUE(CheckRtcp2()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1270 WaitForThreads(); | 1231 WaitForThreads(); |
| 1271 EXPECT_TRUE(CheckRtcp2()); | 1232 EXPECT_TRUE(CheckRtcp2()); |
| 1272 EXPECT_TRUE(CheckRtcp1()); | 1233 EXPECT_TRUE(CheckRtcp1()); |
| 1273 } | 1234 } |
| 1274 | 1235 |
| 1275 | 1236 |
| 1276 // Check that RTCP data is not muxed until both sides have enabled muxing, | 1237 // Check that RTCP data is not muxed until both sides have enabled muxing, |
| 1277 // but that we properly demux before we get the accept message, since there | 1238 // but that we properly demux before we get the accept message, since there |
| 1278 // is a race between RTP data and the jingle accept. | 1239 // is a race between RTP data and the jingle accept. |
| 1279 void SendEarlyRtcpMuxToRtcpMux() { | 1240 void SendEarlyRtcpMuxToRtcpMux() { |
| 1280 CreateChannels(RTCP | RTCP_MUX, RTCP | RTCP_MUX); | 1241 CreateChannels(RTCP_MUX, RTCP_MUX); |
| 1281 EXPECT_TRUE(SendInitiate()); | 1242 EXPECT_TRUE(SendInitiate()); |
| 1282 EXPECT_EQ(2U, GetChannels1().size()); | 1243 EXPECT_EQ(2U, GetChannels1().size()); |
| 1283 EXPECT_EQ(1U, GetChannels2().size()); | 1244 EXPECT_EQ(1U, GetChannels2().size()); |
| 1284 | 1245 |
| 1285 // RTCP can't be sent yet, since the RTCP transport isn't writable, and | 1246 // RTCP can't be sent yet, since the RTCP transport isn't writable, and |
| 1286 // we haven't yet received the accept that says we should mux. | 1247 // we haven't yet received the accept that says we should mux. |
| 1287 SendRtcp1(); | 1248 SendRtcp1(); |
| 1288 WaitForThreads(); | 1249 WaitForThreads(); |
| 1289 EXPECT_TRUE(CheckNoRtcp2()); | 1250 EXPECT_TRUE(CheckNoRtcp2()); |
| 1290 | 1251 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1303 EXPECT_TRUE(CheckRtcp2()); | 1264 EXPECT_TRUE(CheckRtcp2()); |
| 1304 EXPECT_TRUE(CheckRtcp1()); | 1265 EXPECT_TRUE(CheckRtcp1()); |
| 1305 } | 1266 } |
| 1306 | 1267 |
| 1307 // Test that we properly send SRTP with RTCP in both directions. | 1268 // Test that we properly send SRTP with RTCP in both directions. |
| 1308 // You can pass in DTLS and/or RTCP_MUX as flags. | 1269 // You can pass in DTLS and/or RTCP_MUX as flags. |
| 1309 void SendSrtpToSrtp(int flags1_in = 0, int flags2_in = 0) { | 1270 void SendSrtpToSrtp(int flags1_in = 0, int flags2_in = 0) { |
| 1310 ASSERT((flags1_in & ~(RTCP_MUX | DTLS | GCM_CIPHER)) == 0); | 1271 ASSERT((flags1_in & ~(RTCP_MUX | DTLS | GCM_CIPHER)) == 0); |
| 1311 ASSERT((flags2_in & ~(RTCP_MUX | DTLS | GCM_CIPHER)) == 0); | 1272 ASSERT((flags2_in & ~(RTCP_MUX | DTLS | GCM_CIPHER)) == 0); |
| 1312 | 1273 |
| 1313 int flags1 = RTCP | SECURE | flags1_in; | 1274 int flags1 = SECURE | flags1_in; |
| 1314 int flags2 = RTCP | SECURE | flags2_in; | 1275 int flags2 = SECURE | flags2_in; |
| 1315 bool dtls1 = !!(flags1_in & DTLS); | 1276 bool dtls1 = !!(flags1_in & DTLS); |
| 1316 bool dtls2 = !!(flags2_in & DTLS); | 1277 bool dtls2 = !!(flags2_in & DTLS); |
| 1317 CreateChannels(flags1, flags2); | 1278 CreateChannels(flags1, flags2); |
| 1318 EXPECT_FALSE(channel1_->secure()); | 1279 EXPECT_FALSE(channel1_->secure()); |
| 1319 EXPECT_FALSE(channel2_->secure()); | 1280 EXPECT_FALSE(channel2_->secure()); |
| 1320 EXPECT_TRUE(SendInitiate()); | 1281 EXPECT_TRUE(SendInitiate()); |
| 1321 WaitForThreads(); | 1282 WaitForThreads(); |
| 1322 EXPECT_TRUE(channel1_->writable()); | 1283 EXPECT_TRUE(channel1_->writable()); |
| 1323 EXPECT_TRUE(channel2_->writable()); | 1284 EXPECT_TRUE(channel2_->writable()); |
| 1324 EXPECT_TRUE(SendAccept()); | 1285 EXPECT_TRUE(SendAccept()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1344 EXPECT_TRUE(CheckNoRtp1()); | 1305 EXPECT_TRUE(CheckNoRtp1()); |
| 1345 EXPECT_TRUE(CheckNoRtp2()); | 1306 EXPECT_TRUE(CheckNoRtp2()); |
| 1346 EXPECT_TRUE(CheckRtcp1()); | 1307 EXPECT_TRUE(CheckRtcp1()); |
| 1347 EXPECT_TRUE(CheckRtcp2()); | 1308 EXPECT_TRUE(CheckRtcp2()); |
| 1348 EXPECT_TRUE(CheckNoRtcp1()); | 1309 EXPECT_TRUE(CheckNoRtcp1()); |
| 1349 EXPECT_TRUE(CheckNoRtcp2()); | 1310 EXPECT_TRUE(CheckNoRtcp2()); |
| 1350 } | 1311 } |
| 1351 | 1312 |
| 1352 // Test that we properly handling SRTP negotiating down to RTP. | 1313 // Test that we properly handling SRTP negotiating down to RTP. |
| 1353 void SendSrtpToRtp() { | 1314 void SendSrtpToRtp() { |
| 1354 CreateChannels(RTCP | SECURE, RTCP); | 1315 CreateChannels(SECURE, 0); |
| 1355 EXPECT_FALSE(channel1_->secure()); | 1316 EXPECT_FALSE(channel1_->secure()); |
| 1356 EXPECT_FALSE(channel2_->secure()); | 1317 EXPECT_FALSE(channel2_->secure()); |
| 1357 EXPECT_TRUE(SendInitiate()); | 1318 EXPECT_TRUE(SendInitiate()); |
| 1358 EXPECT_TRUE(SendAccept()); | 1319 EXPECT_TRUE(SendAccept()); |
| 1359 EXPECT_FALSE(channel1_->secure()); | 1320 EXPECT_FALSE(channel1_->secure()); |
| 1360 EXPECT_FALSE(channel2_->secure()); | 1321 EXPECT_FALSE(channel2_->secure()); |
| 1361 SendRtp1(); | 1322 SendRtp1(); |
| 1362 SendRtp2(); | 1323 SendRtp2(); |
| 1363 SendRtcp1(); | 1324 SendRtcp1(); |
| 1364 SendRtcp2(); | 1325 SendRtcp2(); |
| 1365 WaitForThreads(); | 1326 WaitForThreads(); |
| 1366 EXPECT_TRUE(CheckRtp1()); | 1327 EXPECT_TRUE(CheckRtp1()); |
| 1367 EXPECT_TRUE(CheckRtp2()); | 1328 EXPECT_TRUE(CheckRtp2()); |
| 1368 EXPECT_TRUE(CheckNoRtp1()); | 1329 EXPECT_TRUE(CheckNoRtp1()); |
| 1369 EXPECT_TRUE(CheckNoRtp2()); | 1330 EXPECT_TRUE(CheckNoRtp2()); |
| 1370 EXPECT_TRUE(CheckRtcp1()); | 1331 EXPECT_TRUE(CheckRtcp1()); |
| 1371 EXPECT_TRUE(CheckRtcp2()); | 1332 EXPECT_TRUE(CheckRtcp2()); |
| 1372 EXPECT_TRUE(CheckNoRtcp1()); | 1333 EXPECT_TRUE(CheckNoRtcp1()); |
| 1373 EXPECT_TRUE(CheckNoRtcp2()); | 1334 EXPECT_TRUE(CheckNoRtcp2()); |
| 1374 } | 1335 } |
| 1375 | 1336 |
| 1376 // Test that we can send and receive early media when a provisional answer is | 1337 // Test that we can send and receive early media when a provisional answer is |
| 1377 // sent and received. The test uses SRTP, RTCP mux and SSRC mux. | 1338 // sent and received. The test uses SRTP, RTCP mux and SSRC mux. |
| 1378 void SendEarlyMediaUsingRtcpMuxSrtp() { | 1339 void SendEarlyMediaUsingRtcpMuxSrtp() { |
| 1379 int sequence_number1_1 = 0, sequence_number2_2 = 0; | 1340 int sequence_number1_1 = 0, sequence_number2_2 = 0; |
| 1380 | 1341 |
| 1381 CreateChannels(SSRC_MUX | RTCP | RTCP_MUX | SECURE, | 1342 CreateChannels(SSRC_MUX | RTCP_MUX | SECURE, |
| 1382 SSRC_MUX | RTCP | RTCP_MUX | SECURE); | 1343 SSRC_MUX | RTCP_MUX | SECURE); |
| 1383 EXPECT_TRUE(SendOffer()); | 1344 EXPECT_TRUE(SendOffer()); |
| 1384 EXPECT_TRUE(SendProvisionalAnswer()); | 1345 EXPECT_TRUE(SendProvisionalAnswer()); |
| 1385 EXPECT_TRUE(channel1_->secure()); | 1346 EXPECT_TRUE(channel1_->secure()); |
| 1386 EXPECT_TRUE(channel2_->secure()); | 1347 EXPECT_TRUE(channel2_->secure()); |
| 1387 EXPECT_EQ(2U, GetChannels1().size()); | 1348 EXPECT_EQ(2U, GetChannels1().size()); |
| 1388 EXPECT_EQ(2U, GetChannels2().size()); | 1349 EXPECT_EQ(2U, GetChannels2().size()); |
| 1389 WaitForThreads(); // Wait for 'sending' flag go through network thread. | 1350 WaitForThreads(); // Wait for 'sending' flag go through network thread. |
| 1390 SendCustomRtcp1(kSsrc1); | 1351 SendCustomRtcp1(kSsrc1); |
| 1391 SendCustomRtp1(kSsrc1, ++sequence_number1_1); | 1352 SendCustomRtp1(kSsrc1, ++sequence_number1_1); |
| 1392 WaitForThreads(); | 1353 WaitForThreads(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1412 SendCustomRtp2(kSsrc2, ++sequence_number2_2); | 1373 SendCustomRtp2(kSsrc2, ++sequence_number2_2); |
| 1413 WaitForThreads(); | 1374 WaitForThreads(); |
| 1414 EXPECT_TRUE(CheckCustomRtcp2(kSsrc1)); | 1375 EXPECT_TRUE(CheckCustomRtcp2(kSsrc1)); |
| 1415 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, sequence_number1_1)); | 1376 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, sequence_number1_1)); |
| 1416 EXPECT_TRUE(CheckCustomRtcp1(kSsrc2)); | 1377 EXPECT_TRUE(CheckCustomRtcp1(kSsrc2)); |
| 1417 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, sequence_number2_2)); | 1378 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, sequence_number2_2)); |
| 1418 } | 1379 } |
| 1419 | 1380 |
| 1420 // Test that we properly send RTP without SRTP from a thread. | 1381 // Test that we properly send RTP without SRTP from a thread. |
| 1421 void SendRtpToRtpOnThread() { | 1382 void SendRtpToRtpOnThread() { |
| 1422 CreateChannels(RTCP, RTCP); | 1383 CreateChannels(0, 0); |
| 1423 EXPECT_TRUE(SendInitiate()); | 1384 EXPECT_TRUE(SendInitiate()); |
| 1424 EXPECT_TRUE(SendAccept()); | 1385 EXPECT_TRUE(SendAccept()); |
| 1425 ScopedCallThread send_rtp1([this] { SendRtp1(); }); | 1386 ScopedCallThread send_rtp1([this] { SendRtp1(); }); |
| 1426 ScopedCallThread send_rtp2([this] { SendRtp2(); }); | 1387 ScopedCallThread send_rtp2([this] { SendRtp2(); }); |
| 1427 ScopedCallThread send_rtcp1([this] { SendRtcp1(); }); | 1388 ScopedCallThread send_rtcp1([this] { SendRtcp1(); }); |
| 1428 ScopedCallThread send_rtcp2([this] { SendRtcp2(); }); | 1389 ScopedCallThread send_rtcp2([this] { SendRtcp2(); }); |
| 1429 rtc::Thread* involved_threads[] = {send_rtp1.thread(), send_rtp2.thread(), | 1390 rtc::Thread* involved_threads[] = {send_rtp1.thread(), send_rtp2.thread(), |
| 1430 send_rtcp1.thread(), | 1391 send_rtcp1.thread(), |
| 1431 send_rtcp2.thread()}; | 1392 send_rtcp2.thread()}; |
| 1432 WaitForThreads(involved_threads); | 1393 WaitForThreads(involved_threads); |
| 1433 EXPECT_TRUE(CheckRtp1()); | 1394 EXPECT_TRUE(CheckRtp1()); |
| 1434 EXPECT_TRUE(CheckRtp2()); | 1395 EXPECT_TRUE(CheckRtp2()); |
| 1435 EXPECT_TRUE(CheckNoRtp1()); | 1396 EXPECT_TRUE(CheckNoRtp1()); |
| 1436 EXPECT_TRUE(CheckNoRtp2()); | 1397 EXPECT_TRUE(CheckNoRtp2()); |
| 1437 EXPECT_TRUE(CheckRtcp1()); | 1398 EXPECT_TRUE(CheckRtcp1()); |
| 1438 EXPECT_TRUE(CheckRtcp2()); | 1399 EXPECT_TRUE(CheckRtcp2()); |
| 1439 EXPECT_TRUE(CheckNoRtcp1()); | 1400 EXPECT_TRUE(CheckNoRtcp1()); |
| 1440 EXPECT_TRUE(CheckNoRtcp2()); | 1401 EXPECT_TRUE(CheckNoRtcp2()); |
| 1441 } | 1402 } |
| 1442 | 1403 |
| 1443 // Test that we properly send SRTP with RTCP from a thread. | 1404 // Test that we properly send SRTP with RTCP from a thread. |
| 1444 void SendSrtpToSrtpOnThread() { | 1405 void SendSrtpToSrtpOnThread() { |
| 1445 CreateChannels(RTCP | SECURE, RTCP | SECURE); | 1406 CreateChannels(SECURE, SECURE); |
| 1446 EXPECT_TRUE(SendInitiate()); | 1407 EXPECT_TRUE(SendInitiate()); |
| 1447 EXPECT_TRUE(SendAccept()); | 1408 EXPECT_TRUE(SendAccept()); |
| 1448 ScopedCallThread send_rtp1([this] { SendRtp1(); }); | 1409 ScopedCallThread send_rtp1([this] { SendRtp1(); }); |
| 1449 ScopedCallThread send_rtp2([this] { SendRtp2(); }); | 1410 ScopedCallThread send_rtp2([this] { SendRtp2(); }); |
| 1450 ScopedCallThread send_rtcp1([this] { SendRtcp1(); }); | 1411 ScopedCallThread send_rtcp1([this] { SendRtcp1(); }); |
| 1451 ScopedCallThread send_rtcp2([this] { SendRtcp2(); }); | 1412 ScopedCallThread send_rtcp2([this] { SendRtcp2(); }); |
| 1452 rtc::Thread* involved_threads[] = {send_rtp1.thread(), send_rtp2.thread(), | 1413 rtc::Thread* involved_threads[] = {send_rtp1.thread(), send_rtp2.thread(), |
| 1453 send_rtcp1.thread(), | 1414 send_rtcp1.thread(), |
| 1454 send_rtcp2.thread()}; | 1415 send_rtcp2.thread()}; |
| 1455 WaitForThreads(involved_threads); | 1416 WaitForThreads(involved_threads); |
| 1456 EXPECT_TRUE(CheckRtp1()); | 1417 EXPECT_TRUE(CheckRtp1()); |
| 1457 EXPECT_TRUE(CheckRtp2()); | 1418 EXPECT_TRUE(CheckRtp2()); |
| 1458 EXPECT_TRUE(CheckNoRtp1()); | 1419 EXPECT_TRUE(CheckNoRtp1()); |
| 1459 EXPECT_TRUE(CheckNoRtp2()); | 1420 EXPECT_TRUE(CheckNoRtp2()); |
| 1460 EXPECT_TRUE(CheckRtcp1()); | 1421 EXPECT_TRUE(CheckRtcp1()); |
| 1461 EXPECT_TRUE(CheckRtcp2()); | 1422 EXPECT_TRUE(CheckRtcp2()); |
| 1462 EXPECT_TRUE(CheckNoRtcp1()); | 1423 EXPECT_TRUE(CheckNoRtcp1()); |
| 1463 EXPECT_TRUE(CheckNoRtcp2()); | 1424 EXPECT_TRUE(CheckNoRtcp2()); |
| 1464 } | 1425 } |
| 1465 | 1426 |
| 1466 // Test that the mediachannel retains its sending state after the transport | 1427 // Test that the mediachannel retains its sending state after the transport |
| 1467 // becomes non-writable. | 1428 // becomes non-writable. |
| 1468 void SendWithWritabilityLoss() { | 1429 void SendWithWritabilityLoss() { |
| 1469 CreateChannels(0, 0); | 1430 CreateChannels(RTCP_MUX | RTCP_MUX_REQUIRED, RTCP_MUX | RTCP_MUX_REQUIRED); |
| 1470 EXPECT_TRUE(SendInitiate()); | 1431 EXPECT_TRUE(SendInitiate()); |
| 1471 EXPECT_TRUE(SendAccept()); | 1432 EXPECT_TRUE(SendAccept()); |
| 1472 EXPECT_EQ(1U, GetChannels1().size()); | 1433 EXPECT_EQ(1U, GetChannels1().size()); |
| 1473 EXPECT_EQ(1U, GetChannels2().size()); | 1434 EXPECT_EQ(1U, GetChannels2().size()); |
| 1474 SendRtp1(); | 1435 SendRtp1(); |
| 1475 SendRtp2(); | 1436 SendRtp2(); |
| 1476 WaitForThreads(); | 1437 WaitForThreads(); |
| 1477 EXPECT_TRUE(CheckRtp1()); | 1438 EXPECT_TRUE(CheckRtp1()); |
| 1478 EXPECT_TRUE(CheckRtp2()); | 1439 EXPECT_TRUE(CheckRtp2()); |
| 1479 EXPECT_TRUE(CheckNoRtp1()); | 1440 EXPECT_TRUE(CheckNoRtp1()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 } | 1488 } |
| 1528 | 1489 |
| 1529 void SendBundleToBundle( | 1490 void SendBundleToBundle( |
| 1530 const int* pl_types, int len, bool rtcp_mux, bool secure) { | 1491 const int* pl_types, int len, bool rtcp_mux, bool secure) { |
| 1531 ASSERT_EQ(2, len); | 1492 ASSERT_EQ(2, len); |
| 1532 int sequence_number1_1 = 0, sequence_number2_2 = 0; | 1493 int sequence_number1_1 = 0, sequence_number2_2 = 0; |
| 1533 // Only pl_type1 was added to the bundle filter for both |channel1_| | 1494 // Only pl_type1 was added to the bundle filter for both |channel1_| |
| 1534 // and |channel2_|. | 1495 // and |channel2_|. |
| 1535 int pl_type1 = pl_types[0]; | 1496 int pl_type1 = pl_types[0]; |
| 1536 int pl_type2 = pl_types[1]; | 1497 int pl_type2 = pl_types[1]; |
| 1537 int flags = SSRC_MUX | RTCP; | 1498 int flags = SSRC_MUX; |
| 1538 if (secure) flags |= SECURE; | 1499 if (secure) flags |= SECURE; |
| 1539 uint32_t expected_channels = 2U; | 1500 uint32_t expected_channels = 2U; |
| 1540 if (rtcp_mux) { | 1501 if (rtcp_mux) { |
| 1541 flags |= RTCP_MUX; | 1502 flags |= RTCP_MUX; |
| 1542 expected_channels = 1U; | 1503 expected_channels = 1U; |
| 1543 } | 1504 } |
| 1544 CreateChannels(flags, flags); | 1505 CreateChannels(flags, flags); |
| 1545 EXPECT_TRUE(SendInitiate()); | 1506 EXPECT_TRUE(SendInitiate()); |
| 1546 EXPECT_EQ(2U, GetChannels1().size()); | 1507 EXPECT_EQ(2U, GetChannels1().size()); |
| 1547 EXPECT_EQ(expected_channels, GetChannels2().size()); | 1508 EXPECT_EQ(expected_channels, GetChannels2().size()); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1717 std::unique_ptr<cricket::SessionDescription> sdesc3( | 1678 std::unique_ptr<cricket::SessionDescription> sdesc3( |
| 1718 CreateSessionDescriptionWithStream(3)); | 1679 CreateSessionDescriptionWithStream(3)); |
| 1719 EXPECT_TRUE(channel1_->PushdownRemoteDescription( | 1680 EXPECT_TRUE(channel1_->PushdownRemoteDescription( |
| 1720 sdesc3.get(), cricket::CA_ANSWER, &err)); | 1681 sdesc3.get(), cricket::CA_ANSWER, &err)); |
| 1721 EXPECT_TRUE(media_channel1_->HasSendStream(1)); | 1682 EXPECT_TRUE(media_channel1_->HasSendStream(1)); |
| 1722 EXPECT_FALSE(media_channel1_->HasRecvStream(2)); | 1683 EXPECT_FALSE(media_channel1_->HasRecvStream(2)); |
| 1723 EXPECT_TRUE(media_channel1_->HasRecvStream(3)); | 1684 EXPECT_TRUE(media_channel1_->HasRecvStream(3)); |
| 1724 } | 1685 } |
| 1725 | 1686 |
| 1726 void TestFlushRtcp() { | 1687 void TestFlushRtcp() { |
| 1727 CreateChannels(RTCP, RTCP); | 1688 CreateChannels(0, 0); |
| 1728 EXPECT_TRUE(SendInitiate()); | 1689 EXPECT_TRUE(SendInitiate()); |
| 1729 EXPECT_TRUE(SendAccept()); | 1690 EXPECT_TRUE(SendAccept()); |
| 1730 EXPECT_EQ(2U, GetChannels1().size()); | 1691 EXPECT_EQ(2U, GetChannels1().size()); |
| 1731 EXPECT_EQ(2U, GetChannels2().size()); | 1692 EXPECT_EQ(2U, GetChannels2().size()); |
| 1732 | 1693 |
| 1733 // Send RTCP1 from a different thread. | 1694 // Send RTCP1 from a different thread. |
| 1734 ScopedCallThread send_rtcp([this] { SendRtcp1(); }); | 1695 ScopedCallThread send_rtcp([this] { SendRtcp1(); }); |
| 1735 // The sending message is only posted. channel2_ should be empty. | 1696 // The sending message is only posted. channel2_ should be empty. |
| 1736 EXPECT_TRUE(CheckNoRtcp2()); | 1697 EXPECT_TRUE(CheckNoRtcp2()); |
| 1737 rtc::Thread* wait_for[] = {send_rtcp.thread()}; | 1698 rtc::Thread* wait_for[] = {send_rtcp.thread()}; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 0x00, 0x01}; | 1733 0x00, 0x01}; |
| 1773 | 1734 |
| 1774 // Using fake clock because this tests that SRTP errors are signaled at | 1735 // Using fake clock because this tests that SRTP errors are signaled at |
| 1775 // specific times based on set_signal_silent_time. | 1736 // specific times based on set_signal_silent_time. |
| 1776 rtc::ScopedFakeClock fake_clock; | 1737 rtc::ScopedFakeClock fake_clock; |
| 1777 // Some code uses a time of 0 as a special value, so we must start with | 1738 // Some code uses a time of 0 as a special value, so we must start with |
| 1778 // a non-zero time. | 1739 // a non-zero time. |
| 1779 // TODO(deadbeef): Fix this. | 1740 // TODO(deadbeef): Fix this. |
| 1780 fake_clock.AdvanceTime(rtc::TimeDelta::FromSeconds(1)); | 1741 fake_clock.AdvanceTime(rtc::TimeDelta::FromSeconds(1)); |
| 1781 | 1742 |
| 1782 CreateChannels(RTCP | SECURE, RTCP | SECURE); | 1743 CreateChannels(SECURE, SECURE); |
| 1783 EXPECT_FALSE(channel1_->secure()); | 1744 EXPECT_FALSE(channel1_->secure()); |
| 1784 EXPECT_FALSE(channel2_->secure()); | 1745 EXPECT_FALSE(channel2_->secure()); |
| 1785 EXPECT_TRUE(SendInitiate()); | 1746 EXPECT_TRUE(SendInitiate()); |
| 1786 EXPECT_TRUE(SendAccept()); | 1747 EXPECT_TRUE(SendAccept()); |
| 1787 EXPECT_TRUE(channel1_->secure()); | 1748 EXPECT_TRUE(channel1_->secure()); |
| 1788 EXPECT_TRUE(channel2_->secure()); | 1749 EXPECT_TRUE(channel2_->secure()); |
| 1789 channel2_->srtp_filter()->set_signal_silent_time(250); | 1750 channel2_->srtp_filter()->set_signal_silent_time(250); |
| 1790 channel2_->srtp_filter()->SignalSrtpError.connect( | 1751 channel2_->srtp_filter()->SignalSrtpError.connect( |
| 1791 &error_handler, &SrtpErrorHandler::OnSrtpError); | 1752 &error_handler, &SrtpErrorHandler::OnSrtpError); |
| 1792 | 1753 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 transport_channel, reinterpret_cast<const char*>(kBadPacket), | 1786 transport_channel, reinterpret_cast<const char*>(kBadPacket), |
| 1826 sizeof(kBadPacket), rtc::PacketTime(), 0); | 1787 sizeof(kBadPacket), rtc::PacketTime(), 0); |
| 1827 }); | 1788 }); |
| 1828 EXPECT_EQ(cricket::SrtpFilter::ERROR_FAIL, error_handler.error_); | 1789 EXPECT_EQ(cricket::SrtpFilter::ERROR_FAIL, error_handler.error_); |
| 1829 EXPECT_EQ(cricket::SrtpFilter::UNPROTECT, error_handler.mode_); | 1790 EXPECT_EQ(cricket::SrtpFilter::UNPROTECT, error_handler.mode_); |
| 1830 // Terminate channels before the fake clock is destroyed. | 1791 // Terminate channels before the fake clock is destroyed. |
| 1831 EXPECT_TRUE(SendTerminate()); | 1792 EXPECT_TRUE(SendTerminate()); |
| 1832 } | 1793 } |
| 1833 | 1794 |
| 1834 void TestOnReadyToSend() { | 1795 void TestOnReadyToSend() { |
| 1835 CreateChannels(RTCP, RTCP); | 1796 CreateChannels(0, 0); |
| 1836 TransportChannel* rtp = channel1_->rtp_transport(); | 1797 TransportChannel* rtp = channel1_->rtp_transport(); |
| 1837 TransportChannel* rtcp = channel1_->rtcp_transport(); | 1798 TransportChannel* rtcp = channel1_->rtcp_transport(); |
| 1838 EXPECT_FALSE(media_channel1_->ready_to_send()); | 1799 EXPECT_FALSE(media_channel1_->ready_to_send()); |
| 1839 | 1800 |
| 1840 network_thread_->Invoke<void>(RTC_FROM_HERE, | 1801 network_thread_->Invoke<void>(RTC_FROM_HERE, |
| 1841 [rtp] { rtp->SignalReadyToSend(rtp); }); | 1802 [rtp] { rtp->SignalReadyToSend(rtp); }); |
| 1842 WaitForThreads(); | 1803 WaitForThreads(); |
| 1843 EXPECT_FALSE(media_channel1_->ready_to_send()); | 1804 EXPECT_FALSE(media_channel1_->ready_to_send()); |
| 1844 | 1805 |
| 1845 network_thread_->Invoke<void>(RTC_FROM_HERE, | 1806 network_thread_->Invoke<void>(RTC_FROM_HERE, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1870 EXPECT_FALSE(media_channel1_->ready_to_send()); | 1831 EXPECT_FALSE(media_channel1_->ready_to_send()); |
| 1871 | 1832 |
| 1872 network_thread_->Invoke<void>(RTC_FROM_HERE, [this] { | 1833 network_thread_->Invoke<void>(RTC_FROM_HERE, [this] { |
| 1873 channel1_->SetTransportChannelReadyToSend(true, true); | 1834 channel1_->SetTransportChannelReadyToSend(true, true); |
| 1874 }); | 1835 }); |
| 1875 WaitForThreads(); | 1836 WaitForThreads(); |
| 1876 EXPECT_TRUE(media_channel1_->ready_to_send()); | 1837 EXPECT_TRUE(media_channel1_->ready_to_send()); |
| 1877 } | 1838 } |
| 1878 | 1839 |
| 1879 void TestOnReadyToSendWithRtcpMux() { | 1840 void TestOnReadyToSendWithRtcpMux() { |
| 1880 CreateChannels(RTCP, RTCP); | 1841 CreateChannels(0, 0); |
| 1881 typename T::Content content; | 1842 typename T::Content content; |
| 1882 CreateContent(0, kPcmuCodec, kH264Codec, &content); | 1843 CreateContent(0, kPcmuCodec, kH264Codec, &content); |
| 1883 // Both sides agree on mux. Should no longer be a separate RTCP channel. | 1844 // Both sides agree on mux. Should no longer be a separate RTCP channel. |
| 1884 content.set_rtcp_mux(true); | 1845 content.set_rtcp_mux(true); |
| 1885 EXPECT_TRUE(channel1_->SetLocalContent(&content, CA_OFFER, NULL)); | 1846 EXPECT_TRUE(channel1_->SetLocalContent(&content, CA_OFFER, NULL)); |
| 1886 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); | 1847 EXPECT_TRUE(channel1_->SetRemoteContent(&content, CA_ANSWER, NULL)); |
| 1887 EXPECT_TRUE(channel1_->rtcp_transport() == NULL); | 1848 EXPECT_TRUE(channel1_->rtcp_transport() == NULL); |
| 1888 TransportChannel* rtp = channel1_->rtp_transport(); | 1849 TransportChannel* rtp = channel1_->rtp_transport(); |
| 1889 EXPECT_FALSE(media_channel1_->ready_to_send()); | 1850 EXPECT_FALSE(media_channel1_->ready_to_send()); |
| 1890 // In the case of rtcp mux, the SignalReadyToSend() from rtp channel | 1851 // In the case of rtcp mux, the SignalReadyToSend() from rtp channel |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2053 rtc::Thread* worker_thread, | 2014 rtc::Thread* worker_thread, |
| 2054 rtc::Thread* network_thread, | 2015 rtc::Thread* network_thread, |
| 2055 cricket::MediaEngineInterface* engine, | 2016 cricket::MediaEngineInterface* engine, |
| 2056 cricket::FakeVideoMediaChannel* ch, | 2017 cricket::FakeVideoMediaChannel* ch, |
| 2057 cricket::TransportController* transport_controller, | 2018 cricket::TransportController* transport_controller, |
| 2058 int flags) { | 2019 int flags) { |
| 2059 rtc::Thread* signaling_thread = | 2020 rtc::Thread* signaling_thread = |
| 2060 transport_controller ? transport_controller->signaling_thread() : nullptr; | 2021 transport_controller ? transport_controller->signaling_thread() : nullptr; |
| 2061 cricket::VideoChannel* channel = new cricket::VideoChannel( | 2022 cricket::VideoChannel* channel = new cricket::VideoChannel( |
| 2062 worker_thread, network_thread, signaling_thread, ch, cricket::CN_VIDEO, | 2023 worker_thread, network_thread, signaling_thread, ch, cricket::CN_VIDEO, |
| 2063 (flags & RTCP) != 0, (flags & SECURE) != 0); | 2024 (flags & RTCP_MUX_REQUIRED) != 0, (flags & SECURE) != 0); |
| 2064 rtc::CryptoOptions crypto_options; | 2025 rtc::CryptoOptions crypto_options; |
| 2065 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; | 2026 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; |
| 2066 channel->SetCryptoOptions(crypto_options); | 2027 channel->SetCryptoOptions(crypto_options); |
| 2067 cricket::TransportChannel* rtp_transport = | 2028 cricket::TransportChannel* rtp_transport = |
| 2068 transport_controller->CreateTransportChannel( | 2029 transport_controller->CreateTransportChannel( |
| 2069 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTP); | 2030 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTP); |
| 2070 cricket::TransportChannel* rtcp_transport = nullptr; | 2031 cricket::TransportChannel* rtcp_transport = nullptr; |
| 2071 if (channel->NeedsRtcpTransport()) { | 2032 if (channel->NeedsRtcpTransport()) { |
| 2072 rtcp_transport = transport_controller->CreateTransportChannel( | 2033 rtcp_transport = transport_controller->CreateTransportChannel( |
| 2073 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTCP); | 2034 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTCP); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2221 } | 2182 } |
| 2222 | 2183 |
| 2223 TEST_F(VoiceChannelSingleThreadTest, TestCallTeardownRtcpMux) { | 2184 TEST_F(VoiceChannelSingleThreadTest, TestCallTeardownRtcpMux) { |
| 2224 Base::TestCallTeardownRtcpMux(); | 2185 Base::TestCallTeardownRtcpMux(); |
| 2225 } | 2186 } |
| 2226 | 2187 |
| 2227 TEST_F(VoiceChannelSingleThreadTest, SendRtpToRtp) { | 2188 TEST_F(VoiceChannelSingleThreadTest, SendRtpToRtp) { |
| 2228 Base::SendRtpToRtp(); | 2189 Base::SendRtpToRtp(); |
| 2229 } | 2190 } |
| 2230 | 2191 |
| 2231 TEST_F(VoiceChannelSingleThreadTest, SendNoRtcpToNoRtcp) { | |
| 2232 Base::SendNoRtcpToNoRtcp(); | |
| 2233 } | |
| 2234 | |
| 2235 TEST_F(VoiceChannelSingleThreadTest, SendNoRtcpToRtcp) { | |
| 2236 Base::SendNoRtcpToRtcp(); | |
| 2237 } | |
| 2238 | |
| 2239 TEST_F(VoiceChannelSingleThreadTest, SendRtcpToNoRtcp) { | |
| 2240 Base::SendRtcpToNoRtcp(); | |
| 2241 } | |
| 2242 | |
| 2243 TEST_F(VoiceChannelSingleThreadTest, SendRtcpToRtcp) { | 2192 TEST_F(VoiceChannelSingleThreadTest, SendRtcpToRtcp) { |
| 2244 Base::SendRtcpToRtcp(); | 2193 Base::SendRtcpToRtcp(); |
| 2245 } | 2194 } |
| 2246 | 2195 |
| 2247 TEST_F(VoiceChannelSingleThreadTest, SendRtcpMuxToRtcp) { | 2196 TEST_F(VoiceChannelSingleThreadTest, SendRtcpMuxToRtcp) { |
| 2248 Base::SendRtcpMuxToRtcp(); | 2197 Base::SendRtcpMuxToRtcp(); |
| 2249 } | 2198 } |
| 2250 | 2199 |
| 2251 TEST_F(VoiceChannelSingleThreadTest, SendRtcpMuxToRtcpMux) { | 2200 TEST_F(VoiceChannelSingleThreadTest, SendRtcpMuxToRtcpMux) { |
| 2252 Base::SendRtcpMuxToRtcpMux(); | 2201 Base::SendRtcpMuxToRtcpMux(); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2389 TEST_F(VoiceChannelSingleThreadTest, TestOnReadyToSend) { | 2338 TEST_F(VoiceChannelSingleThreadTest, TestOnReadyToSend) { |
| 2390 Base::TestOnReadyToSend(); | 2339 Base::TestOnReadyToSend(); |
| 2391 } | 2340 } |
| 2392 | 2341 |
| 2393 TEST_F(VoiceChannelSingleThreadTest, TestOnReadyToSendWithRtcpMux) { | 2342 TEST_F(VoiceChannelSingleThreadTest, TestOnReadyToSendWithRtcpMux) { |
| 2394 Base::TestOnReadyToSendWithRtcpMux(); | 2343 Base::TestOnReadyToSendWithRtcpMux(); |
| 2395 } | 2344 } |
| 2396 | 2345 |
| 2397 // Test that we can scale the output volume properly for 1:1 calls. | 2346 // Test that we can scale the output volume properly for 1:1 calls. |
| 2398 TEST_F(VoiceChannelSingleThreadTest, TestScaleVolume1to1Call) { | 2347 TEST_F(VoiceChannelSingleThreadTest, TestScaleVolume1to1Call) { |
| 2399 CreateChannels(RTCP, RTCP); | 2348 CreateChannels(0, 0); |
| 2400 EXPECT_TRUE(SendInitiate()); | 2349 EXPECT_TRUE(SendInitiate()); |
| 2401 EXPECT_TRUE(SendAccept()); | 2350 EXPECT_TRUE(SendAccept()); |
| 2402 double volume; | 2351 double volume; |
| 2403 | 2352 |
| 2404 // Default is (1.0). | 2353 // Default is (1.0). |
| 2405 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); | 2354 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); |
| 2406 EXPECT_DOUBLE_EQ(1.0, volume); | 2355 EXPECT_DOUBLE_EQ(1.0, volume); |
| 2407 // invalid ssrc. | 2356 // invalid ssrc. |
| 2408 EXPECT_FALSE(media_channel1_->GetOutputVolume(3, &volume)); | 2357 EXPECT_FALSE(media_channel1_->GetOutputVolume(3, &volume)); |
| 2409 | 2358 |
| 2410 // Set scale to (1.5). | 2359 // Set scale to (1.5). |
| 2411 EXPECT_TRUE(channel1_->SetOutputVolume(0, 1.5)); | 2360 EXPECT_TRUE(channel1_->SetOutputVolume(0, 1.5)); |
| 2412 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); | 2361 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); |
| 2413 EXPECT_DOUBLE_EQ(1.5, volume); | 2362 EXPECT_DOUBLE_EQ(1.5, volume); |
| 2414 | 2363 |
| 2415 // Set scale to (0). | 2364 // Set scale to (0). |
| 2416 EXPECT_TRUE(channel1_->SetOutputVolume(0, 0.0)); | 2365 EXPECT_TRUE(channel1_->SetOutputVolume(0, 0.0)); |
| 2417 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); | 2366 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); |
| 2418 EXPECT_DOUBLE_EQ(0.0, volume); | 2367 EXPECT_DOUBLE_EQ(0.0, volume); |
| 2419 } | 2368 } |
| 2420 | 2369 |
| 2421 // Test that we can scale the output volume properly for multiway calls. | 2370 // Test that we can scale the output volume properly for multiway calls. |
| 2422 TEST_F(VoiceChannelSingleThreadTest, TestScaleVolumeMultiwayCall) { | 2371 TEST_F(VoiceChannelSingleThreadTest, TestScaleVolumeMultiwayCall) { |
| 2423 CreateChannels(RTCP, RTCP); | 2372 CreateChannels(0, 0); |
| 2424 EXPECT_TRUE(SendInitiate()); | 2373 EXPECT_TRUE(SendInitiate()); |
| 2425 EXPECT_TRUE(SendAccept()); | 2374 EXPECT_TRUE(SendAccept()); |
| 2426 EXPECT_TRUE(AddStream1(1)); | 2375 EXPECT_TRUE(AddStream1(1)); |
| 2427 EXPECT_TRUE(AddStream1(2)); | 2376 EXPECT_TRUE(AddStream1(2)); |
| 2428 | 2377 |
| 2429 double volume; | 2378 double volume; |
| 2430 // Default is (1.0). | 2379 // Default is (1.0). |
| 2431 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); | 2380 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); |
| 2432 EXPECT_DOUBLE_EQ(1.0, volume); | 2381 EXPECT_DOUBLE_EQ(1.0, volume); |
| 2433 EXPECT_TRUE(media_channel1_->GetOutputVolume(1, &volume)); | 2382 EXPECT_TRUE(media_channel1_->GetOutputVolume(1, &volume)); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2566 } | 2515 } |
| 2567 | 2516 |
| 2568 TEST_F(VoiceChannelDoubleThreadTest, TestCallTeardownRtcpMux) { | 2517 TEST_F(VoiceChannelDoubleThreadTest, TestCallTeardownRtcpMux) { |
| 2569 Base::TestCallTeardownRtcpMux(); | 2518 Base::TestCallTeardownRtcpMux(); |
| 2570 } | 2519 } |
| 2571 | 2520 |
| 2572 TEST_F(VoiceChannelDoubleThreadTest, SendRtpToRtp) { | 2521 TEST_F(VoiceChannelDoubleThreadTest, SendRtpToRtp) { |
| 2573 Base::SendRtpToRtp(); | 2522 Base::SendRtpToRtp(); |
| 2574 } | 2523 } |
| 2575 | 2524 |
| 2576 TEST_F(VoiceChannelDoubleThreadTest, SendNoRtcpToNoRtcp) { | |
| 2577 Base::SendNoRtcpToNoRtcp(); | |
| 2578 } | |
| 2579 | |
| 2580 TEST_F(VoiceChannelDoubleThreadTest, SendNoRtcpToRtcp) { | |
| 2581 Base::SendNoRtcpToRtcp(); | |
| 2582 } | |
| 2583 | |
| 2584 TEST_F(VoiceChannelDoubleThreadTest, SendRtcpToNoRtcp) { | |
| 2585 Base::SendRtcpToNoRtcp(); | |
| 2586 } | |
| 2587 | |
| 2588 TEST_F(VoiceChannelDoubleThreadTest, SendRtcpToRtcp) { | 2525 TEST_F(VoiceChannelDoubleThreadTest, SendRtcpToRtcp) { |
| 2589 Base::SendRtcpToRtcp(); | 2526 Base::SendRtcpToRtcp(); |
| 2590 } | 2527 } |
| 2591 | 2528 |
| 2592 TEST_F(VoiceChannelDoubleThreadTest, SendRtcpMuxToRtcp) { | 2529 TEST_F(VoiceChannelDoubleThreadTest, SendRtcpMuxToRtcp) { |
| 2593 Base::SendRtcpMuxToRtcp(); | 2530 Base::SendRtcpMuxToRtcp(); |
| 2594 } | 2531 } |
| 2595 | 2532 |
| 2596 TEST_F(VoiceChannelDoubleThreadTest, SendRtcpMuxToRtcpMux) { | 2533 TEST_F(VoiceChannelDoubleThreadTest, SendRtcpMuxToRtcpMux) { |
| 2597 Base::SendRtcpMuxToRtcpMux(); | 2534 Base::SendRtcpMuxToRtcpMux(); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2734 TEST_F(VoiceChannelDoubleThreadTest, TestOnReadyToSend) { | 2671 TEST_F(VoiceChannelDoubleThreadTest, TestOnReadyToSend) { |
| 2735 Base::TestOnReadyToSend(); | 2672 Base::TestOnReadyToSend(); |
| 2736 } | 2673 } |
| 2737 | 2674 |
| 2738 TEST_F(VoiceChannelDoubleThreadTest, TestOnReadyToSendWithRtcpMux) { | 2675 TEST_F(VoiceChannelDoubleThreadTest, TestOnReadyToSendWithRtcpMux) { |
| 2739 Base::TestOnReadyToSendWithRtcpMux(); | 2676 Base::TestOnReadyToSendWithRtcpMux(); |
| 2740 } | 2677 } |
| 2741 | 2678 |
| 2742 // Test that we can scale the output volume properly for 1:1 calls. | 2679 // Test that we can scale the output volume properly for 1:1 calls. |
| 2743 TEST_F(VoiceChannelDoubleThreadTest, TestScaleVolume1to1Call) { | 2680 TEST_F(VoiceChannelDoubleThreadTest, TestScaleVolume1to1Call) { |
| 2744 CreateChannels(RTCP, RTCP); | 2681 CreateChannels(0, 0); |
| 2745 EXPECT_TRUE(SendInitiate()); | 2682 EXPECT_TRUE(SendInitiate()); |
| 2746 EXPECT_TRUE(SendAccept()); | 2683 EXPECT_TRUE(SendAccept()); |
| 2747 double volume; | 2684 double volume; |
| 2748 | 2685 |
| 2749 // Default is (1.0). | 2686 // Default is (1.0). |
| 2750 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); | 2687 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); |
| 2751 EXPECT_DOUBLE_EQ(1.0, volume); | 2688 EXPECT_DOUBLE_EQ(1.0, volume); |
| 2752 // invalid ssrc. | 2689 // invalid ssrc. |
| 2753 EXPECT_FALSE(media_channel1_->GetOutputVolume(3, &volume)); | 2690 EXPECT_FALSE(media_channel1_->GetOutputVolume(3, &volume)); |
| 2754 | 2691 |
| 2755 // Set scale to (1.5). | 2692 // Set scale to (1.5). |
| 2756 EXPECT_TRUE(channel1_->SetOutputVolume(0, 1.5)); | 2693 EXPECT_TRUE(channel1_->SetOutputVolume(0, 1.5)); |
| 2757 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); | 2694 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); |
| 2758 EXPECT_DOUBLE_EQ(1.5, volume); | 2695 EXPECT_DOUBLE_EQ(1.5, volume); |
| 2759 | 2696 |
| 2760 // Set scale to (0). | 2697 // Set scale to (0). |
| 2761 EXPECT_TRUE(channel1_->SetOutputVolume(0, 0.0)); | 2698 EXPECT_TRUE(channel1_->SetOutputVolume(0, 0.0)); |
| 2762 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); | 2699 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); |
| 2763 EXPECT_DOUBLE_EQ(0.0, volume); | 2700 EXPECT_DOUBLE_EQ(0.0, volume); |
| 2764 } | 2701 } |
| 2765 | 2702 |
| 2766 // Test that we can scale the output volume properly for multiway calls. | 2703 // Test that we can scale the output volume properly for multiway calls. |
| 2767 TEST_F(VoiceChannelDoubleThreadTest, TestScaleVolumeMultiwayCall) { | 2704 TEST_F(VoiceChannelDoubleThreadTest, TestScaleVolumeMultiwayCall) { |
| 2768 CreateChannels(RTCP, RTCP); | 2705 CreateChannels(0, 0); |
| 2769 EXPECT_TRUE(SendInitiate()); | 2706 EXPECT_TRUE(SendInitiate()); |
| 2770 EXPECT_TRUE(SendAccept()); | 2707 EXPECT_TRUE(SendAccept()); |
| 2771 EXPECT_TRUE(AddStream1(1)); | 2708 EXPECT_TRUE(AddStream1(1)); |
| 2772 EXPECT_TRUE(AddStream1(2)); | 2709 EXPECT_TRUE(AddStream1(2)); |
| 2773 | 2710 |
| 2774 double volume; | 2711 double volume; |
| 2775 // Default is (1.0). | 2712 // Default is (1.0). |
| 2776 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); | 2713 EXPECT_TRUE(media_channel1_->GetOutputVolume(0, &volume)); |
| 2777 EXPECT_DOUBLE_EQ(1.0, volume); | 2714 EXPECT_DOUBLE_EQ(1.0, volume); |
| 2778 EXPECT_TRUE(media_channel1_->GetOutputVolume(1, &volume)); | 2715 EXPECT_TRUE(media_channel1_->GetOutputVolume(1, &volume)); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2907 } | 2844 } |
| 2908 | 2845 |
| 2909 TEST_F(VideoChannelSingleThreadTest, TestCallTeardownRtcpMux) { | 2846 TEST_F(VideoChannelSingleThreadTest, TestCallTeardownRtcpMux) { |
| 2910 Base::TestCallTeardownRtcpMux(); | 2847 Base::TestCallTeardownRtcpMux(); |
| 2911 } | 2848 } |
| 2912 | 2849 |
| 2913 TEST_F(VideoChannelSingleThreadTest, SendRtpToRtp) { | 2850 TEST_F(VideoChannelSingleThreadTest, SendRtpToRtp) { |
| 2914 Base::SendRtpToRtp(); | 2851 Base::SendRtpToRtp(); |
| 2915 } | 2852 } |
| 2916 | 2853 |
| 2917 TEST_F(VideoChannelSingleThreadTest, SendNoRtcpToNoRtcp) { | |
| 2918 Base::SendNoRtcpToNoRtcp(); | |
| 2919 } | |
| 2920 | |
| 2921 TEST_F(VideoChannelSingleThreadTest, SendNoRtcpToRtcp) { | |
| 2922 Base::SendNoRtcpToRtcp(); | |
| 2923 } | |
| 2924 | |
| 2925 TEST_F(VideoChannelSingleThreadTest, SendRtcpToNoRtcp) { | |
| 2926 Base::SendRtcpToNoRtcp(); | |
| 2927 } | |
| 2928 | |
| 2929 TEST_F(VideoChannelSingleThreadTest, SendRtcpToRtcp) { | 2854 TEST_F(VideoChannelSingleThreadTest, SendRtcpToRtcp) { |
| 2930 Base::SendRtcpToRtcp(); | 2855 Base::SendRtcpToRtcp(); |
| 2931 } | 2856 } |
| 2932 | 2857 |
| 2933 TEST_F(VideoChannelSingleThreadTest, SendRtcpMuxToRtcp) { | 2858 TEST_F(VideoChannelSingleThreadTest, SendRtcpMuxToRtcp) { |
| 2934 Base::SendRtcpMuxToRtcp(); | 2859 Base::SendRtcpMuxToRtcp(); |
| 2935 } | 2860 } |
| 2936 | 2861 |
| 2937 TEST_F(VideoChannelSingleThreadTest, SendRtcpMuxToRtcpMux) { | 2862 TEST_F(VideoChannelSingleThreadTest, SendRtcpMuxToRtcpMux) { |
| 2938 Base::SendRtcpMuxToRtcpMux(); | 2863 Base::SendRtcpMuxToRtcpMux(); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3151 } | 3076 } |
| 3152 | 3077 |
| 3153 TEST_F(VideoChannelDoubleThreadTest, TestCallTeardownRtcpMux) { | 3078 TEST_F(VideoChannelDoubleThreadTest, TestCallTeardownRtcpMux) { |
| 3154 Base::TestCallTeardownRtcpMux(); | 3079 Base::TestCallTeardownRtcpMux(); |
| 3155 } | 3080 } |
| 3156 | 3081 |
| 3157 TEST_F(VideoChannelDoubleThreadTest, SendRtpToRtp) { | 3082 TEST_F(VideoChannelDoubleThreadTest, SendRtpToRtp) { |
| 3158 Base::SendRtpToRtp(); | 3083 Base::SendRtpToRtp(); |
| 3159 } | 3084 } |
| 3160 | 3085 |
| 3161 TEST_F(VideoChannelDoubleThreadTest, SendNoRtcpToNoRtcp) { | |
| 3162 Base::SendNoRtcpToNoRtcp(); | |
| 3163 } | |
| 3164 | |
| 3165 TEST_F(VideoChannelDoubleThreadTest, SendNoRtcpToRtcp) { | |
| 3166 Base::SendNoRtcpToRtcp(); | |
| 3167 } | |
| 3168 | |
| 3169 TEST_F(VideoChannelDoubleThreadTest, SendRtcpToNoRtcp) { | |
| 3170 Base::SendRtcpToNoRtcp(); | |
| 3171 } | |
| 3172 | |
| 3173 TEST_F(VideoChannelDoubleThreadTest, SendRtcpToRtcp) { | 3086 TEST_F(VideoChannelDoubleThreadTest, SendRtcpToRtcp) { |
| 3174 Base::SendRtcpToRtcp(); | 3087 Base::SendRtcpToRtcp(); |
| 3175 } | 3088 } |
| 3176 | 3089 |
| 3177 TEST_F(VideoChannelDoubleThreadTest, SendRtcpMuxToRtcp) { | 3090 TEST_F(VideoChannelDoubleThreadTest, SendRtcpMuxToRtcp) { |
| 3178 Base::SendRtcpMuxToRtcp(); | 3091 Base::SendRtcpMuxToRtcp(); |
| 3179 } | 3092 } |
| 3180 | 3093 |
| 3181 TEST_F(VideoChannelDoubleThreadTest, SendRtcpMuxToRtcpMux) { | 3094 TEST_F(VideoChannelDoubleThreadTest, SendRtcpMuxToRtcpMux) { |
| 3182 Base::SendRtcpMuxToRtcpMux(); | 3095 Base::SendRtcpMuxToRtcpMux(); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3335 rtc::Thread* worker_thread, | 3248 rtc::Thread* worker_thread, |
| 3336 rtc::Thread* network_thread, | 3249 rtc::Thread* network_thread, |
| 3337 cricket::MediaEngineInterface* engine, | 3250 cricket::MediaEngineInterface* engine, |
| 3338 cricket::FakeDataMediaChannel* ch, | 3251 cricket::FakeDataMediaChannel* ch, |
| 3339 cricket::TransportController* transport_controller, | 3252 cricket::TransportController* transport_controller, |
| 3340 int flags) { | 3253 int flags) { |
| 3341 rtc::Thread* signaling_thread = | 3254 rtc::Thread* signaling_thread = |
| 3342 transport_controller ? transport_controller->signaling_thread() : nullptr; | 3255 transport_controller ? transport_controller->signaling_thread() : nullptr; |
| 3343 cricket::RtpDataChannel* channel = new cricket::RtpDataChannel( | 3256 cricket::RtpDataChannel* channel = new cricket::RtpDataChannel( |
| 3344 worker_thread, network_thread, signaling_thread, ch, cricket::CN_DATA, | 3257 worker_thread, network_thread, signaling_thread, ch, cricket::CN_DATA, |
| 3345 (flags & RTCP) != 0, (flags & SECURE) != 0); | 3258 (flags & RTCP_MUX_REQUIRED) != 0, (flags & SECURE) != 0); |
| 3346 rtc::CryptoOptions crypto_options; | 3259 rtc::CryptoOptions crypto_options; |
| 3347 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; | 3260 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; |
| 3348 channel->SetCryptoOptions(crypto_options); | 3261 channel->SetCryptoOptions(crypto_options); |
| 3349 cricket::TransportChannel* rtp_transport = | 3262 cricket::TransportChannel* rtp_transport = |
| 3350 transport_controller->CreateTransportChannel( | 3263 transport_controller->CreateTransportChannel( |
| 3351 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTP); | 3264 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTP); |
| 3352 cricket::TransportChannel* rtcp_transport = nullptr; | 3265 cricket::TransportChannel* rtcp_transport = nullptr; |
| 3353 if (channel->NeedsRtcpTransport()) { | 3266 if (channel->NeedsRtcpTransport()) { |
| 3354 rtcp_transport = transport_controller->CreateTransportChannel( | 3267 rtcp_transport = transport_controller->CreateTransportChannel( |
| 3355 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTCP); | 3268 channel->content_name(), cricket::ICE_CANDIDATE_COMPONENT_RTCP); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3459 } | 3372 } |
| 3460 | 3373 |
| 3461 TEST_F(RtpDataChannelSingleThreadTest, TestOnReadyToSendWithRtcpMux) { | 3374 TEST_F(RtpDataChannelSingleThreadTest, TestOnReadyToSendWithRtcpMux) { |
| 3462 Base::TestOnReadyToSendWithRtcpMux(); | 3375 Base::TestOnReadyToSendWithRtcpMux(); |
| 3463 } | 3376 } |
| 3464 | 3377 |
| 3465 TEST_F(RtpDataChannelSingleThreadTest, SendRtpToRtp) { | 3378 TEST_F(RtpDataChannelSingleThreadTest, SendRtpToRtp) { |
| 3466 Base::SendRtpToRtp(); | 3379 Base::SendRtpToRtp(); |
| 3467 } | 3380 } |
| 3468 | 3381 |
| 3469 TEST_F(RtpDataChannelSingleThreadTest, SendNoRtcpToNoRtcp) { | |
| 3470 Base::SendNoRtcpToNoRtcp(); | |
| 3471 } | |
| 3472 | |
| 3473 TEST_F(RtpDataChannelSingleThreadTest, SendNoRtcpToRtcp) { | |
| 3474 Base::SendNoRtcpToRtcp(); | |
| 3475 } | |
| 3476 | |
| 3477 TEST_F(RtpDataChannelSingleThreadTest, SendRtcpToNoRtcp) { | |
| 3478 Base::SendRtcpToNoRtcp(); | |
| 3479 } | |
| 3480 | |
| 3481 TEST_F(RtpDataChannelSingleThreadTest, SendRtcpToRtcp) { | 3382 TEST_F(RtpDataChannelSingleThreadTest, SendRtcpToRtcp) { |
| 3482 Base::SendRtcpToRtcp(); | 3383 Base::SendRtcpToRtcp(); |
| 3483 } | 3384 } |
| 3484 | 3385 |
| 3485 TEST_F(RtpDataChannelSingleThreadTest, SendRtcpMuxToRtcp) { | 3386 TEST_F(RtpDataChannelSingleThreadTest, SendRtcpMuxToRtcp) { |
| 3486 Base::SendRtcpMuxToRtcp(); | 3387 Base::SendRtcpMuxToRtcp(); |
| 3487 } | 3388 } |
| 3488 | 3389 |
| 3489 TEST_F(RtpDataChannelSingleThreadTest, SendRtcpMuxToRtcpMux) { | 3390 TEST_F(RtpDataChannelSingleThreadTest, SendRtcpMuxToRtcpMux) { |
| 3490 Base::SendRtcpMuxToRtcpMux(); | 3391 Base::SendRtcpMuxToRtcpMux(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3603 } | 3504 } |
| 3604 | 3505 |
| 3605 TEST_F(RtpDataChannelDoubleThreadTest, TestOnReadyToSendWithRtcpMux) { | 3506 TEST_F(RtpDataChannelDoubleThreadTest, TestOnReadyToSendWithRtcpMux) { |
| 3606 Base::TestOnReadyToSendWithRtcpMux(); | 3507 Base::TestOnReadyToSendWithRtcpMux(); |
| 3607 } | 3508 } |
| 3608 | 3509 |
| 3609 TEST_F(RtpDataChannelDoubleThreadTest, SendRtpToRtp) { | 3510 TEST_F(RtpDataChannelDoubleThreadTest, SendRtpToRtp) { |
| 3610 Base::SendRtpToRtp(); | 3511 Base::SendRtpToRtp(); |
| 3611 } | 3512 } |
| 3612 | 3513 |
| 3613 TEST_F(RtpDataChannelDoubleThreadTest, SendNoRtcpToNoRtcp) { | |
| 3614 Base::SendNoRtcpToNoRtcp(); | |
| 3615 } | |
| 3616 | |
| 3617 TEST_F(RtpDataChannelDoubleThreadTest, SendNoRtcpToRtcp) { | |
| 3618 Base::SendNoRtcpToRtcp(); | |
| 3619 } | |
| 3620 | |
| 3621 TEST_F(RtpDataChannelDoubleThreadTest, SendRtcpToNoRtcp) { | |
| 3622 Base::SendRtcpToNoRtcp(); | |
| 3623 } | |
| 3624 | |
| 3625 TEST_F(RtpDataChannelDoubleThreadTest, SendRtcpToRtcp) { | 3514 TEST_F(RtpDataChannelDoubleThreadTest, SendRtcpToRtcp) { |
| 3626 Base::SendRtcpToRtcp(); | 3515 Base::SendRtcpToRtcp(); |
| 3627 } | 3516 } |
| 3628 | 3517 |
| 3629 TEST_F(RtpDataChannelDoubleThreadTest, SendRtcpMuxToRtcp) { | 3518 TEST_F(RtpDataChannelDoubleThreadTest, SendRtcpMuxToRtcp) { |
| 3630 Base::SendRtcpMuxToRtcp(); | 3519 Base::SendRtcpMuxToRtcp(); |
| 3631 } | 3520 } |
| 3632 | 3521 |
| 3633 TEST_F(RtpDataChannelDoubleThreadTest, SendRtcpMuxToRtcpMux) { | 3522 TEST_F(RtpDataChannelDoubleThreadTest, SendRtcpMuxToRtcpMux) { |
| 3634 Base::SendRtcpMuxToRtcpMux(); | 3523 Base::SendRtcpMuxToRtcpMux(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3682 }; | 3571 }; |
| 3683 rtc::CopyOnWriteBuffer payload(data, 3); | 3572 rtc::CopyOnWriteBuffer payload(data, 3); |
| 3684 cricket::SendDataResult result; | 3573 cricket::SendDataResult result; |
| 3685 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 3574 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
| 3686 EXPECT_EQ(params.ssrc, | 3575 EXPECT_EQ(params.ssrc, |
| 3687 media_channel1_->last_sent_data_params().ssrc); | 3576 media_channel1_->last_sent_data_params().ssrc); |
| 3688 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 3577 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
| 3689 } | 3578 } |
| 3690 | 3579 |
| 3691 // TODO(pthatcher): TestSetReceiver? | 3580 // TODO(pthatcher): TestSetReceiver? |
| OLD | NEW |