Chromium Code Reviews| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 GCM_CIPHER = 0x20, | 100 GCM_CIPHER = 0x20, |
| 101 // Use BaseChannel with PacketTransportInternal rather than | 101 // Use BaseChannel with PacketTransportInternal rather than |
| 102 // DtlsTransportInternal. | 102 // DtlsTransportInternal. |
| 103 RAW_PACKET_TRANSPORT = 0x40, | 103 RAW_PACKET_TRANSPORT = 0x40, |
| 104 ENCRYPTED_HEADERS = 0x80, | |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 ChannelTest(bool verify_playout, | 107 ChannelTest(bool verify_playout, |
| 107 rtc::ArrayView<const uint8_t> rtp_data, | 108 rtc::ArrayView<const uint8_t> rtp_data, |
| 108 rtc::ArrayView<const uint8_t> rtcp_data, | 109 rtc::ArrayView<const uint8_t> rtcp_data, |
| 109 NetworkIsWorker network_is_worker) | 110 NetworkIsWorker network_is_worker) |
| 110 : verify_playout_(verify_playout), | 111 : verify_playout_(verify_playout), |
| 111 rtp_packet_(rtp_data.data(), rtp_data.size()), | 112 rtp_packet_(rtp_data.data(), rtp_data.size()), |
| 112 rtcp_packet_(rtcp_data.data(), rtcp_data.size()) { | 113 rtcp_packet_(rtcp_data.data(), rtcp_data.size()) { |
| 113 if (network_is_worker == NetworkIsWorker::Yes) { | 114 if (network_is_worker == NetworkIsWorker::Yes) { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 rtc::PacketTransportInternal* fake_rtp_packet_transport, | 259 rtc::PacketTransportInternal* fake_rtp_packet_transport, |
| 259 rtc::PacketTransportInternal* fake_rtcp_packet_transport, | 260 rtc::PacketTransportInternal* fake_rtcp_packet_transport, |
| 260 int flags) { | 261 int flags) { |
| 261 rtc::Thread* signaling_thread = rtc::Thread::Current(); | 262 rtc::Thread* signaling_thread = rtc::Thread::Current(); |
| 262 typename T::Channel* channel = new typename T::Channel( | 263 typename T::Channel* channel = new typename T::Channel( |
| 263 worker_thread, network_thread, signaling_thread, engine, ch, | 264 worker_thread, network_thread, signaling_thread, engine, ch, |
| 264 cricket::CN_AUDIO, (flags & RTCP_MUX_REQUIRED) != 0, | 265 cricket::CN_AUDIO, (flags & RTCP_MUX_REQUIRED) != 0, |
| 265 (flags & SECURE) != 0); | 266 (flags & SECURE) != 0); |
| 266 rtc::CryptoOptions crypto_options; | 267 rtc::CryptoOptions crypto_options; |
| 267 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; | 268 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; |
| 269 crypto_options.enable_encrypted_rtp_header_extensions = | |
| 270 (flags & ENCRYPTED_HEADERS) != 0; | |
| 268 channel->SetCryptoOptions(crypto_options); | 271 channel->SetCryptoOptions(crypto_options); |
| 269 if (!channel->NeedsRtcpTransport()) { | 272 if (!channel->NeedsRtcpTransport()) { |
| 270 fake_rtcp_dtls_transport = nullptr; | 273 fake_rtcp_dtls_transport = nullptr; |
| 271 } | 274 } |
| 272 if (!channel->Init_w(fake_rtp_dtls_transport, fake_rtcp_dtls_transport, | 275 if (!channel->Init_w(fake_rtp_dtls_transport, fake_rtcp_dtls_transport, |
| 273 fake_rtp_packet_transport, | 276 fake_rtp_packet_transport, |
| 274 fake_rtcp_packet_transport)) { | 277 fake_rtcp_packet_transport)) { |
| 275 delete channel; | 278 delete channel; |
| 276 channel = NULL; | 279 channel = NULL; |
| 277 } | 280 } |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 885 EXPECT_TRUE(channel2_->SetRemoteContent(&content4, CA_ANSWER, NULL)); | 888 EXPECT_TRUE(channel2_->SetRemoteContent(&content4, CA_ANSWER, NULL)); |
| 886 EXPECT_EQ(0u, media_channel2_->recv_streams().size()); | 889 EXPECT_EQ(0u, media_channel2_->recv_streams().size()); |
| 887 | 890 |
| 888 EXPECT_TRUE(channel1_->secure()); | 891 EXPECT_TRUE(channel1_->secure()); |
| 889 EXPECT_TRUE(channel2_->secure()); | 892 EXPECT_TRUE(channel2_->secure()); |
| 890 SendCustomRtp2(kSsrc2, 0); | 893 SendCustomRtp2(kSsrc2, 0); |
| 891 WaitForThreads(); | 894 WaitForThreads(); |
| 892 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); | 895 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); |
| 893 } | 896 } |
| 894 | 897 |
| 898 // Test that encrypted header extensions are working and can be changed when | |
| 899 // sending a new OFFER/ANSWER. | |
| 900 void TestChangeEncryptedHeaderExtensions(int flags, bool asymmetric = false) { | |
| 901 RTC_CHECK(!asymmetric || (flags & DTLS)); | |
| 902 struct PacketListener : public sigslot::has_slots<> { | |
| 903 PacketListener() {} | |
| 904 void OnReadPacket(rtc::PacketTransportInternal* transport, | |
| 905 const char* data, size_t size, const rtc::PacketTime& time, | |
| 906 int flags) { | |
| 907 CompareHeaderExtensions( | |
| 908 reinterpret_cast<const char*>(kPcmuFrameWithExtensions), data, | |
| 909 encrypted_headers, false); | |
| 910 } | |
| 911 std::vector<int> encrypted_headers; | |
| 912 } packet_listener1, packet_listener2; | |
| 913 | |
| 914 cricket::StreamParams stream1; | |
| 915 stream1.groupid = "group1"; | |
| 916 stream1.id = "stream1"; | |
| 917 stream1.ssrcs.push_back(kSsrc1); | |
| 918 stream1.cname = "stream1_cname"; | |
| 919 | |
| 920 cricket::StreamParams stream2; | |
| 921 stream2.groupid = "group1"; | |
| 922 stream2.id = "stream2"; | |
| 923 stream2.ssrcs.push_back(kSsrc2); | |
| 924 stream2.cname = "stream2_cname"; | |
| 925 | |
| 926 // Use SRTP when testing encrypted extensions. | |
| 927 int channel_flags = flags | SECURE | ENCRYPTED_HEADERS; | |
| 928 // Enable SDES if channel is not using DTLS. | |
| 929 int content_flags = (channel_flags & DTLS) == 0 ? SECURE : 0; | |
| 930 | |
| 931 // kPcmuFrameWithExtensions contains RTP extension headers with ids 1-4. | |
| 932 // Make sure to use URIs that are supported for encryption. | |
| 933 cricket::RtpHeaderExtensions extensions1; | |
| 934 extensions1.push_back( | |
| 935 RtpExtension(RtpExtension::kAudioLevelUri, 10)); | |
| 936 extensions1.push_back( | |
| 937 RtpExtension(RtpExtension::kAudioLevelUri, 1, true)); | |
| 938 | |
| 939 cricket::RtpHeaderExtensions extensions2; | |
| 940 extensions2.push_back( | |
| 941 RtpExtension(RtpExtension::kAudioLevelUri, 10)); | |
| 942 extensions2.push_back( | |
| 943 RtpExtension(RtpExtension::kAudioLevelUri, 2, true)); | |
| 944 extensions2.push_back( | |
| 945 RtpExtension(RtpExtension::kVideoRotationUri, 3)); | |
| 946 extensions2.push_back( | |
| 947 RtpExtension(RtpExtension::kTimestampOffsetUri, 4, true)); | |
| 948 | |
| 949 // Setup a call where channel 1 send |stream1| to channel 2. | |
| 950 CreateChannels(channel_flags, channel_flags); | |
| 951 fake_rtp_dtls_transport1_->fake_ice_transport()->SignalReadPacket.connect( | |
| 952 &packet_listener1, &PacketListener::OnReadPacket); | |
| 953 fake_rtp_dtls_transport2_->fake_ice_transport()->SignalReadPacket.connect( | |
| 954 &packet_listener2, &PacketListener::OnReadPacket); | |
| 955 | |
| 956 typename T::Content content1; | |
| 957 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content1); | |
| 958 content1.AddStream(stream1); | |
| 959 content1.set_rtp_header_extensions(extensions1); | |
| 960 EXPECT_TRUE(channel1_->SetLocalContent(&content1, CA_OFFER, NULL)); | |
| 961 EXPECT_TRUE(channel1_->Enable(true)); | |
| 962 EXPECT_EQ(1u, media_channel1_->send_streams().size()); | |
| 963 | |
| 964 EXPECT_TRUE(channel2_->SetRemoteContent(&content1, CA_OFFER, NULL)); | |
| 965 EXPECT_EQ(1u, media_channel2_->recv_streams().size()); | |
| 966 | |
| 967 // Channel 2 sends back |stream2|. | |
| 968 typename T::Content content2; | |
| 969 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content2); | |
| 970 content2.AddStream(stream2); | |
| 971 content2.set_rtp_header_extensions(extensions1); | |
| 972 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_ANSWER, NULL)); | |
| 973 EXPECT_EQ(1u, media_channel1_->recv_streams().size()); | |
| 974 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_ANSWER, NULL)); | |
| 975 EXPECT_TRUE(channel2_->Enable(true)); | |
| 976 EXPECT_EQ(1u, media_channel2_->send_streams().size()); | |
| 977 | |
| 978 packet_listener2.encrypted_headers.push_back(1); | |
| 979 | |
| 980 if (asymmetric) { | |
| 981 network_thread_->Invoke<void>(RTC_FROM_HERE, [this, asymmetric] { | |
| 982 if (fake_rtp_dtls_transport1_ && fake_rtp_dtls_transport2_) { | |
| 983 fake_rtp_dtls_transport1_->SetDestination( | |
| 984 fake_rtp_dtls_transport2_.get(), asymmetric); | |
| 985 } | |
| 986 if (fake_rtcp_dtls_transport1_ && fake_rtcp_dtls_transport2_) { | |
| 987 fake_rtcp_dtls_transport1_->SetDestination( | |
| 988 fake_rtcp_dtls_transport2_.get(), asymmetric); | |
| 989 } | |
| 990 }); | |
| 991 // Wait for transports to finish connecting. | |
| 992 WaitForThreads(); | |
| 993 | |
| 994 SendCustomRtp1(kSsrc1, 0); | |
| 995 WaitForThreads(); | |
| 996 | |
| 997 // The packet was dropped by channel 2 because DTLS was not | |
| 998 // negotiated on th receiving side yet. | |
| 999 EXPECT_TRUE(media_channel2_->CheckNoRtp()); | |
| 1000 } | |
| 1001 | |
| 1002 packet_listener1.encrypted_headers.push_back(1); | |
| 1003 | |
| 1004 if (asymmetric) { | |
| 1005 network_thread_->Invoke<void>(RTC_FROM_HERE, [this, asymmetric] { | |
| 1006 if (fake_rtp_dtls_transport1_ && fake_rtp_dtls_transport2_) { | |
| 1007 fake_rtp_dtls_transport2_->SetDestination( | |
| 1008 fake_rtp_dtls_transport1_.get(), asymmetric); | |
| 1009 } | |
| 1010 if (fake_rtcp_dtls_transport1_ && fake_rtcp_dtls_transport2_) { | |
| 1011 fake_rtcp_dtls_transport2_->SetDestination( | |
| 1012 fake_rtcp_dtls_transport1_.get(), asymmetric); | |
| 1013 } | |
| 1014 }); | |
| 1015 } else { | |
| 1016 ConnectFakeTransports(); | |
| 1017 } | |
| 1018 // Wait for transports to finish connecting. | |
| 1019 WaitForThreads(); | |
|
Taylor Brandstetter
2017/04/20 06:37:28
I don't understand how the additions above are rel
joachim
2017/04/24 22:07:48
You mean the code path where "asymmetric" is true?
Taylor Brandstetter
2017/04/24 23:08:17
Sorry if I was unclear. My earlier comment was mor
| |
| 1020 | |
| 1021 SendCustomRtp1(kSsrc1, 0); | |
| 1022 SendCustomRtp2(kSsrc2, 0); | |
| 1023 WaitForThreads(); | |
| 1024 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0)); | |
| 1025 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); | |
| 1026 | |
| 1027 // Let channel 2 update the encrypted header extensions. | |
| 1028 typename T::Content content3; | |
| 1029 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content3); | |
| 1030 content3.AddStream(stream2); | |
| 1031 content3.set_rtp_header_extensions(extensions2); | |
| 1032 EXPECT_TRUE(channel2_->SetLocalContent(&content3, CA_OFFER, NULL)); | |
| 1033 ASSERT_EQ(1u, media_channel2_->send_streams().size()); | |
| 1034 EXPECT_EQ(stream2, media_channel2_->send_streams()[0]); | |
| 1035 | |
| 1036 EXPECT_TRUE(channel1_->SetRemoteContent(&content3, CA_OFFER, NULL)); | |
| 1037 ASSERT_EQ(1u, media_channel1_->recv_streams().size()); | |
| 1038 EXPECT_EQ(stream2, media_channel1_->recv_streams()[0]); | |
| 1039 | |
| 1040 // Channel 2 is already sending the new encrypted extensions. These | |
| 1041 // can be decrypted by channel 1. Channel 1 is still sending the old | |
| 1042 // encrypted extensions (which can be decrypted by channel 2). | |
| 1043 packet_listener1.encrypted_headers.clear(); | |
| 1044 packet_listener1.encrypted_headers.push_back(2); | |
| 1045 packet_listener1.encrypted_headers.push_back(4); | |
| 1046 | |
| 1047 if (flags & DTLS) { | |
| 1048 // DTLS supports updating the encrypted extensions with only the OFFER | |
| 1049 // being processed. For SDES both the OFFER and ANSWER must have been | |
| 1050 // processed to update encrypted extensions, so we can't check this case. | |
| 1051 SendCustomRtp1(kSsrc1, 0); | |
| 1052 SendCustomRtp2(kSsrc2, 0); | |
| 1053 WaitForThreads(); | |
| 1054 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0)); | |
| 1055 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); | |
| 1056 } | |
| 1057 | |
| 1058 // Channel 1 replies with the same extensions. | |
| 1059 typename T::Content content4; | |
| 1060 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content4); | |
| 1061 content4.AddStream(stream1); | |
| 1062 content4.set_rtp_header_extensions(extensions2); | |
| 1063 EXPECT_TRUE(channel1_->SetLocalContent(&content4, CA_ANSWER, NULL)); | |
| 1064 EXPECT_EQ(1u, media_channel1_->send_streams().size()); | |
| 1065 | |
| 1066 EXPECT_TRUE(channel2_->SetRemoteContent(&content4, CA_ANSWER, NULL)); | |
| 1067 EXPECT_EQ(1u, media_channel2_->recv_streams().size()); | |
| 1068 | |
| 1069 packet_listener2.encrypted_headers.clear(); | |
| 1070 packet_listener2.encrypted_headers.push_back(2); | |
| 1071 packet_listener2.encrypted_headers.push_back(4); | |
| 1072 | |
| 1073 SendCustomRtp1(kSsrc1, 0); | |
| 1074 SendCustomRtp2(kSsrc2, 0); | |
| 1075 WaitForThreads(); | |
| 1076 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0)); | |
| 1077 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); | |
| 1078 } | |
| 1079 | |
| 895 // Test that we only start playout and sending at the right times. | 1080 // Test that we only start playout and sending at the right times. |
| 896 void TestPlayoutAndSendingStates() { | 1081 void TestPlayoutAndSendingStates() { |
| 897 CreateChannels(0, 0); | 1082 CreateChannels(0, 0); |
| 898 if (verify_playout_) { | 1083 if (verify_playout_) { |
| 899 EXPECT_FALSE(media_channel1_->playout()); | 1084 EXPECT_FALSE(media_channel1_->playout()); |
| 900 } | 1085 } |
| 901 EXPECT_FALSE(media_channel1_->sending()); | 1086 EXPECT_FALSE(media_channel1_->sending()); |
| 902 if (verify_playout_) { | 1087 if (verify_playout_) { |
| 903 EXPECT_FALSE(media_channel2_->playout()); | 1088 EXPECT_FALSE(media_channel2_->playout()); |
| 904 } | 1089 } |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2101 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::Yes) {} | 2286 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::Yes) {} |
| 2102 }; | 2287 }; |
| 2103 | 2288 |
| 2104 class VoiceChannelDoubleThreadTest : public ChannelTest<VoiceTraits> { | 2289 class VoiceChannelDoubleThreadTest : public ChannelTest<VoiceTraits> { |
| 2105 public: | 2290 public: |
| 2106 typedef ChannelTest<VoiceTraits> Base; | 2291 typedef ChannelTest<VoiceTraits> Base; |
| 2107 VoiceChannelDoubleThreadTest() | 2292 VoiceChannelDoubleThreadTest() |
| 2108 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::No) {} | 2293 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::No) {} |
| 2109 }; | 2294 }; |
| 2110 | 2295 |
| 2296 class VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest | |
| 2297 : public ChannelTest<VoiceTraits> { | |
| 2298 public: | |
| 2299 typedef ChannelTest<VoiceTraits> Base; | |
| 2300 VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest() | |
| 2301 : Base(true, kPcmuFrameWithExtensions, kRtcpReport, | |
| 2302 NetworkIsWorker::Yes) {} | |
| 2303 }; | |
| 2304 | |
| 2305 class VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest | |
| 2306 : public ChannelTest<VoiceTraits> { | |
| 2307 public: | |
| 2308 typedef ChannelTest<VoiceTraits> Base; | |
| 2309 VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest() | |
| 2310 : Base(true, kPcmuFrameWithExtensions, kRtcpReport, | |
| 2311 NetworkIsWorker::No) {} | |
| 2312 }; | |
| 2313 | |
| 2111 // override to add NULL parameter | 2314 // override to add NULL parameter |
| 2112 template <> | 2315 template <> |
| 2113 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( | 2316 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( |
| 2114 rtc::Thread* worker_thread, | 2317 rtc::Thread* worker_thread, |
| 2115 rtc::Thread* network_thread, | 2318 rtc::Thread* network_thread, |
| 2116 cricket::MediaEngineInterface* engine, | 2319 cricket::MediaEngineInterface* engine, |
| 2117 cricket::FakeVideoMediaChannel* ch, | 2320 cricket::FakeVideoMediaChannel* ch, |
| 2118 cricket::DtlsTransportInternal* fake_rtp_dtls_transport, | 2321 cricket::DtlsTransportInternal* fake_rtp_dtls_transport, |
| 2119 cricket::DtlsTransportInternal* fake_rtcp_dtls_transport, | 2322 cricket::DtlsTransportInternal* fake_rtcp_dtls_transport, |
| 2120 rtc::PacketTransportInternal* fake_rtp_packet_transport, | 2323 rtc::PacketTransportInternal* fake_rtp_packet_transport, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2240 } | 2443 } |
| 2241 | 2444 |
| 2242 TEST_F(VoiceChannelSingleThreadTest, TestUpdateRemoteStreamsInContent) { | 2445 TEST_F(VoiceChannelSingleThreadTest, TestUpdateRemoteStreamsInContent) { |
| 2243 Base::TestUpdateStreamsInRemoteContent(); | 2446 Base::TestUpdateStreamsInRemoteContent(); |
| 2244 } | 2447 } |
| 2245 | 2448 |
| 2246 TEST_F(VoiceChannelSingleThreadTest, TestChangeStreamParamsInContent) { | 2449 TEST_F(VoiceChannelSingleThreadTest, TestChangeStreamParamsInContent) { |
| 2247 Base::TestChangeStreamParamsInContent(); | 2450 Base::TestChangeStreamParamsInContent(); |
| 2248 } | 2451 } |
| 2249 | 2452 |
| 2453 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, | |
| 2454 TestChangeEncryptedHeaderExtensionsDtls) { | |
| 2455 int flags = DTLS; | |
| 2456 Base::TestChangeEncryptedHeaderExtensions(flags); | |
| 2457 } | |
| 2458 | |
| 2459 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, | |
| 2460 TestChangeEncryptedHeaderExtensionsDtlsAsymmetric) { | |
| 2461 int flags = DTLS; | |
| 2462 bool asymmetric = true; | |
| 2463 Base::TestChangeEncryptedHeaderExtensions(flags, asymmetric); | |
| 2464 } | |
| 2465 | |
| 2466 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, | |
| 2467 TestChangeEncryptedHeaderExtensionsDtlsGcm) { | |
| 2468 int flags = DTLS | GCM_CIPHER; | |
| 2469 Base::TestChangeEncryptedHeaderExtensions(flags); | |
| 2470 } | |
| 2471 | |
| 2472 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, | |
| 2473 TestChangeEncryptedHeaderExtensionsDtlsGcmAsymmetric) { | |
| 2474 int flags = DTLS | GCM_CIPHER; | |
| 2475 bool asymmetric = true; | |
| 2476 Base::TestChangeEncryptedHeaderExtensions(flags, asymmetric); | |
| 2477 } | |
| 2478 | |
| 2479 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest, | |
| 2480 TestChangeEncryptedHeaderExtensionsSDES) { | |
| 2481 int flags = 0; | |
| 2482 Base::TestChangeEncryptedHeaderExtensions(flags); | |
| 2483 } | |
| 2484 | |
| 2250 TEST_F(VoiceChannelSingleThreadTest, TestPlayoutAndSendingStates) { | 2485 TEST_F(VoiceChannelSingleThreadTest, TestPlayoutAndSendingStates) { |
| 2251 Base::TestPlayoutAndSendingStates(); | 2486 Base::TestPlayoutAndSendingStates(); |
| 2252 } | 2487 } |
| 2253 | 2488 |
| 2254 TEST_F(VoiceChannelSingleThreadTest, TestMuteStream) { | 2489 TEST_F(VoiceChannelSingleThreadTest, TestMuteStream) { |
| 2255 CreateChannels(0, 0); | 2490 CreateChannels(0, 0); |
| 2256 // Test that we can Mute the default channel even though the sending SSRC | 2491 // Test that we can Mute the default channel even though the sending SSRC |
| 2257 // is unknown. | 2492 // is unknown. |
| 2258 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); | 2493 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); |
| 2259 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); | 2494 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2573 } | 2808 } |
| 2574 | 2809 |
| 2575 TEST_F(VoiceChannelDoubleThreadTest, TestUpdateRemoteStreamsInContent) { | 2810 TEST_F(VoiceChannelDoubleThreadTest, TestUpdateRemoteStreamsInContent) { |
| 2576 Base::TestUpdateStreamsInRemoteContent(); | 2811 Base::TestUpdateStreamsInRemoteContent(); |
| 2577 } | 2812 } |
| 2578 | 2813 |
| 2579 TEST_F(VoiceChannelDoubleThreadTest, TestChangeStreamParamsInContent) { | 2814 TEST_F(VoiceChannelDoubleThreadTest, TestChangeStreamParamsInContent) { |
| 2580 Base::TestChangeStreamParamsInContent(); | 2815 Base::TestChangeStreamParamsInContent(); |
| 2581 } | 2816 } |
| 2582 | 2817 |
| 2818 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, | |
| 2819 TestChangeEncryptedHeaderExtensionsDtls) { | |
| 2820 int flags = DTLS; | |
| 2821 Base::TestChangeEncryptedHeaderExtensions(flags); | |
| 2822 } | |
| 2823 | |
| 2824 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, | |
| 2825 TestChangeEncryptedHeaderExtensionsDtlsAsymmetric) { | |
| 2826 int flags = DTLS; | |
| 2827 bool asymmetric = true; | |
| 2828 Base::TestChangeEncryptedHeaderExtensions(flags, asymmetric); | |
| 2829 } | |
| 2830 | |
| 2831 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, | |
| 2832 TestChangeEncryptedHeaderExtensionsDtlsGcm) { | |
| 2833 int flags = DTLS | GCM_CIPHER; | |
| 2834 Base::TestChangeEncryptedHeaderExtensions(flags); | |
| 2835 } | |
| 2836 | |
| 2837 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, | |
| 2838 TestChangeEncryptedHeaderExtensionsDtlsGcmAsymmetric) { | |
| 2839 int flags = DTLS | GCM_CIPHER; | |
| 2840 bool asymmetric = true; | |
| 2841 Base::TestChangeEncryptedHeaderExtensions(flags, asymmetric); | |
| 2842 } | |
| 2843 | |
| 2844 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest, | |
| 2845 TestChangeEncryptedHeaderExtensionsSDES) { | |
| 2846 int flags = 0; | |
| 2847 Base::TestChangeEncryptedHeaderExtensions(flags); | |
| 2848 } | |
| 2849 | |
| 2583 TEST_F(VoiceChannelDoubleThreadTest, TestPlayoutAndSendingStates) { | 2850 TEST_F(VoiceChannelDoubleThreadTest, TestPlayoutAndSendingStates) { |
| 2584 Base::TestPlayoutAndSendingStates(); | 2851 Base::TestPlayoutAndSendingStates(); |
| 2585 } | 2852 } |
| 2586 | 2853 |
| 2587 TEST_F(VoiceChannelDoubleThreadTest, TestMuteStream) { | 2854 TEST_F(VoiceChannelDoubleThreadTest, TestMuteStream) { |
| 2588 CreateChannels(0, 0); | 2855 CreateChannels(0, 0); |
| 2589 // Test that we can Mute the default channel even though the sending SSRC | 2856 // Test that we can Mute the default channel even though the sending SSRC |
| 2590 // is unknown. | 2857 // is unknown. |
| 2591 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); | 2858 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); |
| 2592 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); | 2859 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3785 ASSERT_TRUE(voice_channel_.Init_w(nullptr, nullptr, &fake_rtp_dtls_transport_, | 4052 ASSERT_TRUE(voice_channel_.Init_w(nullptr, nullptr, &fake_rtp_dtls_transport_, |
| 3786 &fake_rtcp_dtls_transport_)); | 4053 &fake_rtcp_dtls_transport_)); |
| 3787 EXPECT_DEATH(voice_channel_.SetTransports(&fake_rtp_dtls_transport_, | 4054 EXPECT_DEATH(voice_channel_.SetTransports(&fake_rtp_dtls_transport_, |
| 3788 &fake_rtp_dtls_transport_), | 4055 &fake_rtp_dtls_transport_), |
| 3789 ""); | 4056 ""); |
| 3790 } | 4057 } |
| 3791 | 4058 |
| 3792 #endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) | 4059 #endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) |
| 3793 | 4060 |
| 3794 // TODO(pthatcher): TestSetReceiver? | 4061 // TODO(pthatcher): TestSetReceiver? |
| OLD | NEW |