Read recv timestamps from socket (posix only).

This helps a lot on Android devices where the user threads can be scheduled with low priority when the app is in the background, causing spurious significantly delayed before a packet can be read from the socket. With this patch the timestamp is taken by the kernel when the packet actually arrives.

R=juberti@chromium.org
TBR=juberti@webrtc.org

BUG=webrtc:5773

Review URL: https://codereview.webrtc.org/1944683002 .

Cr-Commit-Position: refs/heads/master@{#12850}
diff --git a/webrtc/base/physicalsocketserver_unittest.cc b/webrtc/base/physicalsocketserver_unittest.cc
index b069baa..bd1acfb 100644
--- a/webrtc/base/physicalsocketserver_unittest.cc
+++ b/webrtc/base/physicalsocketserver_unittest.cc
@@ -386,6 +386,21 @@
 
 #if defined(WEBRTC_POSIX)
 
+#if !defined(WEBRTC_MAC)
+TEST_F(PhysicalSocketTest, TestSocketRecvTimestampIPv4) {
+  SocketTest::TestSocketRecvTimestamp();
+}
+
+#if defined(WEBRTC_LINUX)
+#define MAYBE_TestSocketRecvTimestampIPv6 DISABLED_TestSocketRecvTimestampIPv6
+#else
+#define MAYBE_TestSocketRecvTimestampIPv6 TestSocketRecvTimestampIPv6
+#endif
+TEST_F(PhysicalSocketTest, MAYBE_TestSocketRecvTimestampIPv6) {
+  SocketTest::TestSocketRecvTimestamp();
+}
+#endif
+
 class PosixSignalDeliveryTest : public testing::Test {
  public:
   static void RecordSignal(int signum) {