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