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

Side by Side Diff: talk/app/webrtc/statscollector_unittest.cc

Issue 1312643004: Replaces SSLIdentity* with scoped_refptr<RTCCertificate> in cricket::Transport layer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 649
650 cricket::TransportStats transport_stats; 650 cricket::TransportStats transport_stats;
651 transport_stats.content_name = "audio"; 651 transport_stats.content_name = "audio";
652 transport_stats.channel_stats.push_back(channel_stats); 652 transport_stats.channel_stats.push_back(channel_stats);
653 653
654 cricket::SessionStats session_stats; 654 cricket::SessionStats session_stats;
655 session_stats.transport_stats[transport_stats.content_name] = 655 session_stats.transport_stats[transport_stats.content_name] =
656 transport_stats; 656 transport_stats;
657 657
658 // Fake certificates to report. 658 // Fake certificates to report.
659 rtc::FakeSSLIdentity local_identity(local_cert); 659 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate(
660 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::FakeSSLIdentity>(
661 new rtc::FakeSSLIdentity(local_cert)).Pass()));
660 rtc::scoped_ptr<rtc::FakeSSLCertificate> remote_cert_copy( 662 rtc::scoped_ptr<rtc::FakeSSLCertificate> remote_cert_copy(
661 remote_cert.GetReference()); 663 remote_cert.GetReference());
662 664
663 // Fake transport object. 665 // Fake transport object.
664 rtc::scoped_ptr<cricket::FakeTransport> transport( 666 rtc::scoped_ptr<cricket::FakeTransport> transport(
665 new cricket::FakeTransport( 667 new cricket::FakeTransport(
666 session_.signaling_thread(), 668 session_.signaling_thread(),
667 session_.worker_thread(), 669 session_.worker_thread(),
668 transport_stats.content_name)); 670 transport_stats.content_name));
669 transport->SetIdentity(&local_identity); 671 transport->SetCertificate(local_certificate);
670 cricket::FakeTransportChannel* channel = 672 cricket::FakeTransportChannel* channel =
671 static_cast<cricket::FakeTransportChannel*>( 673 static_cast<cricket::FakeTransportChannel*>(
672 transport->CreateChannel(channel_stats.component)); 674 transport->CreateChannel(channel_stats.component));
673 EXPECT_FALSE(channel == NULL); 675 EXPECT_FALSE(channel == NULL);
674 channel->SetRemoteCertificate(remote_cert_copy.get()); 676 channel->SetRemoteCertificate(remote_cert_copy.get());
675 677
676 // Configure MockWebRtcSession 678 // Configure MockWebRtcSession
677 EXPECT_CALL(session_, GetTransport(transport_stats.content_name)) 679 EXPECT_CALL(session_, GetTransport(transport_stats.content_name))
678 .WillRepeatedly(Return(transport.get())); 680 .WillRepeatedly(Return(transport.get()));
679 EXPECT_CALL(session_, GetTransportStats(_)) 681 EXPECT_CALL(session_, GetTransportStats(_))
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 cricket::VoiceSenderInfo new_voice_sender_info; 1704 cricket::VoiceSenderInfo new_voice_sender_info;
1703 InitVoiceSenderInfo(&new_voice_sender_info); 1705 InitVoiceSenderInfo(&new_voice_sender_info);
1704 cricket::VoiceMediaInfo new_stats_read; 1706 cricket::VoiceMediaInfo new_stats_read;
1705 reports.clear(); 1707 reports.clear();
1706 SetupAndVerifyAudioTrackStats( 1708 SetupAndVerifyAudioTrackStats(
1707 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, 1709 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName,
1708 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); 1710 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports);
1709 } 1711 }
1710 1712
1711 } // namespace webrtc 1713 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698