| 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 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "webrtc/base/gunit.h" | |
| 15 #include "webrtc/base/helpers.h" | |
| 16 #include "webrtc/base/logging.h" | |
| 17 #include "webrtc/base/ptr_util.h" | |
| 18 #include "webrtc/base/socketaddress.h" | |
| 19 #include "webrtc/base/ssladapter.h" | |
| 20 #include "webrtc/base/testclient.h" | |
| 21 #include "webrtc/base/thread.h" | |
| 22 #include "webrtc/base/virtualsocketserver.h" | |
| 23 #include "webrtc/p2p/base/relayserver.h" | 14 #include "webrtc/p2p/base/relayserver.h" |
| 15 #include "webrtc/rtc_base/gunit.h" |
| 16 #include "webrtc/rtc_base/helpers.h" |
| 17 #include "webrtc/rtc_base/logging.h" |
| 18 #include "webrtc/rtc_base/ptr_util.h" |
| 19 #include "webrtc/rtc_base/socketaddress.h" |
| 20 #include "webrtc/rtc_base/ssladapter.h" |
| 21 #include "webrtc/rtc_base/testclient.h" |
| 22 #include "webrtc/rtc_base/thread.h" |
| 23 #include "webrtc/rtc_base/virtualsocketserver.h" |
| 24 | 24 |
| 25 using rtc::SocketAddress; | 25 using rtc::SocketAddress; |
| 26 using namespace cricket; | 26 using namespace cricket; |
| 27 | 27 |
| 28 static const uint32_t LIFETIME = 4; // seconds | 28 static const uint32_t LIFETIME = 4; // seconds |
| 29 static const SocketAddress server_int_addr("127.0.0.1", 5000); | 29 static const SocketAddress server_int_addr("127.0.0.1", 5000); |
| 30 static const SocketAddress server_ext_addr("127.0.0.1", 5001); | 30 static const SocketAddress server_ext_addr("127.0.0.1", 5001); |
| 31 static const SocketAddress client1_addr("127.0.0.1", 6000 + (rand() % 1000)); | 31 static const SocketAddress client1_addr("127.0.0.1", 6000 + (rand() % 1000)); |
| 32 static const SocketAddress client2_addr("127.0.0.1", 7000 + (rand() % 1000)); | 32 static const SocketAddress client2_addr("127.0.0.1", 7000 + (rand() % 1000)); |
| 33 static const char* bad = "this is a completely nonsensical message whose only " | 33 static const char* bad = "this is a completely nonsensical message whose only " |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 const StunErrorCodeAttribute* err = res->GetErrorCode(); | 504 const StunErrorCodeAttribute* err = res->GetErrorCode(); |
| 505 ASSERT_TRUE(err != NULL); | 505 ASSERT_TRUE(err != NULL); |
| 506 EXPECT_EQ(6, err->eclass()); | 506 EXPECT_EQ(6, err->eclass()); |
| 507 EXPECT_EQ(0, err->number()); | 507 EXPECT_EQ(0, err->number()); |
| 508 EXPECT_EQ("Operation Not Supported", err->reason()); | 508 EXPECT_EQ("Operation Not Supported", err->reason()); |
| 509 | 509 |
| 510 // Also verify that traffic from the external client is ignored. | 510 // Also verify that traffic from the external client is ignored. |
| 511 SendRaw2(msg2, static_cast<int>(strlen(msg2))); | 511 SendRaw2(msg2, static_cast<int>(strlen(msg2))); |
| 512 EXPECT_TRUE(ReceiveRaw1().empty()); | 512 EXPECT_TRUE(ReceiveRaw1().empty()); |
| 513 } | 513 } |
| OLD | NEW |