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 <algorithm> | 11 #include <algorithm> |
12 #include <memory> | 12 #include <memory> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "webrtc/base/asynctcpsocket.h" | 15 #include "webrtc/rtc_base/asynctcpsocket.h" |
16 #include "webrtc/base/gunit.h" | 16 #include "webrtc/rtc_base/gunit.h" |
17 #include "webrtc/base/logging.h" | 17 #include "webrtc/rtc_base/logging.h" |
18 #include "webrtc/base/natserver.h" | 18 #include "webrtc/rtc_base/natserver.h" |
19 #include "webrtc/base/natsocketfactory.h" | 19 #include "webrtc/rtc_base/natsocketfactory.h" |
20 #include "webrtc/base/nethelpers.h" | 20 #include "webrtc/rtc_base/nethelpers.h" |
21 #include "webrtc/base/network.h" | 21 #include "webrtc/rtc_base/network.h" |
22 #include "webrtc/base/physicalsocketserver.h" | 22 #include "webrtc/rtc_base/physicalsocketserver.h" |
23 #include "webrtc/base/ptr_util.h" | 23 #include "webrtc/rtc_base/ptr_util.h" |
24 #include "webrtc/base/testclient.h" | 24 #include "webrtc/rtc_base/testclient.h" |
25 #include "webrtc/base/virtualsocketserver.h" | 25 #include "webrtc/rtc_base/virtualsocketserver.h" |
26 | 26 |
27 using namespace rtc; | 27 using namespace rtc; |
28 | 28 |
29 bool CheckReceive( | 29 bool CheckReceive( |
30 TestClient* client, bool should_receive, const char* buf, size_t size) { | 30 TestClient* client, bool should_receive, const char* buf, size_t size) { |
31 return (should_receive) ? | 31 return (should_receive) ? |
32 client->CheckNextPacket(buf, size, 0) : | 32 client->CheckNextPacket(buf, size, 0) : |
33 client->CheckNoPacket(); | 33 client->CheckNoPacket(); |
34 } | 34 } |
35 | 35 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 size_t len = strlen(buf); | 380 size_t len = strlen(buf); |
381 | 381 |
382 in->Send(buf, len); | 382 in->Send(buf, len); |
383 SocketAddress trans_addr; | 383 SocketAddress trans_addr; |
384 EXPECT_TRUE(out->CheckNextPacket(buf, len, &trans_addr)); | 384 EXPECT_TRUE(out->CheckNextPacket(buf, len, &trans_addr)); |
385 | 385 |
386 out->Send(buf, len); | 386 out->Send(buf, len); |
387 EXPECT_TRUE(in->CheckNextPacket(buf, len, &trans_addr)); | 387 EXPECT_TRUE(in->CheckNextPacket(buf, len, &trans_addr)); |
388 } | 388 } |
389 // #endif | 389 // #endif |
OLD | NEW |