| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 using testing::_; | 52 using testing::_; |
| 53 using testing::DoAll; | 53 using testing::DoAll; |
| 54 using testing::Field; | 54 using testing::Field; |
| 55 using testing::Return; | 55 using testing::Return; |
| 56 using testing::ReturnNull; | 56 using testing::ReturnNull; |
| 57 using testing::SetArgPointee; | 57 using testing::SetArgPointee; |
| 58 using webrtc::PeerConnectionInterface; | 58 using webrtc::PeerConnectionInterface; |
| 59 using webrtc::StatsReport; | 59 using webrtc::StatsReport; |
| 60 using webrtc::StatsReports; | 60 using webrtc::StatsReports; |
| 61 | 61 |
| 62 namespace { | |
| 63 // This value comes from openssl/tls1.h | |
| 64 const uint16_t TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014; | |
| 65 } // namespace | |
| 66 | |
| 67 namespace cricket { | 62 namespace cricket { |
| 68 | 63 |
| 69 class ChannelManager; | 64 class ChannelManager; |
| 70 | 65 |
| 71 } // namespace cricket | 66 } // namespace cricket |
| 72 | 67 |
| 73 namespace webrtc { | 68 namespace webrtc { |
| 74 | 69 |
| 75 // Error return values | 70 // Error return values |
| 76 const char kNotFound[] = "NOT FOUND"; | 71 const char kNotFound[] = "NOT FOUND"; |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 const rtc::FakeSSLCertificate& remote_cert, | 640 const rtc::FakeSSLCertificate& remote_cert, |
| 646 const std::vector<std::string>& remote_ders) { | 641 const std::vector<std::string>& remote_ders) { |
| 647 StatsCollectorForTest stats(&session_); | 642 StatsCollectorForTest stats(&session_); |
| 648 | 643 |
| 649 StatsReports reports; // returned values. | 644 StatsReports reports; // returned values. |
| 650 | 645 |
| 651 // Fake stats to process. | 646 // Fake stats to process. |
| 652 cricket::TransportChannelStats channel_stats; | 647 cricket::TransportChannelStats channel_stats; |
| 653 channel_stats.component = 1; | 648 channel_stats.component = 1; |
| 654 channel_stats.srtp_cipher = "the-srtp-cipher"; | 649 channel_stats.srtp_cipher = "the-srtp-cipher"; |
| 655 channel_stats.ssl_cipher = TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA; | 650 channel_stats.ssl_cipher = "the-ssl-cipher"; |
| 656 | 651 |
| 657 cricket::TransportStats transport_stats; | 652 cricket::TransportStats transport_stats; |
| 658 transport_stats.transport_name = "audio"; | 653 transport_stats.transport_name = "audio"; |
| 659 transport_stats.channel_stats.push_back(channel_stats); | 654 transport_stats.channel_stats.push_back(channel_stats); |
| 660 | 655 |
| 661 cricket::SessionStats session_stats; | 656 cricket::SessionStats session_stats; |
| 662 session_stats.transport_stats[transport_stats.transport_name] = | 657 session_stats.transport_stats[transport_stats.transport_name] = |
| 663 transport_stats; | 658 transport_stats; |
| 664 | 659 |
| 665 // Fake certificate to report | 660 // Fake certificate to report |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 CheckCertChainReports(reports, remote_ders, id); | 709 CheckCertChainReports(reports, remote_ders, id); |
| 715 } else { | 710 } else { |
| 716 EXPECT_EQ(kNotFound, remote_certificate_id); | 711 EXPECT_EQ(kNotFound, remote_certificate_id); |
| 717 } | 712 } |
| 718 | 713 |
| 719 // Check negotiated ciphers. | 714 // Check negotiated ciphers. |
| 720 std::string dtls_cipher = ExtractStatsValue( | 715 std::string dtls_cipher = ExtractStatsValue( |
| 721 StatsReport::kStatsReportTypeComponent, | 716 StatsReport::kStatsReportTypeComponent, |
| 722 reports, | 717 reports, |
| 723 StatsReport::kStatsValueNameDtlsCipher); | 718 StatsReport::kStatsValueNameDtlsCipher); |
| 724 EXPECT_EQ(rtc::SSLStreamAdapter::GetSslCipherSuiteName( | 719 EXPECT_EQ("the-ssl-cipher", dtls_cipher); |
| 725 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA), | |
| 726 dtls_cipher); | |
| 727 std::string srtp_cipher = ExtractStatsValue( | 720 std::string srtp_cipher = ExtractStatsValue( |
| 728 StatsReport::kStatsReportTypeComponent, | 721 StatsReport::kStatsReportTypeComponent, |
| 729 reports, | 722 reports, |
| 730 StatsReport::kStatsValueNameSrtpCipher); | 723 StatsReport::kStatsValueNameSrtpCipher); |
| 731 EXPECT_EQ("the-srtp-cipher", srtp_cipher); | 724 EXPECT_EQ("the-srtp-cipher", srtp_cipher); |
| 732 } | 725 } |
| 733 | 726 |
| 734 cricket::FakeMediaEngine* media_engine_; | 727 cricket::FakeMediaEngine* media_engine_; |
| 735 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; | 728 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; |
| 736 MockWebRtcSession session_; | 729 MockWebRtcSession session_; |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 cricket::VoiceSenderInfo new_voice_sender_info; | 1725 cricket::VoiceSenderInfo new_voice_sender_info; |
| 1733 InitVoiceSenderInfo(&new_voice_sender_info); | 1726 InitVoiceSenderInfo(&new_voice_sender_info); |
| 1734 cricket::VoiceMediaInfo new_stats_read; | 1727 cricket::VoiceMediaInfo new_stats_read; |
| 1735 reports.clear(); | 1728 reports.clear(); |
| 1736 SetupAndVerifyAudioTrackStats( | 1729 SetupAndVerifyAudioTrackStats( |
| 1737 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, | 1730 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, |
| 1738 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); | 1731 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); |
| 1739 } | 1732 } |
| 1740 | 1733 |
| 1741 } // namespace webrtc | 1734 } // namespace webrtc |
| OLD | NEW |