Removes TimeMicros interface from ThreadProcessingFakeClock.

Bug: webrtc:9883
Change-Id: Ib48872f81f734b09e3ffa4d9d26da79177b02303
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133341
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27668}
This commit is contained in:
Sebastian Jansson
2019-04-17 12:11:20 +02:00
committed by Commit Bot
parent e47aee3b86
commit 40889f35fc
13 changed files with 86 additions and 94 deletions

View File

@ -21,18 +21,18 @@ TEST(TimeUtilTest, TimeMicrosToNtpDoesntChangeBetweenRuns) {
// TimeMicrosToNtp is not pure: it behave differently between different
// execution of the program, but should behave same during same execution.
const int64_t time_us = 12345;
clock.SetTimeMicros(2);
clock.SetTime(Timestamp::us(2));
NtpTime time_ntp = TimeMicrosToNtp(time_us);
clock.SetTimeMicros(time_us);
clock.SetTime(Timestamp::us(time_us));
EXPECT_EQ(TimeMicrosToNtp(time_us), time_ntp);
clock.SetTimeMicros(1000000);
clock.SetTime(Timestamp::us(1000000));
EXPECT_EQ(TimeMicrosToNtp(time_us), time_ntp);
}
TEST(TimeUtilTest, TimeMicrosToNtpKeepsIntervals) {
rtc::ScopedFakeClock clock;
NtpTime time_ntp1 = TimeMicrosToNtp(rtc::TimeMicros());
clock.AdvanceTimeMicros(20000);
clock.AdvanceTime(TimeDelta::ms(20));
NtpTime time_ntp2 = TimeMicrosToNtp(rtc::TimeMicros());
EXPECT_EQ(time_ntp2.ToMs() - time_ntp1.ToMs(), 20);
}