| 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 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "webrtc/base/arraysize.h" | |
| 14 #include "webrtc/base/buffer.h" | |
| 15 #include "webrtc/base/crc32.h" | |
| 16 #include "webrtc/base/gunit.h" | |
| 17 #include "webrtc/base/helpers.h" | |
| 18 #include "webrtc/base/logging.h" | |
| 19 #include "webrtc/base/natserver.h" | |
| 20 #include "webrtc/base/natsocketfactory.h" | |
| 21 #include "webrtc/base/ptr_util.h" | |
| 22 #include "webrtc/base/socketaddress.h" | |
| 23 #include "webrtc/base/ssladapter.h" | |
| 24 #include "webrtc/base/stringutils.h" | |
| 25 #include "webrtc/base/thread.h" | |
| 26 #include "webrtc/base/virtualsocketserver.h" | |
| 27 #include "webrtc/p2p/base/basicpacketsocketfactory.h" | 13 #include "webrtc/p2p/base/basicpacketsocketfactory.h" |
| 28 #include "webrtc/p2p/base/jseptransport.h" | 14 #include "webrtc/p2p/base/jseptransport.h" |
| 29 #include "webrtc/p2p/base/relayport.h" | 15 #include "webrtc/p2p/base/relayport.h" |
| 30 #include "webrtc/p2p/base/stunport.h" | 16 #include "webrtc/p2p/base/stunport.h" |
| 31 #include "webrtc/p2p/base/tcpport.h" | 17 #include "webrtc/p2p/base/tcpport.h" |
| 32 #include "webrtc/p2p/base/testrelayserver.h" | 18 #include "webrtc/p2p/base/testrelayserver.h" |
| 33 #include "webrtc/p2p/base/teststunserver.h" | 19 #include "webrtc/p2p/base/teststunserver.h" |
| 34 #include "webrtc/p2p/base/testturnserver.h" | 20 #include "webrtc/p2p/base/testturnserver.h" |
| 35 #include "webrtc/p2p/base/turnport.h" | 21 #include "webrtc/p2p/base/turnport.h" |
| 22 #include "webrtc/rtc_base/arraysize.h" |
| 23 #include "webrtc/rtc_base/buffer.h" |
| 24 #include "webrtc/rtc_base/crc32.h" |
| 25 #include "webrtc/rtc_base/gunit.h" |
| 26 #include "webrtc/rtc_base/helpers.h" |
| 27 #include "webrtc/rtc_base/logging.h" |
| 28 #include "webrtc/rtc_base/natserver.h" |
| 29 #include "webrtc/rtc_base/natsocketfactory.h" |
| 30 #include "webrtc/rtc_base/ptr_util.h" |
| 31 #include "webrtc/rtc_base/socketaddress.h" |
| 32 #include "webrtc/rtc_base/ssladapter.h" |
| 33 #include "webrtc/rtc_base/stringutils.h" |
| 34 #include "webrtc/rtc_base/thread.h" |
| 35 #include "webrtc/rtc_base/virtualsocketserver.h" |
| 36 | 36 |
| 37 using rtc::AsyncPacketSocket; | 37 using rtc::AsyncPacketSocket; |
| 38 using rtc::Buffer; | 38 using rtc::Buffer; |
| 39 using rtc::ByteBufferReader; | 39 using rtc::ByteBufferReader; |
| 40 using rtc::ByteBufferWriter; | 40 using rtc::ByteBufferWriter; |
| 41 using rtc::NATType; | 41 using rtc::NATType; |
| 42 using rtc::NAT_OPEN_CONE; | 42 using rtc::NAT_OPEN_CONE; |
| 43 using rtc::NAT_ADDR_RESTRICTED; | 43 using rtc::NAT_ADDR_RESTRICTED; |
| 44 using rtc::NAT_PORT_RESTRICTED; | 44 using rtc::NAT_PORT_RESTRICTED; |
| 45 using rtc::NAT_SYMMETRIC; | 45 using rtc::NAT_SYMMETRIC; |
| (...skipping 2830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2876 port->CreateConnection(candidate, Port::ORIGIN_MESSAGE); | 2876 port->CreateConnection(candidate, Port::ORIGIN_MESSAGE); |
| 2877 EXPECT_NE(conn1, conn2); | 2877 EXPECT_NE(conn1, conn2); |
| 2878 conn_in_use = port->GetConnection(address); | 2878 conn_in_use = port->GetConnection(address); |
| 2879 EXPECT_EQ(conn2, conn_in_use); | 2879 EXPECT_EQ(conn2, conn_in_use); |
| 2880 EXPECT_EQ(2u, conn_in_use->remote_candidate().generation()); | 2880 EXPECT_EQ(2u, conn_in_use->remote_candidate().generation()); |
| 2881 | 2881 |
| 2882 // Make sure the new connection was not deleted. | 2882 // Make sure the new connection was not deleted. |
| 2883 rtc::Thread::Current()->ProcessMessages(300); | 2883 rtc::Thread::Current()->ProcessMessages(300); |
| 2884 EXPECT_TRUE(port->GetConnection(address) != nullptr); | 2884 EXPECT_TRUE(port->GetConnection(address) != nullptr); |
| 2885 } | 2885 } |
| OLD | NEW |