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

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

Issue 1176383004: DtlsIdentityStore[Interface/Impl] updated, DtlsIdentityService to be removed (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed rest of tommi's comments: Removed need for lock Created 5 years, 5 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 2012 Google Inc. 3 * Copyright 2012 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 22 matching lines...) Expand all
33 #include <vector> 33 #include <vector>
34 34
35 #include "talk/app/webrtc/dtmfsender.h" 35 #include "talk/app/webrtc/dtmfsender.h"
36 #include "talk/app/webrtc/fakeportallocatorfactory.h" 36 #include "talk/app/webrtc/fakeportallocatorfactory.h"
37 #include "talk/app/webrtc/localaudiosource.h" 37 #include "talk/app/webrtc/localaudiosource.h"
38 #include "talk/app/webrtc/mediastreaminterface.h" 38 #include "talk/app/webrtc/mediastreaminterface.h"
39 #include "talk/app/webrtc/peerconnectionfactory.h" 39 #include "talk/app/webrtc/peerconnectionfactory.h"
40 #include "talk/app/webrtc/peerconnectioninterface.h" 40 #include "talk/app/webrtc/peerconnectioninterface.h"
41 #include "talk/app/webrtc/test/fakeaudiocapturemodule.h" 41 #include "talk/app/webrtc/test/fakeaudiocapturemodule.h"
42 #include "talk/app/webrtc/test/fakeconstraints.h" 42 #include "talk/app/webrtc/test/fakeconstraints.h"
43 #include "talk/app/webrtc/test/fakedtlsidentityservice.h" 43 #include "talk/app/webrtc/test/fakedtlsidentitystore.h"
44 #include "talk/app/webrtc/test/fakeperiodicvideocapturer.h" 44 #include "talk/app/webrtc/test/fakeperiodicvideocapturer.h"
45 #include "talk/app/webrtc/test/fakevideotrackrenderer.h" 45 #include "talk/app/webrtc/test/fakevideotrackrenderer.h"
46 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h" 46 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h"
47 #include "talk/app/webrtc/videosourceinterface.h" 47 #include "talk/app/webrtc/videosourceinterface.h"
48 #include "talk/media/webrtc/fakewebrtcvideoengine.h" 48 #include "talk/media/webrtc/fakewebrtcvideoengine.h"
49 #include "talk/session/media/mediasession.h" 49 #include "talk/session/media/mediasession.h"
50 #include "webrtc/base/gunit.h" 50 #include "webrtc/base/gunit.h"
51 #include "webrtc/base/physicalsocketserver.h" 51 #include "webrtc/base/physicalsocketserver.h"
52 #include "webrtc/base/scoped_ptr.h" 52 #include "webrtc/base/scoped_ptr.h"
53 #include "webrtc/base/ssladapter.h" 53 #include "webrtc/base/ssladapter.h"
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 } 765 }
766 766
767 protected: 767 protected:
768 explicit JsepTestClient(const std::string& id) 768 explicit JsepTestClient(const std::string& id)
769 : PeerConnectionTestClientBase<JsepMessageReceiver>(id), 769 : PeerConnectionTestClientBase<JsepMessageReceiver>(id),
770 remove_msid_(false), 770 remove_msid_(false),
771 remove_bundle_(false), 771 remove_bundle_(false),
772 remove_sdes_(false) { 772 remove_sdes_(false) {
773 } 773 }
774 774
775 virtual rtc::scoped_refptr<webrtc::PeerConnectionInterface> 775 rtc::scoped_refptr<webrtc::PeerConnectionInterface>
776 CreatePeerConnection(webrtc::PortAllocatorFactoryInterface* factory, 776 CreatePeerConnection(
777 const MediaConstraintsInterface* constraints) { 777 webrtc::PortAllocatorFactoryInterface* factory,
778 const MediaConstraintsInterface* constraints) override {
778 // CreatePeerConnection with IceServers. 779 // CreatePeerConnection with IceServers.
779 webrtc::PeerConnectionInterface::IceServers ice_servers; 780 webrtc::PeerConnectionInterface::IceServers ice_servers;
780 webrtc::PeerConnectionInterface::IceServer ice_server; 781 webrtc::PeerConnectionInterface::IceServer ice_server;
781 ice_server.uri = "stun:stun.l.google.com:19302"; 782 ice_server.uri = "stun:stun.l.google.com:19302";
782 ice_servers.push_back(ice_server); 783 ice_servers.push_back(ice_server);
783 784
784 FakeIdentityService* dtls_service = 785 rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store(
785 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? 786 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? new FakeDtlsIdentityStore()
786 new FakeIdentityService() : NULL; 787 : nullptr);
787 return peer_connection_factory()->CreatePeerConnection( 788 return peer_connection_factory()->CreatePeerConnection(
788 ice_servers, constraints, factory, dtls_service, this); 789 ice_servers, constraints, factory, dtls_identity_store.Pass(), this);
789 } 790 }
790 791
791 void HandleIncomingOffer(const std::string& msg) { 792 void HandleIncomingOffer(const std::string& msg) {
792 LOG(INFO) << id() << "HandleIncomingOffer "; 793 LOG(INFO) << id() << "HandleIncomingOffer ";
793 if (NumberOfLocalMediaStreams() == 0) { 794 if (NumberOfLocalMediaStreams() == 0) {
794 // If we are not sending any streams ourselves it is time to add some. 795 // If we are not sending any streams ourselves it is time to add some.
795 AddMediaStream(true, true); 796 AddMediaStream(true, true);
796 } 797 }
797 rtc::scoped_ptr<SessionDescriptionInterface> desc( 798 rtc::scoped_ptr<SessionDescriptionInterface> desc(
798 webrtc::CreateSessionDescription("offer", msg, NULL)); 799 webrtc::CreateSessionDescription("offer", msg, NULL));
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 // TODO(holmer): Disabled due to sometimes crashing on buildbots. 1577 // TODO(holmer): Disabled due to sometimes crashing on buildbots.
1577 // See issue webrtc/2378. 1578 // See issue webrtc/2378.
1578 TEST_F(JsepPeerConnectionP2PTestClient, 1579 TEST_F(JsepPeerConnectionP2PTestClient,
1579 DISABLED_LocalP2PTestWithVideoDecoderFactory) { 1580 DISABLED_LocalP2PTestWithVideoDecoderFactory) {
1580 ASSERT_TRUE(CreateTestClients()); 1581 ASSERT_TRUE(CreateTestClients());
1581 EnableVideoDecoderFactory(); 1582 EnableVideoDecoderFactory();
1582 LocalP2PTest(); 1583 LocalP2PTest();
1583 } 1584 }
1584 1585
1585 #endif // if !defined(THREAD_SANITIZER) 1586 #endif // if !defined(THREAD_SANITIZER)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698