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

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

Issue 2761143002: Support encrypted RTP extensions (RFC 6904) (Closed)
Patch Set: Updated comment. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2009 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2009 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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 enum EncryptedHeaderTestScenario {
899 // Offer/Answer are processed before DTLS completes.
900 DEFAULT,
901 // DTLS completes before any Offer/Answer have been sent.
902 DTLS_BEFORE_OFFER_ANSWER,
903 // DTLS completes after channel 2 has processed (remote) Offer and (local)
904 // Answer.
905 DTLS_AFTER_CHANNEL2_READY,
906 };
907
908 // Test that encrypted header extensions are working and can be changed when
909 // sending a new OFFER/ANSWER.
910 void TestChangeEncryptedHeaderExtensions(int flags,
911 EncryptedHeaderTestScenario scenario = DEFAULT) {
912 RTC_CHECK(scenario == 0 || (flags & DTLS));
913 struct PacketListener : public sigslot::has_slots<> {
914 PacketListener() {}
915 void OnReadPacket(rtc::PacketTransportInternal* transport,
916 const char* data, size_t size, const rtc::PacketTime& time,
917 int flags) {
918 CompareHeaderExtensions(
919 reinterpret_cast<const char*>(kPcmuFrameWithExtensions), data,
920 encrypted_headers, false);
921 }
922 std::vector<int> encrypted_headers;
923 } packet_listener1, packet_listener2;
924
925 cricket::StreamParams stream1;
926 stream1.groupid = "group1";
927 stream1.id = "stream1";
928 stream1.ssrcs.push_back(kSsrc1);
929 stream1.cname = "stream1_cname";
930
931 cricket::StreamParams stream2;
932 stream2.groupid = "group1";
933 stream2.id = "stream2";
934 stream2.ssrcs.push_back(kSsrc2);
935 stream2.cname = "stream2_cname";
936
937 // Use SRTP when testing encrypted extensions.
938 int channel_flags = flags | SECURE | ENCRYPTED_HEADERS;
939 // Enable SDES if channel is not using DTLS.
940 int content_flags = (channel_flags & DTLS) == 0 ? SECURE : 0;
941
942 // kPcmuFrameWithExtensions contains RTP extension headers with ids 1-4.
943 // Make sure to use URIs that are supported for encryption.
944 cricket::RtpHeaderExtensions extensions1;
945 extensions1.push_back(
946 RtpExtension(RtpExtension::kAudioLevelUri, 10));
947 extensions1.push_back(
948 RtpExtension(RtpExtension::kAudioLevelUri, 1, true));
949
950 cricket::RtpHeaderExtensions extensions2;
951 extensions2.push_back(
952 RtpExtension(RtpExtension::kAudioLevelUri, 10));
953 extensions2.push_back(
954 RtpExtension(RtpExtension::kAudioLevelUri, 2, true));
955 extensions2.push_back(
956 RtpExtension(RtpExtension::kVideoRotationUri, 3));
957 extensions2.push_back(
958 RtpExtension(RtpExtension::kTimestampOffsetUri, 4, true));
959
960 // Setup a call where channel 1 send |stream1| to channel 2.
961 CreateChannels(channel_flags, channel_flags);
962 fake_rtp_dtls_transport1_->fake_ice_transport()->SignalReadPacket.connect(
963 &packet_listener1, &PacketListener::OnReadPacket);
964 fake_rtp_dtls_transport2_->fake_ice_transport()->SignalReadPacket.connect(
965 &packet_listener2, &PacketListener::OnReadPacket);
966
967 if (scenario == DTLS_BEFORE_OFFER_ANSWER) {
968 ConnectFakeTransports();
969 WaitForThreads();
970 }
971
972 typename T::Content content1;
973 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content1);
974 content1.AddStream(stream1);
975 content1.set_rtp_header_extensions(extensions1);
976 EXPECT_TRUE(channel1_->SetLocalContent(&content1, CA_OFFER, NULL));
977 EXPECT_TRUE(channel1_->Enable(true));
978 EXPECT_EQ(1u, media_channel1_->send_streams().size());
979 packet_listener1.encrypted_headers.push_back(1);
980
981 EXPECT_TRUE(channel2_->SetRemoteContent(&content1, CA_OFFER, NULL));
982 EXPECT_EQ(1u, media_channel2_->recv_streams().size());
983
984 // Channel 2 sends back |stream2|.
985 typename T::Content content2;
986 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content2);
987 content2.AddStream(stream2);
988 content2.set_rtp_header_extensions(extensions1);
989 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_ANSWER, NULL));
990 EXPECT_TRUE(channel2_->Enable(true));
991 EXPECT_EQ(1u, media_channel2_->send_streams().size());
992 packet_listener2.encrypted_headers.push_back(1);
993
994 if (scenario == DTLS_AFTER_CHANNEL2_READY) {
995 ConnectFakeTransports();
996 WaitForThreads();
997 }
998
999 if (scenario == DTLS_BEFORE_OFFER_ANSWER ||
1000 scenario == DTLS_AFTER_CHANNEL2_READY) {
1001 // In both scenarios with partially completed Offer/Answer, sending
1002 // packets from Channel 2 to Channel 1 should work.
1003 SendCustomRtp2(kSsrc2, 0);
1004 WaitForThreads();
1005 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0));
1006 }
1007
1008 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_ANSWER, NULL));
1009 EXPECT_EQ(1u, media_channel1_->recv_streams().size());
1010
1011 if (scenario == DEFAULT) {
1012 ConnectFakeTransports();
1013 WaitForThreads();
1014 }
1015
1016 SendCustomRtp1(kSsrc1, 0);
1017 SendCustomRtp2(kSsrc2, 0);
1018 WaitForThreads();
1019 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0));
1020 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0));
1021
1022 // Let channel 2 update the encrypted header extensions.
1023 typename T::Content content3;
1024 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content3);
1025 content3.AddStream(stream2);
1026 content3.set_rtp_header_extensions(extensions2);
1027 EXPECT_TRUE(channel2_->SetLocalContent(&content3, CA_OFFER, NULL));
1028 ASSERT_EQ(1u, media_channel2_->send_streams().size());
1029 EXPECT_EQ(stream2, media_channel2_->send_streams()[0]);
1030 packet_listener2.encrypted_headers.clear();
1031 packet_listener2.encrypted_headers.push_back(2);
1032 packet_listener2.encrypted_headers.push_back(4);
1033
1034 EXPECT_TRUE(channel1_->SetRemoteContent(&content3, CA_OFFER, NULL));
1035 ASSERT_EQ(1u, media_channel1_->recv_streams().size());
1036 EXPECT_EQ(stream2, media_channel1_->recv_streams()[0]);
1037
1038 // Channel 1 is already sending the new encrypted extensions. These
1039 // can be decrypted by channel 2. Channel 2 is still sending the old
1040 // encrypted extensions (which can be decrypted by channel 1).
1041
1042 if (flags & DTLS) {
1043 // DTLS supports updating the encrypted extensions with only the OFFER
1044 // being processed. For SDES both the OFFER and ANSWER must have been
1045 // processed to update encrypted extensions, so we can't check this case.
1046 SendCustomRtp1(kSsrc1, 0);
1047 SendCustomRtp2(kSsrc2, 0);
1048 WaitForThreads();
1049 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0));
1050 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0));
1051 }
1052
1053 // Channel 1 replies with the same extensions.
1054 typename T::Content content4;
1055 CreateContent(content_flags, kPcmuCodec, kH264Codec, &content4);
1056 content4.AddStream(stream1);
1057 content4.set_rtp_header_extensions(extensions2);
1058 EXPECT_TRUE(channel1_->SetLocalContent(&content4, CA_ANSWER, NULL));
1059 EXPECT_EQ(1u, media_channel1_->send_streams().size());
1060 packet_listener1.encrypted_headers.clear();
1061 packet_listener1.encrypted_headers.push_back(2);
1062 packet_listener1.encrypted_headers.push_back(4);
1063
1064 EXPECT_TRUE(channel2_->SetRemoteContent(&content4, CA_ANSWER, NULL));
1065 EXPECT_EQ(1u, media_channel2_->recv_streams().size());
1066
1067 SendCustomRtp1(kSsrc1, 0);
1068 SendCustomRtp2(kSsrc2, 0);
1069 WaitForThreads();
1070 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0));
1071 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0));
1072 }
1073
895 // Test that we only start playout and sending at the right times. 1074 // Test that we only start playout and sending at the right times.
896 void TestPlayoutAndSendingStates() { 1075 void TestPlayoutAndSendingStates() {
897 CreateChannels(0, 0); 1076 CreateChannels(0, 0);
898 if (verify_playout_) { 1077 if (verify_playout_) {
899 EXPECT_FALSE(media_channel1_->playout()); 1078 EXPECT_FALSE(media_channel1_->playout());
900 } 1079 }
901 EXPECT_FALSE(media_channel1_->sending()); 1080 EXPECT_FALSE(media_channel1_->sending());
902 if (verify_playout_) { 1081 if (verify_playout_) {
903 EXPECT_FALSE(media_channel2_->playout()); 1082 EXPECT_FALSE(media_channel2_->playout());
904 } 1083 }
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::Yes) {} 2280 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::Yes) {}
2102 }; 2281 };
2103 2282
2104 class VoiceChannelDoubleThreadTest : public ChannelTest<VoiceTraits> { 2283 class VoiceChannelDoubleThreadTest : public ChannelTest<VoiceTraits> {
2105 public: 2284 public:
2106 typedef ChannelTest<VoiceTraits> Base; 2285 typedef ChannelTest<VoiceTraits> Base;
2107 VoiceChannelDoubleThreadTest() 2286 VoiceChannelDoubleThreadTest()
2108 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::No) {} 2287 : Base(true, kPcmuFrame, kRtcpReport, NetworkIsWorker::No) {}
2109 }; 2288 };
2110 2289
2290 class VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest
2291 : public ChannelTest<VoiceTraits> {
2292 public:
2293 typedef ChannelTest<VoiceTraits> Base;
2294 VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest()
2295 : Base(true, kPcmuFrameWithExtensions, kRtcpReport,
2296 NetworkIsWorker::Yes) {}
2297 };
2298
2299 class VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest
2300 : public ChannelTest<VoiceTraits> {
2301 public:
2302 typedef ChannelTest<VoiceTraits> Base;
2303 VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest()
2304 : Base(true, kPcmuFrameWithExtensions, kRtcpReport,
2305 NetworkIsWorker::No) {}
2306 };
2307
2111 // override to add NULL parameter 2308 // override to add NULL parameter
2112 template <> 2309 template <>
2113 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( 2310 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel(
2114 rtc::Thread* worker_thread, 2311 rtc::Thread* worker_thread,
2115 rtc::Thread* network_thread, 2312 rtc::Thread* network_thread,
2116 cricket::MediaEngineInterface* engine, 2313 cricket::MediaEngineInterface* engine,
2117 cricket::FakeVideoMediaChannel* ch, 2314 cricket::FakeVideoMediaChannel* ch,
2118 cricket::DtlsTransportInternal* fake_rtp_dtls_transport, 2315 cricket::DtlsTransportInternal* fake_rtp_dtls_transport,
2119 cricket::DtlsTransportInternal* fake_rtcp_dtls_transport, 2316 cricket::DtlsTransportInternal* fake_rtcp_dtls_transport,
2120 rtc::PacketTransportInternal* fake_rtp_packet_transport, 2317 rtc::PacketTransportInternal* fake_rtp_packet_transport,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 } 2437 }
2241 2438
2242 TEST_F(VoiceChannelSingleThreadTest, TestUpdateRemoteStreamsInContent) { 2439 TEST_F(VoiceChannelSingleThreadTest, TestUpdateRemoteStreamsInContent) {
2243 Base::TestUpdateStreamsInRemoteContent(); 2440 Base::TestUpdateStreamsInRemoteContent();
2244 } 2441 }
2245 2442
2246 TEST_F(VoiceChannelSingleThreadTest, TestChangeStreamParamsInContent) { 2443 TEST_F(VoiceChannelSingleThreadTest, TestChangeStreamParamsInContent) {
2247 Base::TestChangeStreamParamsInContent(); 2444 Base::TestChangeStreamParamsInContent();
2248 } 2445 }
2249 2446
2447 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest,
2448 TestChangeEncryptedHeaderExtensionsDtls) {
2449 int flags = DTLS;
2450 Base::TestChangeEncryptedHeaderExtensions(flags);
2451 }
2452
2453 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest,
2454 TestChangeEncryptedHeaderExtensionsDtlsScenario1) {
2455 int flags = DTLS;
2456 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_BEFORE_OFFER_ANSWER);
2457 }
2458
2459 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest,
2460 TestChangeEncryptedHeaderExtensionsDtlsScenario2) {
2461 int flags = DTLS;
2462 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_AFTER_CHANNEL2_READY);
2463 }
2464
2465 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest,
2466 TestChangeEncryptedHeaderExtensionsDtlsGcm) {
2467 int flags = DTLS | GCM_CIPHER;
2468 Base::TestChangeEncryptedHeaderExtensions(flags);
2469 }
2470
2471 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest,
2472 TestChangeEncryptedHeaderExtensionsDtlsGcmScenario1) {
2473 int flags = DTLS | GCM_CIPHER;
2474 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_BEFORE_OFFER_ANSWER);
2475 }
2476
2477 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest,
2478 TestChangeEncryptedHeaderExtensionsDtlsGcmScenario2) {
2479 int flags = DTLS | GCM_CIPHER;
2480 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_AFTER_CHANNEL2_READY);
2481 }
2482
2483 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsSingleThreadTest,
2484 TestChangeEncryptedHeaderExtensionsSDES) {
2485 int flags = 0;
2486 Base::TestChangeEncryptedHeaderExtensions(flags);
2487 }
2488
2250 TEST_F(VoiceChannelSingleThreadTest, TestPlayoutAndSendingStates) { 2489 TEST_F(VoiceChannelSingleThreadTest, TestPlayoutAndSendingStates) {
2251 Base::TestPlayoutAndSendingStates(); 2490 Base::TestPlayoutAndSendingStates();
2252 } 2491 }
2253 2492
2254 TEST_F(VoiceChannelSingleThreadTest, TestMuteStream) { 2493 TEST_F(VoiceChannelSingleThreadTest, TestMuteStream) {
2255 CreateChannels(0, 0); 2494 CreateChannels(0, 0);
2256 // Test that we can Mute the default channel even though the sending SSRC 2495 // Test that we can Mute the default channel even though the sending SSRC
2257 // is unknown. 2496 // is unknown.
2258 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); 2497 EXPECT_FALSE(media_channel1_->IsStreamMuted(0));
2259 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); 2498 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr));
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 } 2812 }
2574 2813
2575 TEST_F(VoiceChannelDoubleThreadTest, TestUpdateRemoteStreamsInContent) { 2814 TEST_F(VoiceChannelDoubleThreadTest, TestUpdateRemoteStreamsInContent) {
2576 Base::TestUpdateStreamsInRemoteContent(); 2815 Base::TestUpdateStreamsInRemoteContent();
2577 } 2816 }
2578 2817
2579 TEST_F(VoiceChannelDoubleThreadTest, TestChangeStreamParamsInContent) { 2818 TEST_F(VoiceChannelDoubleThreadTest, TestChangeStreamParamsInContent) {
2580 Base::TestChangeStreamParamsInContent(); 2819 Base::TestChangeStreamParamsInContent();
2581 } 2820 }
2582 2821
2822 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest,
2823 TestChangeEncryptedHeaderExtensionsDtls) {
2824 int flags = DTLS;
2825 Base::TestChangeEncryptedHeaderExtensions(flags);
2826 }
2827
2828 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest,
2829 TestChangeEncryptedHeaderExtensionsDtlsScenario1) {
2830 int flags = DTLS;
2831 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_BEFORE_OFFER_ANSWER);
2832 }
2833
2834 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest,
2835 TestChangeEncryptedHeaderExtensionsDtlsScenario2) {
2836 int flags = DTLS;
2837 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_AFTER_CHANNEL2_READY);
2838 }
2839
2840 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest,
2841 TestChangeEncryptedHeaderExtensionsDtlsGcm) {
2842 int flags = DTLS | GCM_CIPHER;
2843 Base::TestChangeEncryptedHeaderExtensions(flags);
2844 }
2845
2846 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest,
2847 TestChangeEncryptedHeaderExtensionsDtlsGcmScenario1) {
2848 int flags = DTLS | GCM_CIPHER;
2849 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_BEFORE_OFFER_ANSWER);
2850 }
2851
2852 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest,
2853 TestChangeEncryptedHeaderExtensionsDtlsGcmScenario2) {
2854 int flags = DTLS | GCM_CIPHER;
2855 Base::TestChangeEncryptedHeaderExtensions(flags, DTLS_AFTER_CHANNEL2_READY);
2856 }
2857
2858 TEST_F(VoiceChannelWithEncryptedRtpHeaderExtensionsDoubleThreadTest,
2859 TestChangeEncryptedHeaderExtensionsSDES) {
2860 int flags = 0;
2861 Base::TestChangeEncryptedHeaderExtensions(flags);
2862 }
2863
2583 TEST_F(VoiceChannelDoubleThreadTest, TestPlayoutAndSendingStates) { 2864 TEST_F(VoiceChannelDoubleThreadTest, TestPlayoutAndSendingStates) {
2584 Base::TestPlayoutAndSendingStates(); 2865 Base::TestPlayoutAndSendingStates();
2585 } 2866 }
2586 2867
2587 TEST_F(VoiceChannelDoubleThreadTest, TestMuteStream) { 2868 TEST_F(VoiceChannelDoubleThreadTest, TestMuteStream) {
2588 CreateChannels(0, 0); 2869 CreateChannels(0, 0);
2589 // Test that we can Mute the default channel even though the sending SSRC 2870 // Test that we can Mute the default channel even though the sending SSRC
2590 // is unknown. 2871 // is unknown.
2591 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); 2872 EXPECT_FALSE(media_channel1_->IsStreamMuted(0));
2592 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr)); 2873 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr));
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
3785 ASSERT_TRUE(voice_channel_.Init_w(nullptr, nullptr, &fake_rtp_dtls_transport_, 4066 ASSERT_TRUE(voice_channel_.Init_w(nullptr, nullptr, &fake_rtp_dtls_transport_,
3786 &fake_rtcp_dtls_transport_)); 4067 &fake_rtcp_dtls_transport_));
3787 EXPECT_DEATH(voice_channel_.SetTransports(&fake_rtp_dtls_transport_, 4068 EXPECT_DEATH(voice_channel_.SetTransports(&fake_rtp_dtls_transport_,
3788 &fake_rtp_dtls_transport_), 4069 &fake_rtp_dtls_transport_),
3789 ""); 4070 "");
3790 } 4071 }
3791 4072
3792 #endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) 4073 #endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
3793 4074
3794 // TODO(pthatcher): TestSetReceiver? 4075 // TODO(pthatcher): TestSetReceiver?
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698