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

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

Issue 1269843005: Added DtlsCertificate, a ref counted object owning an SSLIdentity (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Trying to get iOS to compile 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<webrtc::DtlsCertificate> local_dtlscert =
660 webrtc::DtlsCertificate::Create(
661 rtc::scoped_ptr<rtc::FakeSSLIdentity>(
662 new rtc::FakeSSLIdentity(local_cert)).Pass());
660 rtc::scoped_ptr<rtc::FakeSSLCertificate> remote_cert_copy( 663 rtc::scoped_ptr<rtc::FakeSSLCertificate> remote_cert_copy(
661 remote_cert.GetReference()); 664 remote_cert.GetReference());
662 665
663 // Fake transport object. 666 // Fake transport object.
664 rtc::scoped_ptr<cricket::FakeTransport> transport( 667 rtc::scoped_ptr<cricket::FakeTransport> transport(
665 new cricket::FakeTransport( 668 new cricket::FakeTransport(
666 session_.signaling_thread(), 669 session_.signaling_thread(),
667 session_.worker_thread(), 670 session_.worker_thread(),
668 transport_stats.content_name)); 671 transport_stats.content_name));
669 transport->SetIdentity(&local_identity); 672 transport->SetCertificate(local_dtlscert);
Henrik Grunell WebRTC 2015/08/12 14:46:30 As we talked about offline, it would be nice to sp
hbos 2015/08/14 14:09:39 If I see this clearly I think adding support for b
Henrik Grunell WebRTC 2015/08/18 14:25:11 Acknowledged.
670 cricket::FakeTransportChannel* channel = 673 cricket::FakeTransportChannel* channel =
671 static_cast<cricket::FakeTransportChannel*>( 674 static_cast<cricket::FakeTransportChannel*>(
672 transport->CreateChannel(channel_stats.component)); 675 transport->CreateChannel(channel_stats.component));
673 EXPECT_FALSE(channel == NULL); 676 EXPECT_FALSE(channel == NULL);
674 channel->SetRemoteCertificate(remote_cert_copy.get()); 677 channel->SetRemoteCertificate(remote_cert_copy.get());
675 678
676 // Configure MockWebRtcSession 679 // Configure MockWebRtcSession
677 EXPECT_CALL(session_, GetTransport(transport_stats.content_name)) 680 EXPECT_CALL(session_, GetTransport(transport_stats.content_name))
678 .WillRepeatedly(Return(transport.get())); 681 .WillRepeatedly(Return(transport.get()));
679 EXPECT_CALL(session_, GetTransportStats(_)) 682 EXPECT_CALL(session_, GetTransportStats(_))
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 cricket::VoiceSenderInfo new_voice_sender_info; 1705 cricket::VoiceSenderInfo new_voice_sender_info;
1703 InitVoiceSenderInfo(&new_voice_sender_info); 1706 InitVoiceSenderInfo(&new_voice_sender_info);
1704 cricket::VoiceMediaInfo new_stats_read; 1707 cricket::VoiceMediaInfo new_stats_read;
1705 reports.clear(); 1708 reports.clear();
1706 SetupAndVerifyAudioTrackStats( 1709 SetupAndVerifyAudioTrackStats(
1707 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, 1710 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName,
1708 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); 1711 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports);
1709 } 1712 }
1710 1713
1711 } // namespace webrtc 1714 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698