Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1560)

Side by Side Diff: webrtc/base/nat_unittest.cc

Issue 1944683002: Read recv timestamps from socket (posix only). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Disable ipv6 test on Linux due to bot issues. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 server->Bind(SocketAddress(dst, 0)) != 0) { 188 server->Bind(SocketAddress(dst, 0)) != 0) {
189 return false; 189 return false;
190 } 190 }
191 const char* buf = "hello other socket"; 191 const char* buf = "hello other socket";
192 size_t len = strlen(buf); 192 size_t len = strlen(buf);
193 int sent = client->SendTo(buf, len, server->GetLocalAddress()); 193 int sent = client->SendTo(buf, len, server->GetLocalAddress());
194 SocketAddress addr; 194 SocketAddress addr;
195 const size_t kRecvBufSize = 64; 195 const size_t kRecvBufSize = 64;
196 char recvbuf[kRecvBufSize]; 196 char recvbuf[kRecvBufSize];
197 Thread::Current()->SleepMs(100); 197 Thread::Current()->SleepMs(100);
198 int received = server->RecvFrom(recvbuf, kRecvBufSize, &addr); 198 int received = server->RecvFrom(recvbuf, kRecvBufSize, &addr, nullptr);
199 return received == sent && ::memcmp(buf, recvbuf, len) == 0; 199 return received == sent && ::memcmp(buf, recvbuf, len) == 0;
200 } 200 }
201 201
202 void TestPhysicalInternal(const SocketAddress& int_addr) { 202 void TestPhysicalInternal(const SocketAddress& int_addr) {
203 BasicNetworkManager network_manager; 203 BasicNetworkManager network_manager;
204 network_manager.set_ipv6_enabled(true); 204 network_manager.set_ipv6_enabled(true);
205 network_manager.StartUpdating(); 205 network_manager.StartUpdating();
206 // Process pending messages so the network list is updated. 206 // Process pending messages so the network list is updated.
207 Thread::Current()->ProcessMessages(0); 207 Thread::Current()->ProcessMessages(0);
208 208
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 size_t len = strlen(buf); 386 size_t len = strlen(buf);
387 387
388 in->Send(buf, len); 388 in->Send(buf, len);
389 SocketAddress trans_addr; 389 SocketAddress trans_addr;
390 EXPECT_TRUE(out->CheckNextPacket(buf, len, &trans_addr)); 390 EXPECT_TRUE(out->CheckNextPacket(buf, len, &trans_addr));
391 391
392 out->Send(buf, len); 392 out->Send(buf, len);
393 EXPECT_TRUE(in->CheckNextPacket(buf, len, &trans_addr)); 393 EXPECT_TRUE(in->CheckNextPacket(buf, len, &trans_addr));
394 } 394 }
395 // #endif 395 // #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698