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 |
155 // Exposed for testing candidate building. | 157 // Exposed for testing candidate building. |
156 void AddCandidateAddress(const rtc::SocketAddress& addr) { | 158 void AddCandidateAddress(const rtc::SocketAddress& addr) { |
157 AddAddress(addr, addr, rtc::SocketAddress(), "udp", "", "", Type(), | 159 AddAddress(addr, addr, rtc::SocketAddress(), "udp", "", "", Type(), |
158 type_preference_, 0, false); | 160 type_preference_, 0, false); |
159 } | 161 } |
160 void AddCandidateAddress(const rtc::SocketAddress& addr, | 162 void AddCandidateAddress(const rtc::SocketAddress& addr, |
161 const rtc::SocketAddress& base_address, | 163 const rtc::SocketAddress& base_address, |
162 const std::string& type, | 164 const std::string& type, |
163 int type_preference, | 165 int type_preference, |
164 bool final) { | 166 bool final) { |
(...skipping 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 port->CreateConnection(candidate, Port::ORIGIN_MESSAGE); | 2714 port->CreateConnection(candidate, Port::ORIGIN_MESSAGE); |
2713 EXPECT_NE(conn1, conn2); | 2715 EXPECT_NE(conn1, conn2); |
2714 conn_in_use = port->GetConnection(address); | 2716 conn_in_use = port->GetConnection(address); |
2715 EXPECT_EQ(conn2, conn_in_use); | 2717 EXPECT_EQ(conn2, conn_in_use); |
2716 EXPECT_EQ(2u, conn_in_use->remote_candidate().generation()); | 2718 EXPECT_EQ(2u, conn_in_use->remote_candidate().generation()); |
2717 | 2719 |
2718 // Make sure the new connection was not deleted. | 2720 // Make sure the new connection was not deleted. |
2719 rtc::Thread::Current()->ProcessMessages(300); | 2721 rtc::Thread::Current()->ProcessMessages(300); |
2720 EXPECT_TRUE(port->GetConnection(address) != nullptr); | 2722 EXPECT_TRUE(port->GetConnection(address) != nullptr); |
2721 } | 2723 } |
OLD | NEW |