OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 virtual void PrepareAddress() { | 145 virtual void PrepareAddress() { |
146 rtc::SocketAddress addr(ip(), min_port()); | 146 rtc::SocketAddress addr(ip(), min_port()); |
147 AddAddress(addr, addr, rtc::SocketAddress(), "udp", "", "", Type(), | 147 AddAddress(addr, addr, rtc::SocketAddress(), "udp", "", "", Type(), |
148 ICE_TYPE_PREFERENCE_HOST, 0, true); | 148 ICE_TYPE_PREFERENCE_HOST, 0, true); |
149 } | 149 } |
150 | 150 |
151 virtual bool SupportsProtocol(const std::string& protocol) const { | 151 virtual bool SupportsProtocol(const std::string& protocol) const { |
152 return true; | 152 return true; |
153 } | 153 } |
154 | 154 |
155 virtual ProtocolType GetProtocol() const { return PROTO_UDP; } | |
156 | |
157 // Exposed for testing candidate building. | 155 // Exposed for testing candidate building. |
158 void AddCandidateAddress(const rtc::SocketAddress& addr) { | 156 void AddCandidateAddress(const rtc::SocketAddress& addr) { |
159 AddAddress(addr, addr, rtc::SocketAddress(), "udp", "", "", Type(), | 157 AddAddress(addr, addr, rtc::SocketAddress(), "udp", "", "", Type(), |
160 type_preference_, 0, false); | 158 type_preference_, 0, false); |
161 } | 159 } |
162 void AddCandidateAddress(const rtc::SocketAddress& addr, | 160 void AddCandidateAddress(const rtc::SocketAddress& addr, |
163 const rtc::SocketAddress& base_address, | 161 const rtc::SocketAddress& base_address, |
164 const std::string& type, | 162 const std::string& type, |
165 int type_preference, | 163 int type_preference, |
166 bool final) { | 164 bool final) { |
(...skipping 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2714 port->CreateConnection(candidate, Port::ORIGIN_MESSAGE); | 2712 port->CreateConnection(candidate, Port::ORIGIN_MESSAGE); |
2715 EXPECT_NE(conn1, conn2); | 2713 EXPECT_NE(conn1, conn2); |
2716 conn_in_use = port->GetConnection(address); | 2714 conn_in_use = port->GetConnection(address); |
2717 EXPECT_EQ(conn2, conn_in_use); | 2715 EXPECT_EQ(conn2, conn_in_use); |
2718 EXPECT_EQ(2u, conn_in_use->remote_candidate().generation()); | 2716 EXPECT_EQ(2u, conn_in_use->remote_candidate().generation()); |
2719 | 2717 |
2720 // Make sure the new connection was not deleted. | 2718 // Make sure the new connection was not deleted. |
2721 rtc::Thread::Current()->ProcessMessages(300); | 2719 rtc::Thread::Current()->ProcessMessages(300); |
2722 EXPECT_TRUE(port->GetConnection(address) != nullptr); | 2720 EXPECT_TRUE(port->GetConnection(address) != nullptr); |
2723 } | 2721 } |
OLD | NEW |