| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 public: | 93 public: |
| 94 enum Flags { | 94 enum Flags { |
| 95 RTCP_MUX = 0x1, | 95 RTCP_MUX = 0x1, |
| 96 RTCP_MUX_REQUIRED = 0x2, | 96 RTCP_MUX_REQUIRED = 0x2, |
| 97 SECURE = 0x4, | 97 SECURE = 0x4, |
| 98 SSRC_MUX = 0x8, | 98 SSRC_MUX = 0x8, |
| 99 DTLS = 0x10, | 99 DTLS = 0x10, |
| 100 // Use BaseChannel with PacketTransportInternal rather than | 100 // Use BaseChannel with PacketTransportInternal rather than |
| 101 // DtlsTransportInternal. | 101 // DtlsTransportInternal. |
| 102 RAW_PACKET_TRANSPORT = 0x20, | 102 RAW_PACKET_TRANSPORT = 0x20, |
| 103 GCM_CIPHER = 0x40, |
| 104 ENCRYPTED_HEADERS = 0x80, |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 ChannelTest(bool verify_playout, | 107 ChannelTest(bool verify_playout, |
| 106 rtc::ArrayView<const uint8_t> rtp_data, | 108 rtc::ArrayView<const uint8_t> rtp_data, |
| 107 rtc::ArrayView<const uint8_t> rtcp_data, | 109 rtc::ArrayView<const uint8_t> rtcp_data, |
| 108 NetworkIsWorker network_is_worker) | 110 NetworkIsWorker network_is_worker) |
| 109 : verify_playout_(verify_playout), | 111 : verify_playout_(verify_playout), |
| 110 rtp_packet_(rtp_data.data(), rtp_data.size()), | 112 rtp_packet_(rtp_data.data(), rtp_data.size()), |
| 111 rtcp_packet_(rtcp_data.data(), rtcp_data.size()) { | 113 rtcp_packet_(rtcp_data.data(), rtcp_data.size()) { |
| 112 if (network_is_worker == NetworkIsWorker::Yes) { | 114 if (network_is_worker == NetworkIsWorker::Yes) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 170 } |
| 169 if (flags1 & DTLS) { | 171 if (flags1 & DTLS) { |
| 170 auto cert1 = | 172 auto cert1 = |
| 171 rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>( | 173 rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>( |
| 172 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT))); | 174 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT))); |
| 173 fake_rtp_dtls_transport1_->SetLocalCertificate(cert1); | 175 fake_rtp_dtls_transport1_->SetLocalCertificate(cert1); |
| 174 if (fake_rtcp_dtls_transport1_) { | 176 if (fake_rtcp_dtls_transport1_) { |
| 175 fake_rtcp_dtls_transport1_->SetLocalCertificate(cert1); | 177 fake_rtcp_dtls_transport1_->SetLocalCertificate(cert1); |
| 176 } | 178 } |
| 177 } | 179 } |
| 180 if (flags1 & ENCRYPTED_HEADERS) { |
| 181 rtc::CryptoOptions crypto_options; |
| 182 crypto_options.enable_encrypted_rtp_header_extensions = true; |
| 183 fake_rtp_dtls_transport1_->SetCryptoOptions(crypto_options); |
| 184 if (fake_rtcp_dtls_transport1_) { |
| 185 fake_rtcp_dtls_transport1_->SetCryptoOptions(crypto_options); |
| 186 } |
| 187 } |
| 188 if (flags1 & GCM_CIPHER) { |
| 189 fake_rtp_dtls_transport1_->SetSrtpCryptoSuite( |
| 190 rtc::SRTP_AEAD_AES_256_GCM); |
| 191 if (fake_rtcp_dtls_transport1_) { |
| 192 fake_rtcp_dtls_transport1_->SetSrtpCryptoSuite( |
| 193 rtc::SRTP_AEAD_AES_256_GCM); |
| 194 } |
| 195 } |
| 178 } | 196 } |
| 179 // Based on flags, create fake DTLS or raw packet transports. | 197 // Based on flags, create fake DTLS or raw packet transports. |
| 180 if (flags2 & RAW_PACKET_TRANSPORT) { | 198 if (flags2 & RAW_PACKET_TRANSPORT) { |
| 181 fake_rtp_packet_transport2_.reset( | 199 fake_rtp_packet_transport2_.reset( |
| 182 new rtc::FakePacketTransport("channel2_rtp")); | 200 new rtc::FakePacketTransport("channel2_rtp")); |
| 183 rtp2 = fake_rtp_packet_transport2_.get(); | 201 rtp2 = fake_rtp_packet_transport2_.get(); |
| 184 if (!(flags2 & RTCP_MUX_REQUIRED)) { | 202 if (!(flags2 & RTCP_MUX_REQUIRED)) { |
| 185 fake_rtcp_packet_transport2_.reset( | 203 fake_rtcp_packet_transport2_.reset( |
| 186 new rtc::FakePacketTransport("channel2_rtcp")); | 204 new rtc::FakePacketTransport("channel2_rtcp")); |
| 187 rtcp2 = fake_rtcp_packet_transport2_.get(); | 205 rtcp2 = fake_rtcp_packet_transport2_.get(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 198 } | 216 } |
| 199 if (flags2 & DTLS) { | 217 if (flags2 & DTLS) { |
| 200 auto cert2 = | 218 auto cert2 = |
| 201 rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>( | 219 rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>( |
| 202 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT))); | 220 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT))); |
| 203 fake_rtp_dtls_transport2_->SetLocalCertificate(cert2); | 221 fake_rtp_dtls_transport2_->SetLocalCertificate(cert2); |
| 204 if (fake_rtcp_dtls_transport2_) { | 222 if (fake_rtcp_dtls_transport2_) { |
| 205 fake_rtcp_dtls_transport2_->SetLocalCertificate(cert2); | 223 fake_rtcp_dtls_transport2_->SetLocalCertificate(cert2); |
| 206 } | 224 } |
| 207 } | 225 } |
| 226 if (flags2 & ENCRYPTED_HEADERS) { |
| 227 rtc::CryptoOptions crypto_options; |
| 228 crypto_options.enable_encrypted_rtp_header_extensions = true; |
| 229 fake_rtp_dtls_transport2_->SetCryptoOptions(crypto_options); |
| 230 if (fake_rtcp_dtls_transport2_) { |
| 231 fake_rtcp_dtls_transport2_->SetCryptoOptions(crypto_options); |
| 232 } |
| 233 } |
| 234 if (flags2 & GCM_CIPHER) { |
| 235 fake_rtp_dtls_transport2_->SetSrtpCryptoSuite( |
| 236 rtc::SRTP_AEAD_AES_256_GCM); |
| 237 if (fake_rtcp_dtls_transport2_) { |
| 238 fake_rtcp_dtls_transport2_->SetSrtpCryptoSuite( |
| 239 rtc::SRTP_AEAD_AES_256_GCM); |
| 240 } |
| 241 } |
| 208 } | 242 } |
| 209 channel1_.reset( | 243 channel1_.reset( |
| 210 CreateChannel(worker_thread, network_thread_, &media_engine_, ch1, | 244 CreateChannel(worker_thread, network_thread_, &media_engine_, ch1, |
| 211 fake_rtp_dtls_transport1_.get(), | 245 fake_rtp_dtls_transport1_.get(), |
| 212 fake_rtcp_dtls_transport1_.get(), rtp1, rtcp1, flags1)); | 246 fake_rtcp_dtls_transport1_.get(), rtp1, rtcp1, flags1)); |
| 213 channel2_.reset( | 247 channel2_.reset( |
| 214 CreateChannel(worker_thread, network_thread_, &media_engine_, ch2, | 248 CreateChannel(worker_thread, network_thread_, &media_engine_, ch2, |
| 215 fake_rtp_dtls_transport2_.get(), | 249 fake_rtp_dtls_transport2_.get(), |
| 216 fake_rtcp_dtls_transport2_.get(), rtp2, rtcp2, flags2)); | 250 fake_rtcp_dtls_transport2_.get(), rtp2, rtcp2, flags2)); |
| 217 channel1_->SignalMediaMonitor.connect(this, | 251 channel1_->SignalMediaMonitor.connect(this, |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 EXPECT_TRUE(channel2_->SetRemoteContent(&content4, CA_ANSWER, NULL)); | 896 EXPECT_TRUE(channel2_->SetRemoteContent(&content4, CA_ANSWER, NULL)); |
| 863 EXPECT_EQ(0u, media_channel2_->recv_streams().size()); | 897 EXPECT_EQ(0u, media_channel2_->recv_streams().size()); |
| 864 | 898 |
| 865 EXPECT_TRUE(channel1_->secure()); | 899 EXPECT_TRUE(channel1_->secure()); |
| 866 EXPECT_TRUE(channel2_->secure()); | 900 EXPECT_TRUE(channel2_->secure()); |
| 867 SendCustomRtp2(kSsrc2, 0); | 901 SendCustomRtp2(kSsrc2, 0); |
| 868 WaitForThreads(); | 902 WaitForThreads(); |
| 869 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); | 903 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); |
| 870 } | 904 } |
| 871 | 905 |
| 906 enum EncryptedHeaderTestScenario { |
| 907 // Offer/Answer are processed before DTLS completes. |
| 908 DEFAULT, |
| 909 // DTLS completes before any Offer/Answer have been sent. |
| 910 DTLS_BEFORE_OFFER_ANSWER, |
| 911 // DTLS completes after channel 2 has processed (remote) Offer and (local) |
| 912 // Answer. |
| 913 DTLS_AFTER_CHANNEL2_READY, |
| 914 }; |
| 915 |
| 916 // Test that encrypted header extensions are working and can be changed when |
| 917 // sending a new OFFER/ANSWER. |
| 918 void TestChangeEncryptedHeaderExtensions(int flags, |
| 919 EncryptedHeaderTestScenario scenario = DEFAULT) { |
| 920 RTC_CHECK(scenario == 0 || (flags & DTLS)); |
| 921 struct PacketListener : public sigslot::has_slots<> { |
| 922 PacketListener() {} |
| 923 void OnReadPacket(rtc::PacketTransportInternal* transport, |
| 924 const char* data, size_t size, const rtc::PacketTime& time, |
| 925 int flags) { |
| 926 CompareHeaderExtensions( |
| 927 reinterpret_cast<const char*>(kPcmuFrameWithExtensions), |
| 928 sizeof(kPcmuFrameWithExtensions), data, size, encrypted_headers, |
| 929 false); |
| 930 } |
| 931 std::vector<int> encrypted_headers; |
| 932 } packet_listener1, packet_listener2; |
| 933 |
| 934 cricket::StreamParams stream1; |
| 935 stream1.groupid = "group1"; |
| 936 stream1.id = "stream1"; |
| 937 stream1.ssrcs.push_back(kSsrc1); |
| 938 stream1.cname = "stream1_cname"; |
| 939 |
| 940 cricket::StreamParams stream2; |
| 941 stream2.groupid = "group1"; |
| 942 stream2.id = "stream2"; |
| 943 stream2.ssrcs.push_back(kSsrc2); |
| 944 stream2.cname = "stream2_cname"; |
| 945 |
| 946 // Use SRTP when testing encrypted extensions. |
| 947 int channel_flags = flags | SECURE | ENCRYPTED_HEADERS; |
| 948 // Enable SDES if channel is not using DTLS. |
| 949 int content_flags = (channel_flags & DTLS) == 0 ? SECURE : 0; |
| 950 |
| 951 // kPcmuFrameWithExtensions contains RTP extension headers with ids 1-4. |
| 952 // Make sure to use URIs that are supported for encryption. |
| 953 cricket::RtpHeaderExtensions extensions1; |
| 954 extensions1.push_back( |
| 955 RtpExtension(RtpExtension::kAudioLevelUri, 10)); |
| 956 extensions1.push_back( |
| 957 RtpExtension(RtpExtension::kAudioLevelUri, 1, true)); |
| 958 |
| 959 cricket::RtpHeaderExtensions extensions2; |
| 960 extensions2.push_back( |
| 961 RtpExtension(RtpExtension::kAudioLevelUri, 10)); |
| 962 extensions2.push_back( |
| 963 RtpExtension(RtpExtension::kAudioLevelUri, 2, true)); |
| 964 extensions2.push_back( |
| 965 RtpExtension(RtpExtension::kVideoRotationUri, 3)); |
| 966 extensions2.push_back( |
| 967 RtpExtension(RtpExtension::kTimestampOffsetUri, 4, true)); |
| 968 |
| 969 // Setup a call where channel 1 send |stream1| to channel 2. |
| 970 CreateChannels(channel_flags, channel_flags); |
| 971 fake_rtp_dtls_transport1_->fake_ice_transport()->SignalReadPacket.connect( |
| 972 &packet_listener1, &PacketListener::OnReadPacket); |
| 973 fake_rtp_dtls_transport2_->fake_ice_transport()->SignalReadPacket.connect( |
| 974 &packet_listener2, &PacketListener::OnReadPacket); |
| 975 |
| 976 if (scenario == DTLS_BEFORE_OFFER_ANSWER) { |
| 977 ConnectFakeTransports(); |
| 978 WaitForThreads(); |
| 979 } |
| 980 |
| 981 typename T::Content content1; |
| 982 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content1); |
| 983 content1.AddStream(stream1); |
| 984 content1.set_rtp_header_extensions(extensions1); |
| 985 EXPECT_TRUE(channel1_->SetLocalContent(&content1, CA_OFFER, NULL)); |
| 986 EXPECT_TRUE(channel1_->Enable(true)); |
| 987 EXPECT_EQ(1u, media_channel1_->send_streams().size()); |
| 988 packet_listener1.encrypted_headers.push_back(1); |
| 989 |
| 990 EXPECT_TRUE(channel2_->SetRemoteContent(&content1, CA_OFFER, NULL)); |
| 991 EXPECT_EQ(1u, media_channel2_->recv_streams().size()); |
| 992 |
| 993 // Channel 2 sends back |stream2|. |
| 994 typename T::Content content2; |
| 995 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content2); |
| 996 content2.AddStream(stream2); |
| 997 content2.set_rtp_header_extensions(extensions1); |
| 998 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_ANSWER, NULL)); |
| 999 EXPECT_TRUE(channel2_->Enable(true)); |
| 1000 EXPECT_EQ(1u, media_channel2_->send_streams().size()); |
| 1001 packet_listener2.encrypted_headers.push_back(1); |
| 1002 |
| 1003 if (scenario == DTLS_AFTER_CHANNEL2_READY) { |
| 1004 ConnectFakeTransports(); |
| 1005 WaitForThreads(); |
| 1006 } |
| 1007 |
| 1008 if (scenario == DTLS_BEFORE_OFFER_ANSWER || |
| 1009 scenario == DTLS_AFTER_CHANNEL2_READY) { |
| 1010 // In both scenarios with partially completed Offer/Answer, sending |
| 1011 // packets from Channel 2 to Channel 1 should work. |
| 1012 SendCustomRtp2(kSsrc2, 0); |
| 1013 WaitForThreads(); |
| 1014 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); |
| 1015 } |
| 1016 |
| 1017 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_ANSWER, NULL)); |
| 1018 EXPECT_EQ(1u, media_channel1_->recv_streams().size()); |
| 1019 |
| 1020 if (scenario == DEFAULT) { |
| 1021 ConnectFakeTransports(); |
| 1022 WaitForThreads(); |
| 1023 } |
| 1024 |
| 1025 SendCustomRtp1(kSsrc1, 0); |
| 1026 SendCustomRtp2(kSsrc2, 0); |
| 1027 WaitForThreads(); |
| 1028 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0)); |
| 1029 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); |
| 1030 |
| 1031 // Let channel 2 update the encrypted header extensions. |
| 1032 typename T::Content content3; |
| 1033 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content3); |
| 1034 content3.AddStream(stream2); |
| 1035 content3.set_rtp_header_extensions(extensions2); |
| 1036 EXPECT_TRUE(channel2_->SetLocalContent(&content3, CA_OFFER, NULL)); |
| 1037 ASSERT_EQ(1u, media_channel2_->send_streams().size()); |
| 1038 EXPECT_EQ(stream2, media_channel2_->send_streams()[0]); |
| 1039 packet_listener2.encrypted_headers.clear(); |
| 1040 packet_listener2.encrypted_headers.push_back(2); |
| 1041 packet_listener2.encrypted_headers.push_back(4); |
| 1042 |
| 1043 EXPECT_TRUE(channel1_->SetRemoteContent(&content3, CA_OFFER, NULL)); |
| 1044 ASSERT_EQ(1u, media_channel1_->recv_streams().size()); |
| 1045 EXPECT_EQ(stream2, media_channel1_->recv_streams()[0]); |
| 1046 |
| 1047 // Channel 1 is already sending the new encrypted extensions. These |
| 1048 // can be decrypted by channel 2. Channel 2 is still sending the old |
| 1049 // encrypted extensions (which can be decrypted by channel 1). |
| 1050 |
| 1051 if (flags & DTLS) { |
| 1052 // DTLS supports updating the encrypted extensions with only the OFFER |
| 1053 // being processed. For SDES both the OFFER and ANSWER must have been |
| 1054 // processed to update encrypted extensions, so we can't check this case. |
| 1055 SendCustomRtp1(kSsrc1, 0); |
| 1056 SendCustomRtp2(kSsrc2, 0); |
| 1057 WaitForThreads(); |
| 1058 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0)); |
| 1059 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); |
| 1060 } |
| 1061 |
| 1062 // Channel 1 replies with the same extensions. |
| 1063 typename T::Content content4; |
| 1064 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content4); |
| 1065 content4.AddStream(stream1); |
| 1066 content4.set_rtp_header_extensions(extensions2); |
| 1067 EXPECT_TRUE(channel1_->SetLocalContent(&content4, CA_ANSWER, NULL)); |
| 1068 EXPECT_EQ(1u, media_channel1_->send_streams().size()); |
| 1069 packet_listener1.encrypted_headers.clear(); |
| 1070 packet_listener1.encrypted_headers.push_back(2); |
| 1071 packet_listener1.encrypted_headers.push_back(4); |
| 1072 |
| 1073 EXPECT_TRUE(channel2_->SetRemoteContent(&content4, CA_ANSWER, NULL)); |
| 1074 EXPECT_EQ(1u, media_channel2_->recv_streams().size()); |
| 1075 |
| 1076 SendCustomRtp1(kSsrc1, 0); |
| 1077 SendCustomRtp2(kSsrc2, 0); |
| 1078 WaitForThreads(); |
| 1079 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0)); |
| 1080 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); |
| 1081 } |
| 1082 |
| 872 // Test that we only start playout and sending at the right times. | 1083 // Test that we only start playout and sending at the right times. |
| 873 void TestPlayoutAndSendingStates() { | 1084 void TestPlayoutAndSendingStates() { |
| 874 CreateChannels(0, 0); | 1085 CreateChannels(0, 0); |
| 875 if (verify_playout_) { | 1086 if (verify_playout_) { |
| 876 EXPECT_FALSE(media_channel1_->playout()); | 1087 EXPECT_FALSE(media_channel1_->playout()); |
| 877 } | 1088 } |
| 878 EXPECT_FALSE(media_channel1_->sending()); | 1089 EXPECT_FALSE(media_channel1_->sending()); |
| 879 if (verify_playout_) { | 1090 if (verify_playout_) { |
| 880 EXPECT_FALSE(media_channel2_->playout()); | 1091 EXPECT_FALSE(media_channel2_->playout()); |
| 881 } | 1092 } |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1948 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::Yes) {} | 2159 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::Yes) {} |
| 1949 }; | 2160 }; |
| 1950 | 2161 |
| 1951 class VoiceChannelDoubleThreadTest : public ChannelTest<VoiceTraits> { | 2162 class VoiceChannelDoubleThreadTest : public ChannelTest<VoiceTraits> { |
| 1952 public: | 2163 public: |
| 1953 typedef ChannelTest<VoiceTraits> Base; | 2164 typedef ChannelTest<VoiceTraits> Base; |
| 1954 VoiceChannelDoubleThreadTest() | 2165 VoiceChannelDoubleThreadTest() |
| 1955 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::No) {} | 2166 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::No) {} |
| 1956 }; | 2167 }; |
| 1957 | 2168 |
| 2169 class VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest |
| 2170 : public ChannelTest<VoiceTraits> { |
| 2171 public: |
| 2172 typedef ChannelTest<VoiceTraits> Base; |
| 2173 VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest() |
| 2174 : Base(true, kPcmuFrameWithExtensions, kRtcpReport, |
| 2175 NetworkIsWorker::Yes) {} |
| 2176 }; |
| 2177 |
| 2178 class VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest |
| 2179 : public ChannelTest<VoiceTraits> { |
| 2180 public: |
| 2181 typedef ChannelTest<VoiceTraits> Base; |
| 2182 VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest() |
| 2183 : Base(true, kPcmuFrameWithExtensions, kRtcpReport, |
| 2184 NetworkIsWorker::No) {} |
| 2185 }; |
| 2186 |
| 1958 // override to add NULL parameter | 2187 // override to add NULL parameter |
| 1959 template <> | 2188 template <> |
| 1960 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( | 2189 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( |
| 1961 rtc::Thread* worker_thread, | 2190 rtc::Thread* worker_thread, |
| 1962 rtc::Thread* network_thread, | 2191 rtc::Thread* network_thread, |
| 1963 cricket::MediaEngineInterface* engine, | 2192 cricket::MediaEngineInterface* engine, |
| 1964 cricket::FakeVideoMediaChannel* ch, | 2193 cricket::FakeVideoMediaChannel* ch, |
| 1965 cricket::DtlsTransportInternal* fake_rtp_dtls_transport, | 2194 cricket::DtlsTransportInternal* fake_rtp_dtls_transport, |
| 1966 cricket::DtlsTransportInternal* fake_rtcp_dtls_transport, | 2195 cricket::DtlsTransportInternal* fake_rtcp_dtls_transport, |
| 1967 rtc::PacketTransportInternal* fake_rtp_packet_transport, | 2196 rtc::PacketTransportInternal* fake_rtp_packet_transport, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 } | 2313 } |
| 2085 | 2314 |
| 2086 TEST_F(VoiceChannelSingleThreadTest, TestUpdateRemoteStreamsInContent) { | 2315 TEST_F(VoiceChannelSingleThreadTest, TestUpdateRemoteStreamsInContent) { |
| 2087 Base::TestUpdateStreamsInRemoteContent(); | 2316 Base::TestUpdateStreamsInRemoteContent(); |
| 2088 } | 2317 } |
| 2089 | 2318 |
| 2090 TEST_F(VoiceChannelSingleThreadTest, TestChangeStreamParamsInContent) { | 2319 TEST_F(VoiceChannelSingleThreadTest, TestChangeStreamParamsInContent) { |
| 2091 Base::TestChangeStreamParamsInContent(); | 2320 Base::TestChangeStreamParamsInContent(); |
| 2092 } | 2321 } |
| 2093 | 2322 |
| 2323 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, |
| 2324 TestChangeEncryptedHeaderExtensionsDtls) { |
| 2325 int flags = DTLS; |
| 2326 Base::TestChangeEncryptedHeaderExtensions(flags); |
| 2327 } |
| 2328 |
| 2329 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, |
| 2330 TestChangeEncryptedHeaderExtensionsDtlsScenario1) { |
| 2331 int flags = DTLS; |
| 2332 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_BEFORE_OFFER_ANSWER); |
| 2333 } |
| 2334 |
| 2335 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, |
| 2336 TestChangeEncryptedHeaderExtensionsDtlsScenario2) { |
| 2337 int flags = DTLS; |
| 2338 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_AFTER_CHANNEL2_READY); |
| 2339 } |
| 2340 |
| 2341 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, |
| 2342 TestChangeEncryptedHeaderExtensionsDtlsGcm) { |
| 2343 int flags = DTLS | GCM_CIPHER; |
| 2344 Base::TestChangeEncryptedHeaderExtensions(flags); |
| 2345 } |
| 2346 |
| 2347 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, |
| 2348 TestChangeEncryptedHeaderExtensionsDtlsGcmScenario1) { |
| 2349 int flags = DTLS | GCM_CIPHER; |
| 2350 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_BEFORE_OFFER_ANSWER); |
| 2351 } |
| 2352 |
| 2353 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, |
| 2354 TestChangeEncryptedHeaderExtensionsDtlsGcmScenario2) { |
| 2355 int flags = DTLS | GCM_CIPHER; |
| 2356 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_AFTER_CHANNEL2_READY); |
| 2357 } |
| 2358 |
| 2359 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, |
| 2360 TestChangeEncryptedHeaderExtensionsSDES) { |
| 2361 int flags = 0; |
| 2362 Base::TestChangeEncryptedHeaderExtensions(flags); |
| 2363 } |
| 2364 |
| 2094 TEST_F(VoiceChannelSingleThreadTest, TestPlayoutAndSendingStates) { | 2365 TEST_F(VoiceChannelSingleThreadTest, TestPlayoutAndSendingStates) { |
| 2095 Base::TestPlayoutAndSendingStates(); | 2366 Base::TestPlayoutAndSendingStates(); |
| 2096 } | 2367 } |
| 2097 | 2368 |
| 2098 TEST_F(VoiceChannelSingleThreadTest, TestMuteStream) { | 2369 TEST_F(VoiceChannelSingleThreadTest, TestMuteStream) { |
| 2099 CreateChannels(0, 0); | 2370 CreateChannels(0, 0); |
| 2100 // Test that we can Mute the default channel even though the sending SSRC | 2371 // Test that we can Mute the default channel even though the sending SSRC |
| 2101 // is unknown. | 2372 // is unknown. |
| 2102 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); | 2373 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); |
| 2103 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); | 2374 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2401 } | 2672 } |
| 2402 | 2673 |
| 2403 TEST_F(VoiceChannelDoubleThreadTest, TestUpdateRemoteStreamsInContent) { | 2674 TEST_F(VoiceChannelDoubleThreadTest, TestUpdateRemoteStreamsInContent) { |
| 2404 Base::TestUpdateStreamsInRemoteContent(); | 2675 Base::TestUpdateStreamsInRemoteContent(); |
| 2405 } | 2676 } |
| 2406 | 2677 |
| 2407 TEST_F(VoiceChannelDoubleThreadTest, TestChangeStreamParamsInContent) { | 2678 TEST_F(VoiceChannelDoubleThreadTest, TestChangeStreamParamsInContent) { |
| 2408 Base::TestChangeStreamParamsInContent(); | 2679 Base::TestChangeStreamParamsInContent(); |
| 2409 } | 2680 } |
| 2410 | 2681 |
| 2682 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, |
| 2683 TestChangeEncryptedHeaderExtensionsDtls) { |
| 2684 int flags = DTLS; |
| 2685 Base::TestChangeEncryptedHeaderExtensions(flags); |
| 2686 } |
| 2687 |
| 2688 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, |
| 2689 TestChangeEncryptedHeaderExtensionsDtlsScenario1) { |
| 2690 int flags = DTLS; |
| 2691 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_BEFORE_OFFER_ANSWER); |
| 2692 } |
| 2693 |
| 2694 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, |
| 2695 TestChangeEncryptedHeaderExtensionsDtlsScenario2) { |
| 2696 int flags = DTLS; |
| 2697 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_AFTER_CHANNEL2_READY); |
| 2698 } |
| 2699 |
| 2700 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, |
| 2701 TestChangeEncryptedHeaderExtensionsDtlsGcm) { |
| 2702 int flags = DTLS | GCM_CIPHER; |
| 2703 Base::TestChangeEncryptedHeaderExtensions(flags); |
| 2704 } |
| 2705 |
| 2706 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, |
| 2707 TestChangeEncryptedHeaderExtensionsDtlsGcmScenario1) { |
| 2708 int flags = DTLS | GCM_CIPHER; |
| 2709 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_BEFORE_OFFER_ANSWER); |
| 2710 } |
| 2711 |
| 2712 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, |
| 2713 TestChangeEncryptedHeaderExtensionsDtlsGcmScenario2) { |
| 2714 int flags = DTLS | GCM_CIPHER; |
| 2715 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_AFTER_CHANNEL2_READY); |
| 2716 } |
| 2717 |
| 2718 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, |
| 2719 TestChangeEncryptedHeaderExtensionsSDES) { |
| 2720 int flags = 0; |
| 2721 Base::TestChangeEncryptedHeaderExtensions(flags); |
| 2722 } |
| 2723 |
| 2411 TEST_F(VoiceChannelDoubleThreadTest, TestPlayoutAndSendingStates) { | 2724 TEST_F(VoiceChannelDoubleThreadTest, TestPlayoutAndSendingStates) { |
| 2412 Base::TestPlayoutAndSendingStates(); | 2725 Base::TestPlayoutAndSendingStates(); |
| 2413 } | 2726 } |
| 2414 | 2727 |
| 2415 TEST_F(VoiceChannelDoubleThreadTest, TestMuteStream) { | 2728 TEST_F(VoiceChannelDoubleThreadTest, TestMuteStream) { |
| 2416 CreateChannels(0, 0); | 2729 CreateChannels(0, 0); |
| 2417 // Test that we can Mute the default channel even though the sending SSRC | 2730 // Test that we can Mute the default channel even though the sending SSRC |
| 2418 // is unknown. | 2731 // is unknown. |
| 2419 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); | 2732 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); |
| 2420 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); | 2733 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3586 ASSERT_TRUE(voice_channel_.Init_w(nullptr, nullptr, &fake_rtp_dtls_transport_, | 3899 ASSERT_TRUE(voice_channel_.Init_w(nullptr, nullptr, &fake_rtp_dtls_transport_, |
| 3587 &fake_rtcp_dtls_transport_)); | 3900 &fake_rtcp_dtls_transport_)); |
| 3588 EXPECT_DEATH(voice_channel_.SetTransports(&fake_rtp_dtls_transport_, | 3901 EXPECT_DEATH(voice_channel_.SetTransports(&fake_rtp_dtls_transport_, |
| 3589 &fake_rtp_dtls_transport_), | 3902 &fake_rtp_dtls_transport_), |
| 3590 ""); | 3903 ""); |
| 3591 } | 3904 } |
| 3592 | 3905 |
| 3593 #endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) | 3906 #endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) |
| 3594 | 3907 |
| 3595 // TODO(pthatcher): TestSetReceiver? | 3908 // TODO(pthatcher): TestSetReceiver? |
| OLD | NEW |