Delete assumption TimeMicrosToNtp can match RealTimeClock
Flakiness of the test reveals this assumption doesn't hold and shouldn't be rely on.
Currently there is no code that use it. Plans to rely on it silently adjusted.
Bug: webrtc:8610
Change-Id: Id24f2a36c8fb188b518f5301c4b278836885d140
Reviewed-on: https://webrtc-review.googlesource.com/56860
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22160}
diff --git a/modules/rtp_rtcp/source/time_util.h b/modules/rtp_rtcp/source/time_util.h
index 3e7d1e2..672722c 100644
--- a/modules/rtp_rtcp/source/time_util.h
+++ b/modules/rtp_rtcp/source/time_util.h
@@ -20,8 +20,8 @@
// Converts time obtained using rtc::TimeMicros to ntp format.
// TimeMicrosToNtp guarantees difference of the returned values matches
// difference of the passed values.
-// As a result TimeMicrosToNtp(rtc::TimeMicros()) doesn't guarantte to match
-// system time after first call.
+// As a result TimeMicrosToNtp(rtc::TimeMicros()) doesn't guarantee to match
+// system time.
NtpTime TimeMicrosToNtp(int64_t time_us);
// Converts NTP timestamp to RTP timestamp.
diff --git a/modules/rtp_rtcp/source/time_util_unittest.cc b/modules/rtp_rtcp/source/time_util_unittest.cc
index 25cda49..0ff4f7b 100644
--- a/modules/rtp_rtcp/source/time_util_unittest.cc
+++ b/modules/rtp_rtcp/source/time_util_unittest.cc
@@ -16,29 +16,6 @@
namespace webrtc {
-// Disabled as flake: http://bugs.webrtc.org/8610
-#ifdef WEBRTC_IOS
-#define MAYBE_TimeMicrosToNtpMatchRealTimeClockInitially \
- DISABLED_TimeMicrosToNtpMatchRealTimeClockInitially
-#else
-#define MAYBE_TimeMicrosToNtpMatchRealTimeClockInitially \
- TimeMicrosToNtpMatchRealTimeClockInitially
-#endif
-TEST(TimeUtilTest, MAYBE_TimeMicrosToNtpMatchRealTimeClockInitially) {
- Clock* legacy_clock = Clock::GetRealTimeClock();
- NtpTime before_legacy_time = TimeMicrosToNtp(rtc::TimeMicros());
- NtpTime legacy_time = legacy_clock->CurrentNtpTime();
- NtpTime after_legacy_time = TimeMicrosToNtp(rtc::TimeMicros());
-
- // This test will fail once every 136 years, when NtpTime wraparound.
- // More often than that, it will fail if system adjust ntp time while test
- // is running.
- // To mitigate ntp time adjustment and potentional different precisions of
- // Clock and TimeMicrosToNtp, relax expectation by a millisecond.
- EXPECT_GE(legacy_time.ToMs(), before_legacy_time.ToMs() - 1);
- EXPECT_LE(legacy_time.ToMs(), after_legacy_time.ToMs() + 1);
-}
-
TEST(TimeUtilTest, TimeMicrosToNtpDoesntChangeBetweenRuns) {
rtc::ScopedFakeClock clock;
// TimeMicrosToNtp is not pure: it behave differently between different