From 5b53b0eeb4068bd446c2f41939ea51113b73fc26 Mon Sep 17 00:00:00 2001 From: Stefan Holmer Date: Mon, 23 May 2016 22:56:08 +0200 Subject: [PATCH] Remove timing dependent packet checks from socket tests. This avoids flaky tests and the check itself doesn't provide much value anyway. TBR=pthatcher@webrtc.org Review URL: https://codereview.webrtc.org/2005993002 . Cr-Commit-Position: refs/heads/master@{#12855} --- webrtc/base/testclient.cc | 9 --------- webrtc/base/testclient.h | 1 - 2 files changed, 10 deletions(-) diff --git a/webrtc/base/testclient.cc b/webrtc/base/testclient.cc index fbb4f0cdf3..fcf64e7d62 100644 --- a/webrtc/base/testclient.cc +++ b/webrtc/base/testclient.cc @@ -105,21 +105,12 @@ bool TestClient::CheckTimestamp(int64_t packet_timestamp) { if (packet_timestamp == -1) { res = false; } - int64_t time_us = rtc::TimeMicros(); if (prev_packet_timestamp_ != -1) { if (packet_timestamp < prev_packet_timestamp_) { res = false; } - const int64_t kErrorMarginUs = 20000; - if (packet_timestamp - prev_packet_timestamp_ < - time_us - prev_time_us_ - kErrorMarginUs || - packet_timestamp - prev_packet_timestamp_ > - time_us - prev_time_us_ + kErrorMarginUs) { - res = false; - } } prev_packet_timestamp_ = packet_timestamp; - prev_time_us_ = time_us; return res; } diff --git a/webrtc/base/testclient.h b/webrtc/base/testclient.h index d78e142a2f..6c0cfbecaf 100644 --- a/webrtc/base/testclient.h +++ b/webrtc/base/testclient.h @@ -96,7 +96,6 @@ class TestClient : public sigslot::has_slots<> { std::vector* packets_; bool ready_to_send_; int64_t prev_packet_timestamp_; - int64_t prev_time_us_; RTC_DISALLOW_COPY_AND_ASSIGN(TestClient); };