(Auto)update libjingle 65561104-> 65619249
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5983 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
2eceb8ef46
commit
ff90ed6e96
@ -470,10 +470,17 @@ class PortTest : public testing::Test, public sigslot::has_slots<> {
|
||||
TurnPort* CreateTurnPort(const SocketAddress& addr,
|
||||
PacketSocketFactory* socket_factory,
|
||||
ProtocolType int_proto, ProtocolType ext_proto) {
|
||||
return CreateTurnPort(addr, socket_factory,
|
||||
int_proto, ext_proto, kTurnUdpIntAddr);
|
||||
}
|
||||
TurnPort* CreateTurnPort(const SocketAddress& addr,
|
||||
PacketSocketFactory* socket_factory,
|
||||
ProtocolType int_proto, ProtocolType ext_proto,
|
||||
const talk_base::SocketAddress& server_addr) {
|
||||
TurnPort* port = TurnPort::Create(main_, socket_factory, &network_,
|
||||
addr.ipaddr(), 0, 0,
|
||||
username_, password_, ProtocolAddress(
|
||||
kTurnUdpIntAddr, PROTO_UDP),
|
||||
server_addr, PROTO_UDP),
|
||||
kRelayCredentials);
|
||||
port->SetIceProtocolType(ice_protocol_);
|
||||
return port;
|
||||
@ -2168,20 +2175,39 @@ TEST_F(PortTest, TestCandidateFoundation) {
|
||||
EXPECT_NE(udpport2->Candidates()[0].foundation(),
|
||||
relayport->Candidates()[0].foundation());
|
||||
// Verifying TURN candidate foundation.
|
||||
talk_base::scoped_ptr<Port> turnport(CreateTurnPort(
|
||||
talk_base::scoped_ptr<Port> turnport1(CreateTurnPort(
|
||||
kLocalAddr1, nat_socket_factory1(), PROTO_UDP, PROTO_UDP));
|
||||
turnport->PrepareAddress();
|
||||
ASSERT_EQ_WAIT(2U, turnport->Candidates().size(), kTimeout);
|
||||
EXPECT_NE(turnport->Candidates()[0].foundation(),
|
||||
turnport->Candidates()[1].foundation());
|
||||
turnport1->PrepareAddress();
|
||||
ASSERT_EQ_WAIT(2U, turnport1->Candidates().size(), kTimeout);
|
||||
EXPECT_NE(turnport1->Candidates()[0].foundation(),
|
||||
turnport1->Candidates()[1].foundation());
|
||||
EXPECT_NE(udpport1->Candidates()[0].foundation(),
|
||||
turnport->Candidates()[1].foundation());
|
||||
turnport1->Candidates()[1].foundation());
|
||||
EXPECT_NE(udpport2->Candidates()[0].foundation(),
|
||||
turnport->Candidates()[1].foundation());
|
||||
turnport1->Candidates()[1].foundation());
|
||||
EXPECT_NE(stunport->Candidates()[0].foundation(),
|
||||
turnport->Candidates()[1].foundation());
|
||||
turnport1->Candidates()[1].foundation());
|
||||
EXPECT_EQ(stunport->Candidates()[0].foundation(),
|
||||
turnport->Candidates()[0].foundation());
|
||||
turnport1->Candidates()[0].foundation());
|
||||
talk_base::scoped_ptr<Port> turnport2(CreateTurnPort(
|
||||
kLocalAddr1, nat_socket_factory1(), PROTO_UDP, PROTO_UDP));
|
||||
turnport2->PrepareAddress();
|
||||
ASSERT_EQ_WAIT(2U, turnport2->Candidates().size(), kTimeout);
|
||||
EXPECT_EQ(turnport1->Candidates()[1].foundation(),
|
||||
turnport2->Candidates()[1].foundation());
|
||||
|
||||
// Running a second turn server, to get different base IP address.
|
||||
SocketAddress kTurnUdpIntAddr2("99.99.98.4", STUN_SERVER_PORT);
|
||||
SocketAddress kTurnUdpExtAddr2("99.99.98.5", 0);
|
||||
TestTurnServer turn_server2(
|
||||
talk_base::Thread::Current(), kTurnUdpIntAddr2, kTurnUdpExtAddr2);
|
||||
talk_base::scoped_ptr<Port> turnport3(CreateTurnPort(
|
||||
kLocalAddr1, nat_socket_factory1(), PROTO_UDP, PROTO_UDP,
|
||||
kTurnUdpIntAddr2));
|
||||
turnport3->PrepareAddress();
|
||||
ASSERT_EQ_WAIT(2U, turnport3->Candidates().size(), kTimeout);
|
||||
EXPECT_NE(turnport3->Candidates()[1].foundation(),
|
||||
turnport2->Candidates()[1].foundation());
|
||||
}
|
||||
|
||||
// This test verifies the related addresses of different types of
|
||||
|
||||
@ -482,9 +482,9 @@ void TurnPort::OnSendStunPacket(const void* data, size_t size,
|
||||
void TurnPort::OnStunAddress(const talk_base::SocketAddress& address) {
|
||||
if (server_address_.proto == PROTO_UDP &&
|
||||
address != socket_->GetLocalAddress()) {
|
||||
AddAddress(address,
|
||||
socket_->GetLocalAddress(),
|
||||
socket_->GetLocalAddress(),
|
||||
AddAddress(address, // Candidate address.
|
||||
socket_->GetLocalAddress(), // Base address.
|
||||
socket_->GetLocalAddress(), // Related address.
|
||||
UDP_PROTOCOL_NAME,
|
||||
STUN_PORT_TYPE,
|
||||
ICE_TYPE_PREFERENCE_SRFLX,
|
||||
@ -494,10 +494,11 @@ void TurnPort::OnStunAddress(const talk_base::SocketAddress& address) {
|
||||
|
||||
void TurnPort::OnAllocateSuccess(const talk_base::SocketAddress& address,
|
||||
const talk_base::SocketAddress& stun_address) {
|
||||
// For relayed candidate, Base is the candidate itself.
|
||||
connected_ = true;
|
||||
AddAddress(address,
|
||||
socket_->GetLocalAddress(),
|
||||
stun_address,
|
||||
AddAddress(address, // Candidate Address
|
||||
address, // Base Address
|
||||
stun_address, // Related address.
|
||||
UDP_PROTOCOL_NAME,
|
||||
RELAY_PORT_TYPE,
|
||||
GetRelayPreference(server_address_.proto, server_address_.secure),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user