diff options
author | Henrik Boström <hbos@webrtc.org> | 2015-08-11 10:33:13 +0200 |
---|---|---|
committer | Henrik Boström <hbos@webrtc.org> | 2015-08-11 08:33:27 +0000 |
commit | 5e56c5927e097f095aef2e9f7be49fd3d59221e1 (patch) | |
tree | dc86ad40e5c14c3791fbfd1513c7b8897efd0280 /talk/app/webrtc/peerconnectionfactory_unittest.cc | |
parent | 0365a27f56aa2d2376d2f356bf70d161c3450244 (diff) | |
download | webrtc-5e56c5927e097f095aef2e9f7be49fd3d59221e1.tar.gz |
DtlsIdentityStoreInterface added and the implementation is called DtlsIdentityStoreImpl (previously named without the -Impl bit and without an interface).
DtlsIdentityStoreImpl is updated to take KeyType into account, something which will be relevant after this CL lands:
https://codereview.webrtc.org/1189583002
The DtlsIdentityService[Interface] classes are about to be removed (to be removed when Chromium no longer implements and uses the interface). This was an unnecessary layer of complexity. The FakeIdentityService is now instead a FakeDtlsIdentityStore.
Where a service was previously passed around, a store is now passed around.
Identity generation is now commonly performed using DtlsIdentityStoreInterface. Previously, if a service was not specified, WebRtcSessionDescriptionFactory could fall back on its own generation code. Now, a store has to be provided for generation to occur.
For more information about the steps being taken to land this without breaking Chromium, see referenced bug.
BUG=webrtc:4899
R=magjed@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1176383004 .
Cr-Commit-Position: refs/heads/master@{#9696}
Diffstat (limited to 'talk/app/webrtc/peerconnectionfactory_unittest.cc')
-rw-r--r-- | talk/app/webrtc/peerconnectionfactory_unittest.cc | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/talk/app/webrtc/peerconnectionfactory_unittest.cc b/talk/app/webrtc/peerconnectionfactory_unittest.cc index 8088588852..8cf08f549b 100644 --- a/talk/app/webrtc/peerconnectionfactory_unittest.cc +++ b/talk/app/webrtc/peerconnectionfactory_unittest.cc @@ -30,7 +30,7 @@ #include "talk/app/webrtc/fakeportallocatorfactory.h" #include "talk/app/webrtc/mediastreaminterface.h" #include "talk/app/webrtc/peerconnectionfactory.h" -#include "talk/app/webrtc/test/fakedtlsidentityservice.h" +#include "talk/app/webrtc/test/fakedtlsidentitystore.h" #include "talk/app/webrtc/test/fakevideotrackrenderer.h" #include "talk/app/webrtc/videosourceinterface.h" #include "talk/media/base/fakevideocapturer.h" @@ -40,8 +40,9 @@ #include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread.h" -using webrtc::FakeVideoTrackRenderer; using webrtc::DataChannelInterface; +using webrtc::DtlsIdentityStoreInterface; +using webrtc::FakeVideoTrackRenderer; using webrtc::MediaStreamInterface; using webrtc::PeerConnectionFactoryInterface; using webrtc::PeerConnectionInterface; @@ -157,11 +158,13 @@ TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) { NullPeerConnectionObserver observer; webrtc::PeerConnectionInterface::IceServers servers; + rtc::scoped_ptr<FakeDtlsIdentityStore> dtls_identity_store( + new FakeDtlsIdentityStore()); rtc::scoped_refptr<PeerConnectionInterface> pc( factory->CreatePeerConnection( - servers, NULL, NULL, new FakeIdentityService(), &observer)); + servers, nullptr, nullptr, dtls_identity_store.Pass(), &observer)); - EXPECT_TRUE(pc.get() != NULL); + EXPECT_TRUE(pc.get() != nullptr); } // This test verifies creation of PeerConnection with valid STUN and TURN @@ -177,10 +180,12 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) { ice_server.uri = kTurnIceServerWithTransport; ice_server.password = kTurnPassword; config.servers.push_back(ice_server); + rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( + new FakeDtlsIdentityStore()); rtc::scoped_refptr<PeerConnectionInterface> pc( - factory_->CreatePeerConnection(config, NULL, + factory_->CreatePeerConnection(config, nullptr, allocator_factory_.get(), - new FakeIdentityService(), + dtls_identity_store.Pass(), &observer_)); EXPECT_TRUE(pc.get() != NULL); StunConfigurations stun_configs; @@ -209,10 +214,12 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) { ice_server.urls.push_back(kTurnIceServerWithTransport); ice_server.password = kTurnPassword; config.servers.push_back(ice_server); + rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( + new FakeDtlsIdentityStore()); rtc::scoped_refptr<PeerConnectionInterface> pc( - factory_->CreatePeerConnection(config, NULL, + factory_->CreatePeerConnection(config, nullptr, allocator_factory_.get(), - new FakeIdentityService(), + dtls_identity_store.Pass(), &observer_)); EXPECT_TRUE(pc.get() != NULL); StunConfigurations stun_configs; @@ -245,10 +252,12 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersOldSignature) { ice_server.uri = kTurnIceServerWithTransport; ice_server.password = kTurnPassword; ice_servers.push_back(ice_server); + rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( + new FakeDtlsIdentityStore()); rtc::scoped_refptr<PeerConnectionInterface> pc( - factory_->CreatePeerConnection(ice_servers, NULL, + factory_->CreatePeerConnection(ice_servers, nullptr, allocator_factory_.get(), - new FakeIdentityService(), + dtls_identity_store.Pass(), &observer_)); EXPECT_TRUE(pc.get() != NULL); StunConfigurations stun_configs; @@ -275,10 +284,12 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) { ice_server.username = kTurnUsername; ice_server.password = kTurnPassword; config.servers.push_back(ice_server); + rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( + new FakeDtlsIdentityStore()); rtc::scoped_refptr<PeerConnectionInterface> pc( - factory_->CreatePeerConnection(config, NULL, + factory_->CreatePeerConnection(config, nullptr, allocator_factory_.get(), - new FakeIdentityService(), + dtls_identity_store.Pass(), &observer_)); EXPECT_TRUE(pc.get() != NULL); TurnConfigurations turn_configs; @@ -296,10 +307,12 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) { ice_server.uri = kTurnIceServerWithTransport; ice_server.password = kTurnPassword; config.servers.push_back(ice_server); + rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( + new FakeDtlsIdentityStore()); rtc::scoped_refptr<PeerConnectionInterface> pc( - factory_->CreatePeerConnection(config, NULL, + factory_->CreatePeerConnection(config, nullptr, allocator_factory_.get(), - new FakeIdentityService(), + dtls_identity_store.Pass(), &observer_)); EXPECT_TRUE(pc.get() != NULL); TurnConfigurations turn_configs; @@ -321,10 +334,12 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) { ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam; ice_server.password = kTurnPassword; config.servers.push_back(ice_server); + rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( + new FakeDtlsIdentityStore()); rtc::scoped_refptr<PeerConnectionInterface> pc( - factory_->CreatePeerConnection(config, NULL, + factory_->CreatePeerConnection(config, nullptr, allocator_factory_.get(), - new FakeIdentityService(), + dtls_identity_store.Pass(), &observer_)); EXPECT_TRUE(pc.get() != NULL); TurnConfigurations turn_configs; @@ -358,10 +373,12 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIPLiteralAddress) { ice_server.uri = kTurnIceServerWithIPv6Address; ice_server.password = kTurnPassword; config.servers.push_back(ice_server); + rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( + new FakeDtlsIdentityStore()); rtc::scoped_refptr<PeerConnectionInterface> pc( - factory_->CreatePeerConnection(config, NULL, + factory_->CreatePeerConnection(config, nullptr, allocator_factory_.get(), - new FakeIdentityService(), + dtls_identity_store.Pass(), &observer_)); EXPECT_TRUE(pc.get() != NULL); StunConfigurations stun_configs; |