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