OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 void CreateSharedStunPort(const rtc::SocketAddress& server_addr) { | 76 void CreateSharedStunPort(const rtc::SocketAddress& server_addr) { |
77 socket_.reset(socket_factory_.CreateUdpSocket( | 77 socket_.reset(socket_factory_.CreateUdpSocket( |
78 rtc::SocketAddress(kLocalAddr.ipaddr(), 0), 0, 0)); | 78 rtc::SocketAddress(kLocalAddr.ipaddr(), 0), 0, 0)); |
79 ASSERT_TRUE(socket_ != NULL); | 79 ASSERT_TRUE(socket_ != NULL); |
80 socket_->SignalReadPacket.connect(this, &StunPortTest::OnReadPacket); | 80 socket_->SignalReadPacket.connect(this, &StunPortTest::OnReadPacket); |
81 stun_port_.reset(cricket::UDPPort::Create( | 81 stun_port_.reset(cricket::UDPPort::Create( |
82 rtc::Thread::Current(), &socket_factory_, | 82 rtc::Thread::Current(), &socket_factory_, |
83 &network_, socket_.get(), | 83 &network_, socket_.get(), |
84 rtc::CreateRandomString(16), rtc::CreateRandomString(22), | 84 rtc::CreateRandomString(16), rtc::CreateRandomString(22), |
85 std::string())); | 85 std::string(), false)); |
86 ASSERT_TRUE(stun_port_ != NULL); | 86 ASSERT_TRUE(stun_port_ != NULL); |
87 ServerAddresses stun_servers; | 87 ServerAddresses stun_servers; |
88 stun_servers.insert(server_addr); | 88 stun_servers.insert(server_addr); |
89 stun_port_->set_server_addresses(stun_servers); | 89 stun_port_->set_server_addresses(stun_servers); |
90 stun_port_->SignalPortComplete.connect(this, | 90 stun_port_->SignalPortComplete.connect(this, |
91 &StunPortTest::OnPortComplete); | 91 &StunPortTest::OnPortComplete); |
92 stun_port_->SignalPortError.connect(this, | 92 stun_port_->SignalPortError.connect(this, |
93 &StunPortTest::OnPortError); | 93 &StunPortTest::OnPortError); |
94 } | 94 } |
95 | 95 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 stun_servers.insert(kStunAddr1); | 278 stun_servers.insert(kStunAddr1); |
279 stun_servers.insert(kStunAddr2); | 279 stun_servers.insert(kStunAddr2); |
280 CreateStunPort(stun_servers); | 280 CreateStunPort(stun_servers); |
281 EXPECT_EQ("stun", port()->Type()); | 281 EXPECT_EQ("stun", port()->Type()); |
282 PrepareAddress(); | 282 PrepareAddress(); |
283 EXPECT_TRUE_WAIT(done(), kTimeoutMs); | 283 EXPECT_TRUE_WAIT(done(), kTimeoutMs); |
284 EXPECT_EQ(2U, port()->Candidates().size()); | 284 EXPECT_EQ(2U, port()->Candidates().size()); |
285 EXPECT_EQ(port()->Candidates()[0].relay_protocol(), ""); | 285 EXPECT_EQ(port()->Candidates()[0].relay_protocol(), ""); |
286 EXPECT_EQ(port()->Candidates()[1].relay_protocol(), ""); | 286 EXPECT_EQ(port()->Candidates()[1].relay_protocol(), ""); |
287 } | 287 } |
OLD | NEW |