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

Unified Diff: webrtc/pc/webrtcsession_unittest.cc

Issue 2815513012: Negotiate the same SRTP crypto suites for every DTLS association formed. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« webrtc/base/sslstreamadapter.h ('K') | « webrtc/pc/test/mock_webrtcsession.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/webrtcsession_unittest.cc
diff --git a/webrtc/pc/webrtcsession_unittest.cc b/webrtc/pc/webrtcsession_unittest.cc
index 09b90909407ba451fe0c0e80a8e114efd6579e78..b18cb226d4a203fb725265ba2cc2a18f1b457533 100644
--- a/webrtc/pc/webrtcsession_unittest.cc
+++ b/webrtc/pc/webrtcsession_unittest.cc
@@ -420,16 +420,18 @@ class WebRtcSessionTest
// otherwise one will be generated using the |cert_generator|.
void Init(
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
- PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy) {
+ PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy,
+ const rtc::CryptoOptions& crypto_options) {
ASSERT_TRUE(session_.get() == NULL);
fake_sctp_transport_factory_ = new FakeSctpTransportFactory();
session_.reset(new WebRtcSessionForTest(
media_controller_.get(), rtc::Thread::Current(), rtc::Thread::Current(),
rtc::Thread::Current(), allocator_.get(), &observer_,
std::unique_ptr<cricket::TransportController>(
- new cricket::TransportController(rtc::Thread::Current(),
- rtc::Thread::Current(),
- allocator_.get())),
+ new cricket::TransportController(
+ rtc::Thread::Current(), rtc::Thread::Current(),
+ allocator_.get(),
+ /*redetermine_role_on_ice_restart=*/true, crypto_options)),
std::unique_ptr<FakeSctpTransportFactory>(
fake_sctp_transport_factory_)));
session_->SignalDataChannelOpenMessage.connect(
@@ -453,11 +455,8 @@ class WebRtcSessionTest
}
void Init() {
- Init(nullptr, PeerConnectionInterface::kRtcpMuxPolicyNegotiate);
- }
-
- void Init(PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy) {
- Init(nullptr, rtcp_mux_policy);
+ Init(nullptr, PeerConnectionInterface::kRtcpMuxPolicyNegotiate,
+ rtc::CryptoOptions());
}
void InitWithBundlePolicy(
@@ -469,7 +468,12 @@ class WebRtcSessionTest
void InitWithRtcpMuxPolicy(
PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy) {
PeerConnectionInterface::RTCConfiguration configuration;
- Init(rtcp_mux_policy);
+ Init(nullptr, rtcp_mux_policy, rtc::CryptoOptions());
+ }
+
+ void InitWithCryptoOptions(const rtc::CryptoOptions& crypto_options) {
+ Init(nullptr, PeerConnectionInterface::kRtcpMuxPolicyNegotiate,
+ crypto_options);
}
// Successfully init with DTLS; with a certificate generated and supplied or
@@ -486,7 +490,8 @@ class WebRtcSessionTest
RTC_CHECK(false);
}
Init(std::move(cert_generator),
- PeerConnectionInterface::kRtcpMuxPolicyNegotiate);
+ PeerConnectionInterface::kRtcpMuxPolicyNegotiate,
+ rtc::CryptoOptions());
}
// Init with DTLS with a store that will fail to generate a certificate.
@@ -495,15 +500,14 @@ class WebRtcSessionTest
new FakeRTCCertificateGenerator());
cert_generator->set_should_fail(true);
Init(std::move(cert_generator),
- PeerConnectionInterface::kRtcpMuxPolicyNegotiate);
+ PeerConnectionInterface::kRtcpMuxPolicyNegotiate,
+ rtc::CryptoOptions());
}
void InitWithGcm() {
rtc::CryptoOptions crypto_options;
crypto_options.enable_gcm_crypto_suites = true;
- channel_manager_->SetCryptoOptions(crypto_options);
- with_gcm_ = true;
- Init();
+ InitWithCryptoOptions(crypto_options);
}
void SendAudioVideoStream1() {
@@ -3370,7 +3374,7 @@ TEST_F(WebRtcSessionTest, TestAddChannelToConnectedBundle) {
configuration_.bundle_policy =
PeerConnectionInterface::kBundlePolicyMaxBundle;
options_.disable_encryption = true;
- Init(PeerConnectionInterface::kRtcpMuxPolicyRequire);
+ InitWithRtcpMuxPolicy(PeerConnectionInterface::kRtcpMuxPolicyRequire);
// Negotiate an audio channel with MAX_BUNDLE enabled.
SendAudioOnlyStream2();
« webrtc/base/sslstreamadapter.h ('K') | « webrtc/pc/test/mock_webrtcsession.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698