Index: talk/app/webrtc/peerconnectionfactory_unittest.cc |
diff --git a/talk/app/webrtc/peerconnectionfactory_unittest.cc b/talk/app/webrtc/peerconnectionfactory_unittest.cc |
index 80885888522fbca032dc32853cc639214b634e68..65ef0edf3a001385d76db4ebc3adaf6384e6a9fd 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; |
@@ -144,6 +145,7 @@ class PeerConnectionFactoryTest : public testing::Test { |
} |
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory_; |
+ rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store_; |
NullPeerConnectionObserver observer_; |
rtc::scoped_refptr<PortAllocatorFactoryInterface> allocator_factory_; |
}; |
@@ -157,11 +159,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.get(), &observer)); |
- EXPECT_TRUE(pc.get() != NULL); |
+ EXPECT_TRUE(pc.get() != nullptr); |
} |
// This test verifies creation of PeerConnection with valid STUN and TURN |
@@ -177,10 +181,11 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) { |
ice_server.uri = kTurnIceServerWithTransport; |
ice_server.password = kTurnPassword; |
config.servers.push_back(ice_server); |
+ dtls_identity_store_.reset(new FakeDtlsIdentityStore()); |
rtc::scoped_refptr<PeerConnectionInterface> pc( |
- factory_->CreatePeerConnection(config, NULL, |
+ factory_->CreatePeerConnection(config, nullptr, |
allocator_factory_.get(), |
- new FakeIdentityService(), |
+ dtls_identity_store_.get(), |
&observer_)); |
EXPECT_TRUE(pc.get() != NULL); |
StunConfigurations stun_configs; |
@@ -209,10 +214,11 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) { |
ice_server.urls.push_back(kTurnIceServerWithTransport); |
ice_server.password = kTurnPassword; |
config.servers.push_back(ice_server); |
+ dtls_identity_store_.reset(new FakeDtlsIdentityStore()); |
rtc::scoped_refptr<PeerConnectionInterface> pc( |
- factory_->CreatePeerConnection(config, NULL, |
+ factory_->CreatePeerConnection(config, nullptr, |
allocator_factory_.get(), |
- new FakeIdentityService(), |
+ dtls_identity_store_.get(), |
&observer_)); |
EXPECT_TRUE(pc.get() != NULL); |
StunConfigurations stun_configs; |
@@ -245,10 +251,11 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersOldSignature) { |
ice_server.uri = kTurnIceServerWithTransport; |
ice_server.password = kTurnPassword; |
ice_servers.push_back(ice_server); |
+ dtls_identity_store_.reset(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_.get(), |
&observer_)); |
EXPECT_TRUE(pc.get() != NULL); |
StunConfigurations stun_configs; |
@@ -275,10 +282,11 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) { |
ice_server.username = kTurnUsername; |
ice_server.password = kTurnPassword; |
config.servers.push_back(ice_server); |
+ dtls_identity_store_.reset(new FakeDtlsIdentityStore()); |
rtc::scoped_refptr<PeerConnectionInterface> pc( |
- factory_->CreatePeerConnection(config, NULL, |
+ factory_->CreatePeerConnection(config, nullptr, |
allocator_factory_.get(), |
- new FakeIdentityService(), |
+ dtls_identity_store_.get(), |
&observer_)); |
EXPECT_TRUE(pc.get() != NULL); |
TurnConfigurations turn_configs; |
@@ -296,10 +304,11 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) { |
ice_server.uri = kTurnIceServerWithTransport; |
ice_server.password = kTurnPassword; |
config.servers.push_back(ice_server); |
+ dtls_identity_store_.reset(new FakeDtlsIdentityStore()); |
rtc::scoped_refptr<PeerConnectionInterface> pc( |
- factory_->CreatePeerConnection(config, NULL, |
+ factory_->CreatePeerConnection(config, nullptr, |
allocator_factory_.get(), |
- new FakeIdentityService(), |
+ dtls_identity_store_.get(), |
&observer_)); |
EXPECT_TRUE(pc.get() != NULL); |
TurnConfigurations turn_configs; |
@@ -321,10 +330,11 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) { |
ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam; |
ice_server.password = kTurnPassword; |
config.servers.push_back(ice_server); |
+ dtls_identity_store_.reset(new FakeDtlsIdentityStore()); |
rtc::scoped_refptr<PeerConnectionInterface> pc( |
- factory_->CreatePeerConnection(config, NULL, |
+ factory_->CreatePeerConnection(config, nullptr, |
allocator_factory_.get(), |
- new FakeIdentityService(), |
+ dtls_identity_store_.get(), |
&observer_)); |
EXPECT_TRUE(pc.get() != NULL); |
TurnConfigurations turn_configs; |
@@ -358,10 +368,11 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIPLiteralAddress) { |
ice_server.uri = kTurnIceServerWithIPv6Address; |
ice_server.password = kTurnPassword; |
config.servers.push_back(ice_server); |
+ dtls_identity_store_.reset(new FakeDtlsIdentityStore()); |
rtc::scoped_refptr<PeerConnectionInterface> pc( |
- factory_->CreatePeerConnection(config, NULL, |
+ factory_->CreatePeerConnection(config, nullptr, |
allocator_factory_.get(), |
- new FakeIdentityService(), |
+ dtls_identity_store_.get(), |
&observer_)); |
EXPECT_TRUE(pc.get() != NULL); |
StunConfigurations stun_configs; |