aboutsummaryrefslogtreecommitdiff
path: root/talk/app/webrtc/statscollector_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'talk/app/webrtc/statscollector_unittest.cc')
-rw-r--r--talk/app/webrtc/statscollector_unittest.cc47
1 files changed, 21 insertions, 26 deletions
diff --git a/talk/app/webrtc/statscollector_unittest.cc b/talk/app/webrtc/statscollector_unittest.cc
index 9121c691b1..e7ee91190e 100644
--- a/talk/app/webrtc/statscollector_unittest.cc
+++ b/talk/app/webrtc/statscollector_unittest.cc
@@ -35,7 +35,6 @@
#include "talk/app/webrtc/peerconnectionfactory.h"
#include "talk/app/webrtc/mediastream.h"
#include "talk/app/webrtc/mediastreaminterface.h"
-#include "talk/app/webrtc/mediastreamsignaling.h"
#include "talk/app/webrtc/mediastreamtrack.h"
#include "talk/app/webrtc/test/fakedatachannelprovider.h"
#include "talk/app/webrtc/videotrack.h"
@@ -683,8 +682,8 @@ class StatsCollectorTest : public testing::Test {
// Fake stats to process.
cricket::TransportChannelStats channel_stats;
channel_stats.component = 1;
- channel_stats.srtp_cipher = "the-srtp-cipher";
- channel_stats.ssl_cipher = TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA;
+ channel_stats.srtp_crypto_suite = rtc::SRTP_AES128_CM_SHA1_80;
+ channel_stats.ssl_cipher_suite = TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA;
cricket::TransportStats transport_stats;
transport_stats.transport_name = "audio";
@@ -697,8 +696,7 @@ class StatsCollectorTest : public testing::Test {
// Fake certificate to report
rtc::scoped_refptr<rtc::RTCCertificate> local_certificate(
rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::FakeSSLIdentity>(
- new rtc::FakeSSLIdentity(local_cert))
- .Pass()));
+ new rtc::FakeSSLIdentity(local_cert))));
// Configure MockWebRtcSession
EXPECT_CALL(session_,
@@ -747,18 +745,17 @@ class StatsCollectorTest : public testing::Test {
}
// Check negotiated ciphers.
- std::string dtls_cipher = ExtractStatsValue(
- StatsReport::kStatsReportTypeComponent,
- reports,
- StatsReport::kStatsValueNameDtlsCipher);
- EXPECT_EQ(rtc::SSLStreamAdapter::GetSslCipherSuiteName(
+ std::string dtls_cipher_suite =
+ ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports,
+ StatsReport::kStatsValueNameDtlsCipher);
+ EXPECT_EQ(rtc::SSLStreamAdapter::SslCipherSuiteToName(
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA),
- dtls_cipher);
- std::string srtp_cipher = ExtractStatsValue(
- StatsReport::kStatsReportTypeComponent,
- reports,
- StatsReport::kStatsValueNameSrtpCipher);
- EXPECT_EQ("the-srtp-cipher", srtp_cipher);
+ dtls_cipher_suite);
+ std::string srtp_crypto_suite =
+ ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports,
+ StatsReport::kStatsValueNameSrtpCipher);
+ EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::SRTP_AES128_CM_SHA1_80),
+ srtp_crypto_suite);
}
cricket::FakeMediaEngine* media_engine_;
@@ -1407,16 +1404,14 @@ TEST_F(StatsCollectorTest, NoTransport) {
ASSERT_EQ(kNotFound, remote_certificate_id);
// Check that the negotiated ciphers are absent.
- std::string dtls_cipher = ExtractStatsValue(
- StatsReport::kStatsReportTypeComponent,
- reports,
- StatsReport::kStatsValueNameDtlsCipher);
- ASSERT_EQ(kNotFound, dtls_cipher);
- std::string srtp_cipher = ExtractStatsValue(
- StatsReport::kStatsReportTypeComponent,
- reports,
- StatsReport::kStatsValueNameSrtpCipher);
- ASSERT_EQ(kNotFound, srtp_cipher);
+ std::string dtls_cipher_suite =
+ ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports,
+ StatsReport::kStatsValueNameDtlsCipher);
+ ASSERT_EQ(kNotFound, dtls_cipher_suite);
+ std::string srtp_crypto_suite =
+ ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports,
+ StatsReport::kStatsValueNameSrtpCipher);
+ ASSERT_EQ(kNotFound, srtp_crypto_suite);
}
// This test verifies that the stats are generated correctly when the transport