OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2014 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 26 matching lines...) Expand all Loading... |
37 using testing::DoAll; | 37 using testing::DoAll; |
38 using testing::Field; | 38 using testing::Field; |
39 using testing::Return; | 39 using testing::Return; |
40 using testing::ReturnNull; | 40 using testing::ReturnNull; |
41 using testing::ReturnRef; | 41 using testing::ReturnRef; |
42 using testing::SetArgPointee; | 42 using testing::SetArgPointee; |
43 using webrtc::PeerConnectionInterface; | 43 using webrtc::PeerConnectionInterface; |
44 using webrtc::StatsReport; | 44 using webrtc::StatsReport; |
45 using webrtc::StatsReports; | 45 using webrtc::StatsReports; |
46 | 46 |
47 namespace { | |
48 // This value comes from openssl/tls1.h | |
49 const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014; | |
50 } // namespace | |
51 | |
52 namespace cricket { | 47 namespace cricket { |
53 | 48 |
54 class ChannelManager; | 49 class ChannelManager; |
55 | 50 |
56 } // namespace cricket | 51 } // namespace cricket |
57 | 52 |
58 namespace webrtc { | 53 namespace webrtc { |
59 | 54 |
| 55 namespace internal { |
| 56 // This value comes from openssl/tls1.h |
| 57 static const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014; |
| 58 } // namespace internal |
| 59 |
60 // Error return values | 60 // Error return values |
61 const char kNotFound[] = "NOT FOUND"; | 61 const char kNotFound[] = "NOT FOUND"; |
62 | 62 |
63 // Constant names for track identification. | 63 // Constant names for track identification. |
64 const char kLocalTrackId[] = "local_track_id"; | 64 const char kLocalTrackId[] = "local_track_id"; |
65 const char kRemoteTrackId[] = "remote_track_id"; | 65 const char kRemoteTrackId[] = "remote_track_id"; |
66 const uint32_t kSsrcOfTrack = 1234; | 66 const uint32_t kSsrcOfTrack = 1234; |
67 | 67 |
68 class MockWebRtcSession : public webrtc::WebRtcSession { | 68 class MockWebRtcSession : public webrtc::WebRtcSession { |
69 public: | 69 public: |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 const rtc::FakeSSLCertificate& remote_cert, | 667 const rtc::FakeSSLCertificate& remote_cert, |
668 const std::vector<std::string>& remote_ders) { | 668 const std::vector<std::string>& remote_ders) { |
669 StatsCollectorForTest stats(&pc_); | 669 StatsCollectorForTest stats(&pc_); |
670 | 670 |
671 StatsReports reports; // returned values. | 671 StatsReports reports; // returned values. |
672 | 672 |
673 // Fake stats to process. | 673 // Fake stats to process. |
674 cricket::TransportChannelStats channel_stats; | 674 cricket::TransportChannelStats channel_stats; |
675 channel_stats.component = 1; | 675 channel_stats.component = 1; |
676 channel_stats.srtp_crypto_suite = rtc::SRTP_AES128_CM_SHA1_80; | 676 channel_stats.srtp_crypto_suite = rtc::SRTP_AES128_CM_SHA1_80; |
677 channel_stats.ssl_cipher_suite = TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA; | 677 channel_stats.ssl_cipher_suite = |
| 678 internal::TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA; |
678 | 679 |
679 cricket::TransportStats transport_stats; | 680 cricket::TransportStats transport_stats; |
680 transport_stats.transport_name = "audio"; | 681 transport_stats.transport_name = "audio"; |
681 transport_stats.channel_stats.push_back(channel_stats); | 682 transport_stats.channel_stats.push_back(channel_stats); |
682 | 683 |
683 SessionStats session_stats; | 684 SessionStats session_stats; |
684 session_stats.transport_stats[transport_stats.transport_name] = | 685 session_stats.transport_stats[transport_stats.transport_name] = |
685 transport_stats; | 686 transport_stats; |
686 | 687 |
687 // Fake certificate to report | 688 // Fake certificate to report |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 CheckCertChainReports(reports, remote_ders, id); | 734 CheckCertChainReports(reports, remote_ders, id); |
734 } else { | 735 } else { |
735 EXPECT_EQ(kNotFound, remote_certificate_id); | 736 EXPECT_EQ(kNotFound, remote_certificate_id); |
736 } | 737 } |
737 | 738 |
738 // Check negotiated ciphers. | 739 // Check negotiated ciphers. |
739 std::string dtls_cipher_suite = | 740 std::string dtls_cipher_suite = |
740 ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports, | 741 ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports, |
741 StatsReport::kStatsValueNameDtlsCipher); | 742 StatsReport::kStatsValueNameDtlsCipher); |
742 EXPECT_EQ(rtc::SSLStreamAdapter::SslCipherSuiteToName( | 743 EXPECT_EQ(rtc::SSLStreamAdapter::SslCipherSuiteToName( |
743 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA), | 744 internal::TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA), |
744 dtls_cipher_suite); | 745 dtls_cipher_suite); |
745 std::string srtp_crypto_suite = | 746 std::string srtp_crypto_suite = |
746 ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports, | 747 ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports, |
747 StatsReport::kStatsValueNameSrtpCipher); | 748 StatsReport::kStatsValueNameSrtpCipher); |
748 EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::SRTP_AES128_CM_SHA1_80), | 749 EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::SRTP_AES128_CM_SHA1_80), |
749 srtp_crypto_suite); | 750 srtp_crypto_suite); |
750 } | 751 } |
751 | 752 |
752 cricket::FakeMediaEngine* media_engine_; | 753 cricket::FakeMediaEngine* media_engine_; |
753 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; | 754 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 cricket::VoiceSenderInfo new_voice_sender_info; | 1735 cricket::VoiceSenderInfo new_voice_sender_info; |
1735 InitVoiceSenderInfo(&new_voice_sender_info); | 1736 InitVoiceSenderInfo(&new_voice_sender_info); |
1736 cricket::VoiceMediaInfo new_stats_read; | 1737 cricket::VoiceMediaInfo new_stats_read; |
1737 reports.clear(); | 1738 reports.clear(); |
1738 SetupAndVerifyAudioTrackStats( | 1739 SetupAndVerifyAudioTrackStats( |
1739 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, | 1740 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, |
1740 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); | 1741 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); |
1741 } | 1742 } |
1742 | 1743 |
1743 } // namespace webrtc | 1744 } // namespace webrtc |
OLD | NEW |