OLD | NEW |
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 Loading... |
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 Loading... |
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 dtls_identity_store_.reset(rtc::SSLStreamAdapter::HaveDtlsSrtp() ? |
785 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? | 786 new FakeDtlsIdentityStoreRSA() : nullptr); |
786 new FakeIdentityService() : NULL; | |
787 return peer_connection_factory()->CreatePeerConnection( | 787 return peer_connection_factory()->CreatePeerConnection( |
788 ice_servers, constraints, factory, dtls_service, this); | 788 ice_servers, constraints, factory, this, dtls_identity_store_.get()); |
789 } | 789 } |
790 | 790 |
791 void HandleIncomingOffer(const std::string& msg) { | 791 void HandleIncomingOffer(const std::string& msg) { |
792 LOG(INFO) << id() << "HandleIncomingOffer "; | 792 LOG(INFO) << id() << "HandleIncomingOffer "; |
793 if (NumberOfLocalMediaStreams() == 0) { | 793 if (NumberOfLocalMediaStreams() == 0) { |
794 // If we are not sending any streams ourselves it is time to add some. | 794 // If we are not sending any streams ourselves it is time to add some. |
795 AddMediaStream(true, true); | 795 AddMediaStream(true, true); |
796 } | 796 } |
797 rtc::scoped_ptr<SessionDescriptionInterface> desc( | 797 rtc::scoped_ptr<SessionDescriptionInterface> desc( |
798 webrtc::CreateSessionDescription("offer", msg, NULL)); | 798 webrtc::CreateSessionDescription("offer", msg, NULL)); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 } | 891 } |
892 | 892 |
893 private: | 893 private: |
894 webrtc::FakeConstraints session_description_constraints_; | 894 webrtc::FakeConstraints session_description_constraints_; |
895 bool remove_msid_; // True if MSID should be removed in received SDP. | 895 bool remove_msid_; // True if MSID should be removed in received SDP. |
896 bool remove_bundle_; // True if bundle should be removed in received SDP. | 896 bool remove_bundle_; // True if bundle should be removed in received SDP. |
897 bool remove_sdes_; // True if a=crypto should be removed in received SDP. | 897 bool remove_sdes_; // True if a=crypto should be removed in received SDP. |
898 | 898 |
899 rtc::scoped_refptr<DataChannelInterface> data_channel_; | 899 rtc::scoped_refptr<DataChannelInterface> data_channel_; |
900 rtc::scoped_ptr<MockDataChannelObserver> data_observer_; | 900 rtc::scoped_ptr<MockDataChannelObserver> data_observer_; |
| 901 rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store_; |
901 }; | 902 }; |
902 | 903 |
903 template <typename SignalingClass> | 904 template <typename SignalingClass> |
904 class P2PTestConductor : public testing::Test { | 905 class P2PTestConductor : public testing::Test { |
905 public: | 906 public: |
906 P2PTestConductor() | 907 P2PTestConductor() |
907 : pss_(new rtc::PhysicalSocketServer), | 908 : pss_(new rtc::PhysicalSocketServer), |
908 ss_(new rtc::VirtualSocketServer(pss_.get())), | 909 ss_(new rtc::VirtualSocketServer(pss_.get())), |
909 ss_scope_(ss_.get()) {} | 910 ss_scope_(ss_.get()) {} |
910 | 911 |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) |
OLD | NEW |