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

Unified Diff: webrtc/p2p/base/dtlstransportchannel_unittest.cc

Issue 1416673006: Convert internal representation of Srtp cryptos from string to int. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: change srtp crypto name conversion Created 5 years, 1 month 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
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.cc ('k') | webrtc/p2p/base/faketransportcontroller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/dtlstransportchannel_unittest.cc
diff --git a/webrtc/p2p/base/dtlstransportchannel_unittest.cc b/webrtc/p2p/base/dtlstransportchannel_unittest.cc
index 07e3b87847203150eac14e38b368ab0677e270d7..a967ae31f1b90ad11b0b1bf507920028cc69f970 100644
--- a/webrtc/p2p/base/dtlstransportchannel_unittest.cc
+++ b/webrtc/p2p/base/dtlstransportchannel_unittest.cc
@@ -28,7 +28,6 @@
return; \
}
-static const char AES_CM_128_HMAC_SHA1_80[] = "AES_CM_128_HMAC_SHA1_80";
static const char kIceUfrag1[] = "TESTICEUFRAG0001";
static const char kIcePwd1[] = "TESTICEPWD00000000000001";
static const size_t kPacketNumOffset = 8;
@@ -150,9 +149,9 @@ class DtlsTestClient : public sigslot::has_slots<> {
// SRTP ciphers will be set only in the beginning.
for (std::vector<cricket::DtlsTransportChannelWrapper*>::iterator it =
channels_.begin(); it != channels_.end(); ++it) {
- std::vector<std::string> ciphers;
- ciphers.push_back(AES_CM_128_HMAC_SHA1_80);
- ASSERT_TRUE((*it)->SetSrtpCiphers(ciphers));
+ std::vector<int> ciphers;
+ ciphers.push_back(rtc::SRTP_AES128_CM_SHA1_80);
+ ASSERT_TRUE((*it)->SetSrtpCryptoSuites(ciphers));
}
}
@@ -215,16 +214,16 @@ class DtlsTestClient : public sigslot::has_slots<> {
}
}
- void CheckSrtp(const std::string& expected_cipher) {
+ void CheckSrtp(int expected_crypto_suite) {
for (std::vector<cricket::DtlsTransportChannelWrapper*>::iterator it =
channels_.begin(); it != channels_.end(); ++it) {
- std::string cipher;
+ int crypto_suite;
- bool rv = (*it)->GetSrtpCryptoSuite(&cipher);
- if (negotiated_dtls_ && !expected_cipher.empty()) {
+ bool rv = (*it)->GetSrtpCryptoSuite(&crypto_suite);
+ if (negotiated_dtls_ && expected_crypto_suite) {
ASSERT_TRUE(rv);
- ASSERT_EQ(cipher, expected_cipher);
+ ASSERT_EQ(crypto_suite, expected_crypto_suite);
} else {
ASSERT_FALSE(rv);
}
@@ -469,11 +468,11 @@ class DtlsTransportChannelTest : public testing::Test {
// Check that we negotiated the right ciphers.
if (use_dtls_srtp_) {
- client1_.CheckSrtp(AES_CM_128_HMAC_SHA1_80);
- client2_.CheckSrtp(AES_CM_128_HMAC_SHA1_80);
+ client1_.CheckSrtp(rtc::SRTP_AES128_CM_SHA1_80);
+ client2_.CheckSrtp(rtc::SRTP_AES128_CM_SHA1_80);
} else {
- client1_.CheckSrtp("");
- client2_.CheckSrtp("");
+ client1_.CheckSrtp(rtc::SRTP_INVALID_CRYPTO_SUITE);
+ client2_.CheckSrtp(rtc::SRTP_INVALID_CRYPTO_SUITE);
}
client1_.CheckSsl(rtc::SSLStreamAdapter::GetDefaultSslCipherForTest(
ssl_expected_version_, rtc::KT_DEFAULT));
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.cc ('k') | webrtc/p2p/base/faketransportcontroller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698