OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 <list> | 12 #include <list> |
13 #include <memory> | 13 #include <memory> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/base/gunit.h" | |
18 #include "webrtc/base/thread.h" | |
19 #include "webrtc/base/asyncpacketsocket.h" | |
20 #include "webrtc/base/ipaddress.h" | |
21 #include "webrtc/base/socketaddress.h" | |
22 #include "webrtc/base/socketserver.h" | |
23 #include "webrtc/base/virtualsocketserver.h" | |
24 #include "webrtc/p2p/base/basicpacketsocketfactory.h" | 17 #include "webrtc/p2p/base/basicpacketsocketfactory.h" |
25 #include "webrtc/p2p/base/packettransportinternal.h" | 18 #include "webrtc/p2p/base/packettransportinternal.h" |
26 #include "webrtc/p2p/base/udptransport.h" | 19 #include "webrtc/p2p/base/udptransport.h" |
| 20 #include "webrtc/rtc_base/asyncpacketsocket.h" |
| 21 #include "webrtc/rtc_base/gunit.h" |
| 22 #include "webrtc/rtc_base/ipaddress.h" |
| 23 #include "webrtc/rtc_base/socketaddress.h" |
| 24 #include "webrtc/rtc_base/socketserver.h" |
| 25 #include "webrtc/rtc_base/thread.h" |
| 26 #include "webrtc/rtc_base/virtualsocketserver.h" |
27 | 27 |
28 namespace cricket { | 28 namespace cricket { |
29 | 29 |
30 constexpr int kTimeoutMs = 10000; | 30 constexpr int kTimeoutMs = 10000; |
31 static const rtc::IPAddress kIPv4LocalHostAddress = | 31 static const rtc::IPAddress kIPv4LocalHostAddress = |
32 rtc::IPAddress(0x7F000001); // 127.0.0.1 | 32 rtc::IPAddress(0x7F000001); // 127.0.0.1 |
33 | 33 |
34 class UdpTransportTest : public testing::Test, public sigslot::has_slots<> { | 34 class UdpTransportTest : public testing::Test, public sigslot::has_slots<> { |
35 public: | 35 public: |
36 UdpTransportTest() | 36 UdpTransportTest() |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 EXPECT_TRUE(ep1_.ch_->writable()); | 180 EXPECT_TRUE(ep1_.ch_->writable()); |
181 EXPECT_EQ(1u, ep1_.num_sig_writable_); | 181 EXPECT_EQ(1u, ep1_.num_sig_writable_); |
182 EXPECT_EQ(1u, ep1_.num_sig_ready_to_send_); | 182 EXPECT_EQ(1u, ep1_.num_sig_ready_to_send_); |
183 const char data[] = "abc"; | 183 const char data[] = "abc"; |
184 ep1_.SendData(data, sizeof(data)); | 184 ep1_.SendData(data, sizeof(data)); |
185 EXPECT_EQ_WAIT(1u, ep1_.ch_packets_.size(), kTimeoutMs); | 185 EXPECT_EQ_WAIT(1u, ep1_.ch_packets_.size(), kTimeoutMs); |
186 EXPECT_EQ_WAIT(1u, ep1_.num_sig_sent_packets_, kTimeoutMs); | 186 EXPECT_EQ_WAIT(1u, ep1_.num_sig_sent_packets_, kTimeoutMs); |
187 } | 187 } |
188 | 188 |
189 } // namespace cricket | 189 } // namespace cricket |
OLD | NEW |