henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Jonas Olsson | a4d8737 | 2019-07-05 17:08:33 | [diff] [blame] | 11 | #include "rtc_base/physical_socket_server.h" |
| 12 | |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 13 | #include <signal.h> |
Jonas Olsson | a4d8737 | 2019-07-05 17:08:33 | [diff] [blame] | 14 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 15 | #include <algorithm> |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 16 | #include <memory> |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 17 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 18 | #include "rtc_base/gunit.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 19 | #include "rtc_base/ip_address.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 20 | #include "rtc_base/logging.h" |
Mirko Bonadei | e5f4c6b | 2021-01-15 09:41:01 | [diff] [blame] | 21 | #include "rtc_base/net_helpers.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 22 | #include "rtc_base/network_monitor.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 23 | #include "rtc_base/socket_unittest.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 24 | #include "rtc_base/test_utils.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 25 | #include "rtc_base/thread.h" |
Per Kjellander | fdcfefa | 2022-11-08 11:48:52 | [diff] [blame] | 26 | #include "test/field_trial.h" |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 27 | #include "test/gtest.h" |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 28 | |
| 29 | namespace rtc { |
| 30 | |
Mirko Bonadei | 675513b | 2017-11-09 10:09:25 | [diff] [blame] | 31 | #define MAYBE_SKIP_IPV4 \ |
| 32 | if (!HasIPv4Enabled()) { \ |
| 33 | RTC_LOG(LS_INFO) << "No IPv4... skipping"; \ |
| 34 | return; \ |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 35 | } |
| 36 | |
Mirko Bonadei | 675513b | 2017-11-09 10:09:25 | [diff] [blame] | 37 | #define MAYBE_SKIP_IPV6 \ |
| 38 | if (!HasIPv6Enabled()) { \ |
| 39 | RTC_LOG(LS_INFO) << "No IPv6... skipping"; \ |
| 40 | return; \ |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 41 | } |
| 42 | |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 43 | class PhysicalSocketTest; |
| 44 | |
| 45 | class FakeSocketDispatcher : public SocketDispatcher { |
| 46 | public: |
| 47 | explicit FakeSocketDispatcher(PhysicalSocketServer* ss) |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 48 | : SocketDispatcher(ss) {} |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 49 | |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 50 | FakeSocketDispatcher(SOCKET s, PhysicalSocketServer* ss) |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 51 | : SocketDispatcher(s, ss) {} |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 52 | |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 53 | protected: |
| 54 | SOCKET DoAccept(SOCKET socket, sockaddr* addr, socklen_t* addrlen) override; |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 55 | int DoSend(SOCKET socket, const char* buf, int len, int flags) override; |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 56 | int DoSendTo(SOCKET socket, |
| 57 | const char* buf, |
| 58 | int len, |
| 59 | int flags, |
| 60 | const struct sockaddr* dest_addr, |
| 61 | socklen_t addrlen) override; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 62 | }; |
| 63 | |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 64 | class FakePhysicalSocketServer : public PhysicalSocketServer { |
| 65 | public: |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 66 | explicit FakePhysicalSocketServer(PhysicalSocketTest* test) : test_(test) {} |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 67 | |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 68 | Socket* CreateSocket(int family, int type) override { |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 69 | SocketDispatcher* dispatcher = new FakeSocketDispatcher(this); |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 70 | if (!dispatcher->Create(family, type)) { |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 71 | delete dispatcher; |
| 72 | return nullptr; |
| 73 | } |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 74 | return dispatcher; |
| 75 | } |
| 76 | |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 77 | Socket* WrapSocket(SOCKET s) override { |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 78 | SocketDispatcher* dispatcher = new FakeSocketDispatcher(s, this); |
| 79 | if (!dispatcher->Initialize()) { |
| 80 | delete dispatcher; |
| 81 | return nullptr; |
| 82 | } |
| 83 | return dispatcher; |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | PhysicalSocketTest* GetTest() const { return test_; } |
| 87 | |
| 88 | private: |
| 89 | PhysicalSocketTest* test_; |
| 90 | }; |
| 91 | |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 92 | class FakeNetworkBinder : public NetworkBinderInterface { |
| 93 | public: |
| 94 | NetworkBindingResult BindSocketToNetwork(int, const IPAddress&) override { |
deadbeef | 9ffa13f | 2017-02-22 00:18:00 | [diff] [blame] | 95 | ++num_binds_; |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 96 | return result_; |
| 97 | } |
| 98 | |
| 99 | void set_result(NetworkBindingResult result) { result_ = result; } |
| 100 | |
deadbeef | 9ffa13f | 2017-02-22 00:18:00 | [diff] [blame] | 101 | int num_binds() { return num_binds_; } |
| 102 | |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 103 | private: |
| 104 | NetworkBindingResult result_ = NetworkBindingResult::SUCCESS; |
deadbeef | 9ffa13f | 2017-02-22 00:18:00 | [diff] [blame] | 105 | int num_binds_ = 0; |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 106 | }; |
| 107 | |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 108 | class PhysicalSocketTest : public SocketTest { |
| 109 | public: |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 110 | // Set flag to simluate failures when calling "::accept" on a Socket. |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 111 | void SetFailAccept(bool fail) { fail_accept_ = fail; } |
| 112 | bool FailAccept() const { return fail_accept_; } |
| 113 | |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 114 | // Maximum size to ::send to a socket. Set to < 0 to disable limiting. |
| 115 | void SetMaxSendSize(int max_size) { max_send_size_ = max_size; } |
| 116 | int MaxSendSize() const { return max_send_size_; } |
| 117 | |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 118 | protected: |
| 119 | PhysicalSocketTest() |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 120 | : SocketTest(&server_), |
| 121 | server_(this), |
| 122 | thread_(&server_), |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 123 | fail_accept_(false), |
| 124 | max_send_size_(-1) {} |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 125 | |
| 126 | void ConnectInternalAcceptError(const IPAddress& loopback); |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 127 | void WritableAfterPartialWrite(const IPAddress& loopback); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 128 | |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 129 | FakePhysicalSocketServer server_; |
nisse | 7eaa4ea | 2017-05-08 12:25:41 | [diff] [blame] | 130 | rtc::AutoSocketServerThread thread_; |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 131 | bool fail_accept_; |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 132 | int max_send_size_; |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 133 | }; |
| 134 | |
| 135 | SOCKET FakeSocketDispatcher::DoAccept(SOCKET socket, |
| 136 | sockaddr* addr, |
| 137 | socklen_t* addrlen) { |
| 138 | FakePhysicalSocketServer* ss = |
| 139 | static_cast<FakePhysicalSocketServer*>(socketserver()); |
| 140 | if (ss->GetTest()->FailAccept()) { |
| 141 | return INVALID_SOCKET; |
| 142 | } |
| 143 | |
| 144 | return SocketDispatcher::DoAccept(socket, addr, addrlen); |
| 145 | } |
| 146 | |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 147 | int FakeSocketDispatcher::DoSend(SOCKET socket, |
| 148 | const char* buf, |
| 149 | int len, |
| 150 | int flags) { |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 151 | FakePhysicalSocketServer* ss = |
| 152 | static_cast<FakePhysicalSocketServer*>(socketserver()); |
| 153 | if (ss->GetTest()->MaxSendSize() >= 0) { |
| 154 | len = std::min(len, ss->GetTest()->MaxSendSize()); |
| 155 | } |
| 156 | |
| 157 | return SocketDispatcher::DoSend(socket, buf, len, flags); |
| 158 | } |
| 159 | |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 160 | int FakeSocketDispatcher::DoSendTo(SOCKET socket, |
| 161 | const char* buf, |
| 162 | int len, |
| 163 | int flags, |
| 164 | const struct sockaddr* dest_addr, |
| 165 | socklen_t addrlen) { |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 166 | FakePhysicalSocketServer* ss = |
| 167 | static_cast<FakePhysicalSocketServer*>(socketserver()); |
| 168 | if (ss->GetTest()->MaxSendSize() >= 0) { |
| 169 | len = std::min(len, ss->GetTest()->MaxSendSize()); |
| 170 | } |
| 171 | |
| 172 | return SocketDispatcher::DoSendTo(socket, buf, len, flags, dest_addr, |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 173 | addrlen); |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 174 | } |
| 175 | |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 176 | TEST_F(PhysicalSocketTest, TestConnectIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 177 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 178 | SocketTest::TestConnectIPv4(); |
| 179 | } |
| 180 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 181 | TEST_F(PhysicalSocketTest, TestConnectIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 182 | SocketTest::TestConnectIPv6(); |
| 183 | } |
| 184 | |
| 185 | TEST_F(PhysicalSocketTest, TestConnectWithDnsLookupIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 186 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 187 | SocketTest::TestConnectWithDnsLookupIPv4(); |
| 188 | } |
| 189 | |
| 190 | TEST_F(PhysicalSocketTest, TestConnectWithDnsLookupIPv6) { |
| 191 | SocketTest::TestConnectWithDnsLookupIPv6(); |
| 192 | } |
| 193 | |
| 194 | TEST_F(PhysicalSocketTest, TestConnectFailIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 195 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 196 | SocketTest::TestConnectFailIPv4(); |
| 197 | } |
| 198 | |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 199 | void PhysicalSocketTest::ConnectInternalAcceptError(const IPAddress& loopback) { |
kwiberg | d0d8148 | 2017-04-18 10:18:22 | [diff] [blame] | 200 | webrtc::testing::StreamSink sink; |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 201 | SocketAddress accept_addr; |
| 202 | |
| 203 | // Create two clients. |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 204 | std::unique_ptr<Socket> client1( |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 205 | server_.CreateSocket(loopback.family(), SOCK_STREAM)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 206 | sink.Monitor(client1.get()); |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 207 | EXPECT_EQ(Socket::CS_CLOSED, client1->GetState()); |
Jonas Olsson | abbe841 | 2018-04-03 11:40:05 | [diff] [blame] | 208 | EXPECT_TRUE(IsUnspecOrEmptyIP(client1->GetLocalAddress().ipaddr())); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 209 | |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 210 | std::unique_ptr<Socket> client2( |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 211 | server_.CreateSocket(loopback.family(), SOCK_STREAM)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 212 | sink.Monitor(client2.get()); |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 213 | EXPECT_EQ(Socket::CS_CLOSED, client2->GetState()); |
Jonas Olsson | abbe841 | 2018-04-03 11:40:05 | [diff] [blame] | 214 | EXPECT_TRUE(IsUnspecOrEmptyIP(client2->GetLocalAddress().ipaddr())); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 215 | |
| 216 | // Create server and listen. |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 217 | std::unique_ptr<Socket> server( |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 218 | server_.CreateSocket(loopback.family(), SOCK_STREAM)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 219 | sink.Monitor(server.get()); |
| 220 | EXPECT_EQ(0, server->Bind(SocketAddress(loopback, 0))); |
| 221 | EXPECT_EQ(0, server->Listen(5)); |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 222 | EXPECT_EQ(Socket::CS_CONNECTING, server->GetState()); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 223 | |
| 224 | // Ensure no pending server connections, since we haven't done anything yet. |
kwiberg | d0d8148 | 2017-04-18 10:18:22 | [diff] [blame] | 225 | EXPECT_FALSE(sink.Check(server.get(), webrtc::testing::SSE_READ)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 226 | EXPECT_TRUE(nullptr == server->Accept(&accept_addr)); |
| 227 | EXPECT_TRUE(accept_addr.IsNil()); |
| 228 | |
| 229 | // Attempt first connect to listening socket. |
| 230 | EXPECT_EQ(0, client1->Connect(server->GetLocalAddress())); |
| 231 | EXPECT_FALSE(client1->GetLocalAddress().IsNil()); |
| 232 | EXPECT_NE(server->GetLocalAddress(), client1->GetLocalAddress()); |
| 233 | |
| 234 | // Client is connecting, outcome not yet determined. |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 235 | EXPECT_EQ(Socket::CS_CONNECTING, client1->GetState()); |
kwiberg | d0d8148 | 2017-04-18 10:18:22 | [diff] [blame] | 236 | EXPECT_FALSE(sink.Check(client1.get(), webrtc::testing::SSE_OPEN)); |
| 237 | EXPECT_FALSE(sink.Check(client1.get(), webrtc::testing::SSE_CLOSE)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 238 | |
| 239 | // Server has pending connection, try to accept it (will fail). |
kwiberg | d0d8148 | 2017-04-18 10:18:22 | [diff] [blame] | 240 | EXPECT_TRUE_WAIT((sink.Check(server.get(), webrtc::testing::SSE_READ)), |
| 241 | kTimeout); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 242 | // Simulate "::accept" returning an error. |
| 243 | SetFailAccept(true); |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 244 | std::unique_ptr<Socket> accepted(server->Accept(&accept_addr)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 245 | EXPECT_FALSE(accepted); |
| 246 | ASSERT_TRUE(accept_addr.IsNil()); |
| 247 | |
| 248 | // Ensure no more pending server connections. |
kwiberg | d0d8148 | 2017-04-18 10:18:22 | [diff] [blame] | 249 | EXPECT_FALSE(sink.Check(server.get(), webrtc::testing::SSE_READ)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 250 | EXPECT_TRUE(nullptr == server->Accept(&accept_addr)); |
| 251 | EXPECT_TRUE(accept_addr.IsNil()); |
| 252 | |
| 253 | // Attempt second connect to listening socket. |
| 254 | EXPECT_EQ(0, client2->Connect(server->GetLocalAddress())); |
| 255 | EXPECT_FALSE(client2->GetLocalAddress().IsNil()); |
| 256 | EXPECT_NE(server->GetLocalAddress(), client2->GetLocalAddress()); |
| 257 | |
| 258 | // Client is connecting, outcome not yet determined. |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 259 | EXPECT_EQ(Socket::CS_CONNECTING, client2->GetState()); |
kwiberg | d0d8148 | 2017-04-18 10:18:22 | [diff] [blame] | 260 | EXPECT_FALSE(sink.Check(client2.get(), webrtc::testing::SSE_OPEN)); |
| 261 | EXPECT_FALSE(sink.Check(client2.get(), webrtc::testing::SSE_CLOSE)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 262 | |
| 263 | // Server has pending connection, try to accept it (will succeed). |
kwiberg | d0d8148 | 2017-04-18 10:18:22 | [diff] [blame] | 264 | EXPECT_TRUE_WAIT((sink.Check(server.get(), webrtc::testing::SSE_READ)), |
| 265 | kTimeout); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 266 | SetFailAccept(false); |
Niels Möller | d0b8879 | 2021-08-12 08:32:30 | [diff] [blame] | 267 | std::unique_ptr<Socket> accepted2(server->Accept(&accept_addr)); |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 268 | ASSERT_TRUE(accepted2); |
| 269 | EXPECT_FALSE(accept_addr.IsNil()); |
| 270 | EXPECT_EQ(accepted2->GetRemoteAddress(), accept_addr); |
| 271 | } |
| 272 | |
| 273 | TEST_F(PhysicalSocketTest, TestConnectAcceptErrorIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 274 | MAYBE_SKIP_IPV4; |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 275 | ConnectInternalAcceptError(kIPv4Loopback); |
| 276 | } |
| 277 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 278 | TEST_F(PhysicalSocketTest, TestConnectAcceptErrorIPv6) { |
| 279 | MAYBE_SKIP_IPV6; |
jbauch | 095ae15 | 2015-12-18 09:39:55 | [diff] [blame] | 280 | ConnectInternalAcceptError(kIPv6Loopback); |
| 281 | } |
| 282 | |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 283 | void PhysicalSocketTest::WritableAfterPartialWrite(const IPAddress& loopback) { |
| 284 | // Simulate a really small maximum send size. |
| 285 | const int kMaxSendSize = 128; |
| 286 | SetMaxSendSize(kMaxSendSize); |
| 287 | |
| 288 | // Run the default send/receive socket tests with a smaller amount of data |
| 289 | // to avoid long running times due to the small maximum send size. |
| 290 | const size_t kDataSize = 128 * 1024; |
| 291 | TcpInternal(loopback, kDataSize, kMaxSendSize); |
| 292 | } |
| 293 | |
danilchap | b7b9dca | 2016-08-05 12:55:43 | [diff] [blame] | 294 | // https://bugs.chromium.org/p/webrtc/issues/detail?id=6167 |
| 295 | #if defined(WEBRTC_WIN) |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 296 | #define MAYBE_TestWritableAfterPartialWriteIPv4 \ |
| 297 | DISABLED_TestWritableAfterPartialWriteIPv4 |
danilchap | b7b9dca | 2016-08-05 12:55:43 | [diff] [blame] | 298 | #else |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 299 | #define MAYBE_TestWritableAfterPartialWriteIPv4 \ |
| 300 | TestWritableAfterPartialWriteIPv4 |
danilchap | b7b9dca | 2016-08-05 12:55:43 | [diff] [blame] | 301 | #endif |
| 302 | TEST_F(PhysicalSocketTest, MAYBE_TestWritableAfterPartialWriteIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 303 | MAYBE_SKIP_IPV4; |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 304 | WritableAfterPartialWrite(kIPv4Loopback); |
| 305 | } |
| 306 | |
danilchap | b7b9dca | 2016-08-05 12:55:43 | [diff] [blame] | 307 | // https://bugs.chromium.org/p/webrtc/issues/detail?id=6167 |
| 308 | #if defined(WEBRTC_WIN) |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 309 | #define MAYBE_TestWritableAfterPartialWriteIPv6 \ |
| 310 | DISABLED_TestWritableAfterPartialWriteIPv6 |
danilchap | b7b9dca | 2016-08-05 12:55:43 | [diff] [blame] | 311 | #else |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 312 | #define MAYBE_TestWritableAfterPartialWriteIPv6 \ |
| 313 | TestWritableAfterPartialWriteIPv6 |
danilchap | b7b9dca | 2016-08-05 12:55:43 | [diff] [blame] | 314 | #endif |
| 315 | TEST_F(PhysicalSocketTest, MAYBE_TestWritableAfterPartialWriteIPv6) { |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 316 | MAYBE_SKIP_IPV6; |
jbauch | f2a2bf4 | 2016-02-04 00:45:32 | [diff] [blame] | 317 | WritableAfterPartialWrite(kIPv6Loopback); |
| 318 | } |
| 319 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 320 | TEST_F(PhysicalSocketTest, TestConnectFailIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 321 | SocketTest::TestConnectFailIPv6(); |
| 322 | } |
| 323 | |
| 324 | TEST_F(PhysicalSocketTest, TestConnectWithDnsLookupFailIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 325 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 326 | SocketTest::TestConnectWithDnsLookupFailIPv4(); |
| 327 | } |
| 328 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 329 | TEST_F(PhysicalSocketTest, TestConnectWithDnsLookupFailIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 330 | SocketTest::TestConnectWithDnsLookupFailIPv6(); |
| 331 | } |
| 332 | |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 333 | TEST_F(PhysicalSocketTest, TestConnectWithClosedSocketIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 334 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 335 | SocketTest::TestConnectWithClosedSocketIPv4(); |
| 336 | } |
| 337 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 338 | TEST_F(PhysicalSocketTest, TestConnectWithClosedSocketIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 339 | SocketTest::TestConnectWithClosedSocketIPv6(); |
| 340 | } |
| 341 | |
| 342 | TEST_F(PhysicalSocketTest, TestConnectWhileNotClosedIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 343 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 344 | SocketTest::TestConnectWhileNotClosedIPv4(); |
| 345 | } |
| 346 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 347 | TEST_F(PhysicalSocketTest, TestConnectWhileNotClosedIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 348 | SocketTest::TestConnectWhileNotClosedIPv6(); |
| 349 | } |
| 350 | |
| 351 | TEST_F(PhysicalSocketTest, TestServerCloseDuringConnectIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 352 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 353 | SocketTest::TestServerCloseDuringConnectIPv4(); |
| 354 | } |
| 355 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 356 | TEST_F(PhysicalSocketTest, TestServerCloseDuringConnectIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 357 | SocketTest::TestServerCloseDuringConnectIPv6(); |
| 358 | } |
| 359 | |
| 360 | TEST_F(PhysicalSocketTest, TestClientCloseDuringConnectIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 361 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 362 | SocketTest::TestClientCloseDuringConnectIPv4(); |
| 363 | } |
| 364 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 365 | TEST_F(PhysicalSocketTest, TestClientCloseDuringConnectIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 366 | SocketTest::TestClientCloseDuringConnectIPv6(); |
| 367 | } |
| 368 | |
| 369 | TEST_F(PhysicalSocketTest, TestServerCloseIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 370 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 371 | SocketTest::TestServerCloseIPv4(); |
| 372 | } |
| 373 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 374 | TEST_F(PhysicalSocketTest, TestServerCloseIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 375 | SocketTest::TestServerCloseIPv6(); |
| 376 | } |
| 377 | |
| 378 | TEST_F(PhysicalSocketTest, TestCloseInClosedCallbackIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 379 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 380 | SocketTest::TestCloseInClosedCallbackIPv4(); |
| 381 | } |
| 382 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 383 | TEST_F(PhysicalSocketTest, TestCloseInClosedCallbackIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 384 | SocketTest::TestCloseInClosedCallbackIPv6(); |
| 385 | } |
| 386 | |
Taylor Brandstetter | 7b69a44 | 2020-08-20 23:43:13 | [diff] [blame] | 387 | TEST_F(PhysicalSocketTest, TestDeleteInReadCallbackIPv4) { |
| 388 | MAYBE_SKIP_IPV4; |
| 389 | SocketTest::TestDeleteInReadCallbackIPv4(); |
| 390 | } |
| 391 | |
| 392 | TEST_F(PhysicalSocketTest, TestDeleteInReadCallbackIPv6) { |
| 393 | SocketTest::TestDeleteInReadCallbackIPv6(); |
| 394 | } |
| 395 | |
henrike@webrtc.org | c732a3e | 2014-10-09 22:08:15 | [diff] [blame] | 396 | TEST_F(PhysicalSocketTest, TestSocketServerWaitIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 397 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 398 | SocketTest::TestSocketServerWaitIPv4(); |
| 399 | } |
| 400 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 401 | TEST_F(PhysicalSocketTest, TestSocketServerWaitIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 402 | SocketTest::TestSocketServerWaitIPv6(); |
| 403 | } |
| 404 | |
| 405 | TEST_F(PhysicalSocketTest, TestTcpIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 406 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 407 | SocketTest::TestTcpIPv4(); |
| 408 | } |
| 409 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 410 | TEST_F(PhysicalSocketTest, TestTcpIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 411 | SocketTest::TestTcpIPv6(); |
| 412 | } |
| 413 | |
| 414 | TEST_F(PhysicalSocketTest, TestUdpIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 415 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 416 | SocketTest::TestUdpIPv4(); |
| 417 | } |
| 418 | |
Taylor Brandstetter | 2b3bf6b | 2016-05-19 21:57:31 | [diff] [blame] | 419 | TEST_F(PhysicalSocketTest, TestUdpIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 420 | SocketTest::TestUdpIPv6(); |
| 421 | } |
| 422 | |
henrike@webrtc.org | 6f833c3 | 2014-06-27 16:21:49 | [diff] [blame] | 423 | // Disable for TSan v2, see |
| 424 | // https://code.google.com/p/webrtc/issues/detail?id=3498 for details. |
deadbeef | c97be6a | 2015-09-25 18:00:38 | [diff] [blame] | 425 | // Also disable for MSan, see: |
| 426 | // https://code.google.com/p/webrtc/issues/detail?id=4958 |
| 427 | // TODO(deadbeef): Enable again once test is reimplemented to be unflaky. |
minyue | df200d1 | 2015-10-17 20:10:46 | [diff] [blame] | 428 | // Also disable for ASan. |
Henrik Kjellander | 0be3e04 | 2015-10-30 20:21:03 | [diff] [blame] | 429 | // Disabled on Android: https://code.google.com/p/webrtc/issues/detail?id=4364 |
ivoc | f399f21 | 2015-11-19 14:44:32 | [diff] [blame] | 430 | // Disabled on Linux: https://bugs.chromium.org/p/webrtc/issues/detail?id=5233 |
minyue | df200d1 | 2015-10-17 20:10:46 | [diff] [blame] | 431 | #if defined(THREAD_SANITIZER) || defined(MEMORY_SANITIZER) || \ |
ivoc | f399f21 | 2015-11-19 14:44:32 | [diff] [blame] | 432 | defined(ADDRESS_SANITIZER) || defined(WEBRTC_ANDROID) || \ |
| 433 | defined(WEBRTC_LINUX) |
minyue | df200d1 | 2015-10-17 20:10:46 | [diff] [blame] | 434 | #define MAYBE_TestUdpReadyToSendIPv4 DISABLED_TestUdpReadyToSendIPv4 |
| 435 | #else |
| 436 | #define MAYBE_TestUdpReadyToSendIPv4 TestUdpReadyToSendIPv4 |
| 437 | #endif |
| 438 | TEST_F(PhysicalSocketTest, MAYBE_TestUdpReadyToSendIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 439 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 440 | SocketTest::TestUdpReadyToSendIPv4(); |
| 441 | } |
| 442 | |
danilchap | b7b9dca | 2016-08-05 12:55:43 | [diff] [blame] | 443 | // https://bugs.chromium.org/p/webrtc/issues/detail?id=6167 |
| 444 | #if defined(WEBRTC_WIN) |
| 445 | #define MAYBE_TestUdpReadyToSendIPv6 DISABLED_TestUdpReadyToSendIPv6 |
| 446 | #else |
| 447 | #define MAYBE_TestUdpReadyToSendIPv6 TestUdpReadyToSendIPv6 |
| 448 | #endif |
| 449 | TEST_F(PhysicalSocketTest, MAYBE_TestUdpReadyToSendIPv6) { |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 450 | SocketTest::TestUdpReadyToSendIPv6(); |
| 451 | } |
| 452 | |
| 453 | TEST_F(PhysicalSocketTest, TestGetSetOptionsIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 454 | MAYBE_SKIP_IPV4; |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 455 | SocketTest::TestGetSetOptionsIPv4(); |
| 456 | } |
| 457 | |
| 458 | TEST_F(PhysicalSocketTest, TestGetSetOptionsIPv6) { |
| 459 | SocketTest::TestGetSetOptionsIPv6(); |
| 460 | } |
| 461 | |
| 462 | #if defined(WEBRTC_POSIX) |
| 463 | |
Stefan Holmer | 9131efd | 2016-05-23 16:19:26 | [diff] [blame] | 464 | TEST_F(PhysicalSocketTest, TestSocketRecvTimestampIPv4) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 465 | MAYBE_SKIP_IPV4; |
Taylor Brandstetter | 6f82535 | 2016-08-11 22:38:28 | [diff] [blame] | 466 | SocketTest::TestSocketRecvTimestampIPv4(); |
Stefan Holmer | 9131efd | 2016-05-23 16:19:26 | [diff] [blame] | 467 | } |
| 468 | |
Taylor Brandstetter | 6f82535 | 2016-08-11 22:38:28 | [diff] [blame] | 469 | TEST_F(PhysicalSocketTest, TestSocketRecvTimestampIPv6) { |
| 470 | SocketTest::TestSocketRecvTimestampIPv6(); |
Stefan Holmer | 9131efd | 2016-05-23 16:19:26 | [diff] [blame] | 471 | } |
Stefan Holmer | 9131efd | 2016-05-23 16:19:26 | [diff] [blame] | 472 | |
Per K | 7efd372 | 2023-03-21 13:10:44 | [diff] [blame] | 473 | #if !defined(WEBRTC_MAC) |
| 474 | TEST_F(PhysicalSocketTest, TestSocketRecvTimestampIPv4ScmExperimentDisabled) { |
Per Kjellander | fdcfefa | 2022-11-08 11:48:52 | [diff] [blame] | 475 | MAYBE_SKIP_IPV4; |
Per K | 7efd372 | 2023-03-21 13:10:44 | [diff] [blame] | 476 | webrtc::test::ScopedFieldTrials trial("WebRTC-SCM-Timestamp/Disabled/"); |
Per Kjellander | fdcfefa | 2022-11-08 11:48:52 | [diff] [blame] | 477 | SocketTest::TestSocketRecvTimestampIPv4(); |
| 478 | } |
| 479 | |
Per K | 7efd372 | 2023-03-21 13:10:44 | [diff] [blame] | 480 | TEST_F(PhysicalSocketTest, TestSocketRecvTimestampIPv6ScmExperimentDisabled) { |
| 481 | webrtc::test::ScopedFieldTrials trial("WebRTC-SCM-Timestamp/Disabled/"); |
Per Kjellander | fdcfefa | 2022-11-08 11:48:52 | [diff] [blame] | 482 | SocketTest::TestSocketRecvTimestampIPv6(); |
| 483 | } |
Per K | 7efd372 | 2023-03-21 13:10:44 | [diff] [blame] | 484 | #endif |
Per Kjellander | 3daf696 | 2022-11-08 17:23:43 | [diff] [blame] | 485 | |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 486 | // Verify that if the socket was unable to be bound to a real network interface |
| 487 | // (not loopback), Bind will return an error. |
| 488 | TEST_F(PhysicalSocketTest, |
| 489 | BindFailsIfNetworkBinderFailsForNonLoopbackInterface) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 490 | MAYBE_SKIP_IPV4; |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 491 | FakeNetworkBinder fake_network_binder; |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 492 | server_.set_network_binder(&fake_network_binder); |
| 493 | std::unique_ptr<Socket> socket(server_.CreateSocket(AF_INET, SOCK_DGRAM)); |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 494 | fake_network_binder.set_result(NetworkBindingResult::FAILURE); |
| 495 | EXPECT_EQ(-1, socket->Bind(SocketAddress("192.168.0.1", 0))); |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 496 | server_.set_network_binder(nullptr); |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 497 | } |
| 498 | |
deadbeef | 9ffa13f | 2017-02-22 00:18:00 | [diff] [blame] | 499 | // Network binder shouldn't be used if the socket is bound to the "any" IP. |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 500 | TEST_F(PhysicalSocketTest, NetworkBinderIsNotUsedForAnyIp) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 501 | MAYBE_SKIP_IPV4; |
deadbeef | 9ffa13f | 2017-02-22 00:18:00 | [diff] [blame] | 502 | FakeNetworkBinder fake_network_binder; |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 503 | server_.set_network_binder(&fake_network_binder); |
| 504 | std::unique_ptr<Socket> socket(server_.CreateSocket(AF_INET, SOCK_DGRAM)); |
deadbeef | 9ffa13f | 2017-02-22 00:18:00 | [diff] [blame] | 505 | EXPECT_EQ(0, socket->Bind(SocketAddress("0.0.0.0", 0))); |
| 506 | EXPECT_EQ(0, fake_network_binder.num_binds()); |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 507 | server_.set_network_binder(nullptr); |
deadbeef | 9ffa13f | 2017-02-22 00:18:00 | [diff] [blame] | 508 | } |
| 509 | |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 510 | // For a loopback interface, failures to bind to the interface should be |
| 511 | // tolerated. |
| 512 | TEST_F(PhysicalSocketTest, |
| 513 | BindSucceedsIfNetworkBinderFailsForLoopbackInterface) { |
deadbeef | 9a6f4d4 | 2017-05-16 02:43:33 | [diff] [blame] | 514 | MAYBE_SKIP_IPV4; |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 515 | FakeNetworkBinder fake_network_binder; |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 516 | server_.set_network_binder(&fake_network_binder); |
| 517 | std::unique_ptr<Socket> socket(server_.CreateSocket(AF_INET, SOCK_DGRAM)); |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 518 | fake_network_binder.set_result(NetworkBindingResult::FAILURE); |
| 519 | EXPECT_EQ(0, socket->Bind(SocketAddress(kIPv4Loopback, 0))); |
Niels Möller | 50f7c2c | 2021-09-08 12:05:16 | [diff] [blame] | 520 | server_.set_network_binder(nullptr); |
deadbeef | c874d12 | 2017-02-13 23:41:59 | [diff] [blame] | 521 | } |
| 522 | |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 523 | #endif |
| 524 | |
Per K | 7efd372 | 2023-03-21 13:10:44 | [diff] [blame] | 525 | TEST_F(PhysicalSocketTest, UdpSocketRecvTimestampUseRtcEpochIPv4) { |
Per Kjellander | 3daf696 | 2022-11-08 17:23:43 | [diff] [blame] | 526 | MAYBE_SKIP_IPV4; |
Per Kjellander | 3daf696 | 2022-11-08 17:23:43 | [diff] [blame] | 527 | SocketTest::TestUdpSocketRecvTimestampUseRtcEpochIPv4(); |
| 528 | } |
| 529 | |
Per K | 7efd372 | 2023-03-21 13:10:44 | [diff] [blame] | 530 | TEST_F(PhysicalSocketTest, UdpSocketRecvTimestampUseRtcEpochIPv6) { |
Per Kjellander | 3daf696 | 2022-11-08 17:23:43 | [diff] [blame] | 531 | SocketTest::TestUdpSocketRecvTimestampUseRtcEpochIPv6(); |
| 532 | } |
| 533 | |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 534 | } // namespace rtc |