| Index: webrtc/api/peerconnectioninterface_unittest.cc
|
| diff --git a/webrtc/api/peerconnectioninterface_unittest.cc b/webrtc/api/peerconnectioninterface_unittest.cc
|
| index 68c932b5aae1bacf9380a2613e114ee8e8f1c62c..795a66d7f61607b4135d7a90ec0f0a51834240a8 100644
|
| --- a/webrtc/api/peerconnectioninterface_unittest.cc
|
| +++ b/webrtc/api/peerconnectioninterface_unittest.cc
|
| @@ -39,7 +39,7 @@
|
| #include "webrtc/base/thread.h"
|
| #include "webrtc/media/base/fakevideocapturer.h"
|
| #include "webrtc/media/sctp/sctpdataengine.h"
|
| -#include "webrtc/p2p/base/fakeportallocator.h"
|
| +#include "webrtc/p2p/client/fakeportallocator.h"
|
| #include "webrtc/pc/mediasession.h"
|
|
|
| static const char kStreamLabel1[] = "local_stream_1";
|
| @@ -551,33 +551,24 @@ class PeerConnectionInterfaceTest : public testing::Test {
|
| }
|
|
|
| void CreatePeerConnection() {
|
| - CreatePeerConnection(PeerConnectionInterface::RTCConfiguration(), nullptr);
|
| + CreatePeerConnection("", "", NULL);
|
| }
|
|
|
| void CreatePeerConnection(webrtc::MediaConstraintsInterface* constraints) {
|
| - CreatePeerConnection(PeerConnectionInterface::RTCConfiguration(),
|
| - constraints);
|
| + CreatePeerConnection("", "", constraints);
|
| }
|
|
|
| - void CreatePeerConnectionWithIceTransportsType(
|
| - PeerConnectionInterface::IceTransportsType type) {
|
| - PeerConnectionInterface::RTCConfiguration config;
|
| - config.type = type;
|
| - return CreatePeerConnection(config, nullptr);
|
| - }
|
| -
|
| - void CreatePeerConnectionWithIceServer(const std::string& uri,
|
| - const std::string& password) {
|
| + void CreatePeerConnection(const std::string& uri,
|
| + const std::string& password,
|
| + webrtc::MediaConstraintsInterface* constraints) {
|
| PeerConnectionInterface::RTCConfiguration config;
|
| PeerConnectionInterface::IceServer server;
|
| - server.uri = uri;
|
| - server.password = password;
|
| - config.servers.push_back(server);
|
| - CreatePeerConnection(config, nullptr);
|
| - }
|
| + if (!uri.empty()) {
|
| + server.uri = uri;
|
| + server.password = password;
|
| + config.servers.push_back(server);
|
| + }
|
|
|
| - void CreatePeerConnection(PeerConnectionInterface::RTCConfiguration config,
|
| - webrtc::MediaConstraintsInterface* constraints) {
|
| std::unique_ptr<cricket::FakePortAllocator> port_allocator(
|
| new cricket::FakePortAllocator(rtc::Thread::Current(), nullptr));
|
| port_allocator_ = port_allocator.get();
|
| @@ -622,7 +613,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
|
| }
|
|
|
| void CreatePeerConnectionWithDifferentConfigurations() {
|
| - CreatePeerConnectionWithIceServer(kStunAddressOnly, "");
|
| + CreatePeerConnection(kStunAddressOnly, "", NULL);
|
| EXPECT_EQ(1u, port_allocator_->stun_servers().size());
|
| EXPECT_EQ(0u, port_allocator_->turn_servers().size());
|
| EXPECT_EQ("address", port_allocator_->stun_servers().begin()->hostname());
|
| @@ -633,7 +624,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
|
| CreatePeerConnectionExpectFail(kStunAddressPortAndMore1);
|
| CreatePeerConnectionExpectFail(kStunAddressPortAndMore2);
|
|
|
| - CreatePeerConnectionWithIceServer(kTurnIceServerUri, kTurnPassword);
|
| + CreatePeerConnection(kTurnIceServerUri, kTurnPassword, NULL);
|
| EXPECT_EQ(0u, port_allocator_->stun_servers().size());
|
| EXPECT_EQ(1u, port_allocator_->turn_servers().size());
|
| EXPECT_EQ(kTurnUsername,
|
| @@ -1023,44 +1014,6 @@ TEST_F(PeerConnectionInterfaceTest,
|
| CreatePeerConnectionWithDifferentConfigurations();
|
| }
|
|
|
| -TEST_F(PeerConnectionInterfaceTest,
|
| - CreatePeerConnectionWithDifferentIceTransportsTypes) {
|
| - CreatePeerConnectionWithIceTransportsType(PeerConnectionInterface::kNone);
|
| - EXPECT_EQ(cricket::CF_NONE, port_allocator_->candidate_filter());
|
| - CreatePeerConnectionWithIceTransportsType(PeerConnectionInterface::kRelay);
|
| - EXPECT_EQ(cricket::CF_RELAY, port_allocator_->candidate_filter());
|
| - CreatePeerConnectionWithIceTransportsType(PeerConnectionInterface::kNoHost);
|
| - EXPECT_EQ(cricket::CF_ALL & ~cricket::CF_HOST,
|
| - port_allocator_->candidate_filter());
|
| - CreatePeerConnectionWithIceTransportsType(PeerConnectionInterface::kAll);
|
| - EXPECT_EQ(cricket::CF_ALL, port_allocator_->candidate_filter());
|
| -}
|
| -
|
| -// Test that when a PeerConnection is created with a nonzero candidate pool
|
| -// size, the pooled PortAllocatorSession is created with all the attributes
|
| -// in the RTCConfiguration.
|
| -TEST_F(PeerConnectionInterfaceTest, CreatePeerConnectionWithPooledCandidates) {
|
| - PeerConnectionInterface::RTCConfiguration config;
|
| - PeerConnectionInterface::IceServer server;
|
| - server.uri = kStunAddressOnly;
|
| - config.servers.push_back(server);
|
| - config.type = PeerConnectionInterface::kRelay;
|
| - config.disable_ipv6 = true;
|
| - config.tcp_candidate_policy =
|
| - PeerConnectionInterface::kTcpCandidatePolicyDisabled;
|
| - config.ice_candidate_pool_size = 1;
|
| - CreatePeerConnection(config, nullptr);
|
| -
|
| - const cricket::FakePortAllocatorSession* session =
|
| - static_cast<const cricket::FakePortAllocatorSession*>(
|
| - port_allocator_->GetPooledSession());
|
| - ASSERT_NE(nullptr, session);
|
| - EXPECT_EQ(1UL, session->stun_servers().size());
|
| - EXPECT_EQ(0U, session->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6);
|
| - EXPECT_LT(0U, session->flags() & cricket::PORTALLOCATOR_DISABLE_TCP);
|
| - EXPECT_EQ(cricket::CF_RELAY, session->candidate_filter());
|
| -}
|
| -
|
| TEST_F(PeerConnectionInterfaceTest, AddStreams) {
|
| CreatePeerConnection();
|
| AddVideoStream(kStreamLabel1);
|
| @@ -1954,35 +1907,6 @@ TEST_F(PeerConnectionInterfaceTest, SetConfigurationChangesIceServers) {
|
| port_allocator_->stun_servers().begin()->hostname());
|
| }
|
|
|
| -TEST_F(PeerConnectionInterfaceTest, SetConfigurationChangesCandidateFilter) {
|
| - CreatePeerConnection();
|
| - PeerConnectionInterface::RTCConfiguration config;
|
| - config.type = PeerConnectionInterface::kRelay;
|
| - EXPECT_TRUE(pc_->SetConfiguration(config));
|
| - EXPECT_EQ(cricket::CF_RELAY, port_allocator_->candidate_filter());
|
| -}
|
| -
|
| -// Test that when SetConfiguration changes both the pool size and other
|
| -// attributes, the pooled session is created with the updated attributes.
|
| -TEST_F(PeerConnectionInterfaceTest,
|
| - SetConfigurationCreatesPooledSessionCorrectly) {
|
| - CreatePeerConnection();
|
| - PeerConnectionInterface::RTCConfiguration config;
|
| - config.ice_candidate_pool_size = 1;
|
| - PeerConnectionInterface::IceServer server;
|
| - server.uri = kStunAddressOnly;
|
| - config.servers.push_back(server);
|
| - config.type = PeerConnectionInterface::kRelay;
|
| - CreatePeerConnection(config, nullptr);
|
| -
|
| - const cricket::FakePortAllocatorSession* session =
|
| - static_cast<const cricket::FakePortAllocatorSession*>(
|
| - port_allocator_->GetPooledSession());
|
| - ASSERT_NE(nullptr, session);
|
| - EXPECT_EQ(1UL, session->stun_servers().size());
|
| - EXPECT_EQ(cricket::CF_RELAY, session->candidate_filter());
|
| -}
|
| -
|
| // Test that PeerConnection::Close changes the states to closed and all remote
|
| // tracks change state to ended.
|
| TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) {
|
|
|