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 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "webrtc/base/array_view.h" | 13 #include "webrtc/base/array_view.h" |
14 #include "webrtc/base/buffer.h" | 14 #include "webrtc/base/buffer.h" |
| 15 #include "webrtc/base/checks.h" |
15 #include "webrtc/base/fakeclock.h" | 16 #include "webrtc/base/fakeclock.h" |
16 #include "webrtc/base/gunit.h" | 17 #include "webrtc/base/gunit.h" |
17 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
18 #include "webrtc/base/sslstreamadapter.h" | 19 #include "webrtc/base/sslstreamadapter.h" |
19 #include "webrtc/media/base/fakemediaengine.h" | 20 #include "webrtc/media/base/fakemediaengine.h" |
20 #include "webrtc/media/base/fakertp.h" | 21 #include "webrtc/media/base/fakertp.h" |
21 #include "webrtc/media/base/mediachannel.h" | 22 #include "webrtc/media/base/mediachannel.h" |
22 #include "webrtc/media/base/testutils.h" | 23 #include "webrtc/media/base/testutils.h" |
23 #include "webrtc/p2p/base/faketransportcontroller.h" | 24 #include "webrtc/p2p/base/faketransportcontroller.h" |
24 #include "webrtc/p2p/base/transportchannelimpl.h" | 25 #include "webrtc/p2p/base/transportchannelimpl.h" |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 SendRtcp1(); | 1262 SendRtcp1(); |
1262 SendRtcp2(); | 1263 SendRtcp2(); |
1263 WaitForThreads(); | 1264 WaitForThreads(); |
1264 EXPECT_TRUE(CheckRtcp2()); | 1265 EXPECT_TRUE(CheckRtcp2()); |
1265 EXPECT_TRUE(CheckRtcp1()); | 1266 EXPECT_TRUE(CheckRtcp1()); |
1266 } | 1267 } |
1267 | 1268 |
1268 // Test that we properly send SRTP with RTCP in both directions. | 1269 // Test that we properly send SRTP with RTCP in both directions. |
1269 // You can pass in DTLS and/or RTCP_MUX as flags. | 1270 // You can pass in DTLS and/or RTCP_MUX as flags. |
1270 void SendSrtpToSrtp(int flags1_in = 0, int flags2_in = 0) { | 1271 void SendSrtpToSrtp(int flags1_in = 0, int flags2_in = 0) { |
1271 ASSERT((flags1_in & ~(RTCP_MUX | DTLS | GCM_CIPHER)) == 0); | 1272 RTC_CHECK((flags1_in & ~(RTCP_MUX | DTLS | GCM_CIPHER)) == 0); |
1272 ASSERT((flags2_in & ~(RTCP_MUX | DTLS | GCM_CIPHER)) == 0); | 1273 RTC_CHECK((flags2_in & ~(RTCP_MUX | DTLS | GCM_CIPHER)) == 0); |
1273 | 1274 |
1274 int flags1 = SECURE | flags1_in; | 1275 int flags1 = SECURE | flags1_in; |
1275 int flags2 = SECURE | flags2_in; | 1276 int flags2 = SECURE | flags2_in; |
1276 bool dtls1 = !!(flags1_in & DTLS); | 1277 bool dtls1 = !!(flags1_in & DTLS); |
1277 bool dtls2 = !!(flags2_in & DTLS); | 1278 bool dtls2 = !!(flags2_in & DTLS); |
1278 CreateChannels(flags1, flags2); | 1279 CreateChannels(flags1, flags2); |
1279 EXPECT_FALSE(channel1_->secure()); | 1280 EXPECT_FALSE(channel1_->secure()); |
1280 EXPECT_FALSE(channel2_->secure()); | 1281 EXPECT_FALSE(channel2_->secure()); |
1281 EXPECT_TRUE(SendInitiate()); | 1282 EXPECT_TRUE(SendInitiate()); |
1282 WaitForThreads(); | 1283 WaitForThreads(); |
(...skipping 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3652 cricket::TransportChannel* new_rtcp_transport = | 3653 cricket::TransportChannel* new_rtcp_transport = |
3653 fake_transport_controller_.CreateTransportChannel( | 3654 fake_transport_controller_.CreateTransportChannel( |
3654 "baz", cricket::ICE_CANDIDATE_COMPONENT_RTCP); | 3655 "baz", cricket::ICE_CANDIDATE_COMPONENT_RTCP); |
3655 EXPECT_DEATH( | 3656 EXPECT_DEATH( |
3656 voice_channel_.SetTransports(new_rtp_transport, new_rtcp_transport), ""); | 3657 voice_channel_.SetTransports(new_rtp_transport, new_rtcp_transport), ""); |
3657 } | 3658 } |
3658 | 3659 |
3659 #endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) | 3660 #endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) |
3660 | 3661 |
3661 // TODO(pthatcher): TestSetReceiver? | 3662 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |