Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: webrtc/p2p/base/port_unittest.cc

Issue 2093623004: Add config to prune TURN ports (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Partially disable the test TestEachInterfaceHasItsOwnTurnPorts Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/portallocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/portallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698