replace NtpTime->Clock with Clock->NtpTime dependency

BUG=None

Review-Url: https://codereview.webrtc.org/2393723004
Cr-Commit-Position: refs/heads/master@{#16519}
This commit is contained in:
danilchap
2017-02-09 11:15:25 -08:00
committed by Commit bot
parent 1e1c84db10
commit 3795376ba1
9 changed files with 35 additions and 47 deletions

View File

@ -271,7 +271,7 @@ TEST_F(RtcpReceiverTest, InjectSrPacketCalculatesRTT) {
EXPECT_EQ(
-1, rtcp_receiver_.RTT(kSenderSsrc, &rtt_ms, nullptr, nullptr, nullptr));
uint32_t sent_ntp = CompactNtp(NtpTime(system_clock_));
uint32_t sent_ntp = CompactNtp(system_clock_.CurrentNtpTime());
system_clock_.AdvanceTimeMilliseconds(kRttMs + kDelayMs);
rtcp::SenderReport sr;
@ -301,7 +301,7 @@ TEST_F(RtcpReceiverTest, InjectSrPacketCalculatesNegativeRTTAsOne) {
EXPECT_EQ(
-1, rtcp_receiver_.RTT(kSenderSsrc, &rtt_ms, nullptr, nullptr, nullptr));
uint32_t sent_ntp = CompactNtp(NtpTime(system_clock_));
uint32_t sent_ntp = CompactNtp(system_clock_.CurrentNtpTime());
system_clock_.AdvanceTimeMilliseconds(kRttMs + kDelayMs);
rtcp::SenderReport sr;
@ -774,7 +774,7 @@ TEST_F(RtcpReceiverTest, InjectExtendedReportsDlrrPacketWithSubBlock) {
InjectRtcpPacket(xr);
uint32_t compact_ntp_now = CompactNtp(NtpTime(system_clock_));
uint32_t compact_ntp_now = CompactNtp(system_clock_.CurrentNtpTime());
EXPECT_TRUE(rtcp_receiver_.GetAndResetXrRrRtt(&rtt_ms));
uint32_t rtt_ntp = compact_ntp_now - kDelay - kLastRR;
EXPECT_NEAR(CompactNtpRttToMs(rtt_ntp), rtt_ms, 1);
@ -793,7 +793,7 @@ TEST_F(RtcpReceiverTest, InjectExtendedReportsDlrrPacketWithMultipleSubBlocks) {
InjectRtcpPacket(xr);
uint32_t compact_ntp_now = CompactNtp(NtpTime(system_clock_));
uint32_t compact_ntp_now = CompactNtp(system_clock_.CurrentNtpTime());
int64_t rtt_ms = 0;
EXPECT_TRUE(rtcp_receiver_.GetAndResetXrRrRtt(&rtt_ms));
uint32_t rtt_ntp = compact_ntp_now - kDelay - kLastRR;
@ -859,7 +859,7 @@ TEST_F(RtcpReceiverTest, RttCalculatedAfterExtendedReportsDlrr) {
const uint32_t kDelayNtp = rand.Rand(0, 0x7fffffff);
const int64_t kDelayMs = CompactNtpRttToMs(kDelayNtp);
rtcp_receiver_.SetRtcpXrRrtrStatus(true);
NtpTime now(system_clock_);
NtpTime now = system_clock_.CurrentNtpTime();
uint32_t sent_ntp = CompactNtp(now);
system_clock_.AdvanceTimeMilliseconds(kRttMs + kDelayMs);
@ -879,7 +879,7 @@ TEST_F(RtcpReceiverTest, XrDlrrCalculatesNegativeRttAsOne) {
const int64_t kRttMs = rand.Rand(-3600 * 1000, -1);
const uint32_t kDelayNtp = rand.Rand(0, 0x7fffffff);
const int64_t kDelayMs = CompactNtpRttToMs(kDelayNtp);
NtpTime now(system_clock_);
NtpTime now = system_clock_.CurrentNtpTime();
uint32_t sent_ntp = CompactNtp(now);
system_clock_.AdvanceTimeMilliseconds(kRttMs + kDelayMs);
rtcp_receiver_.SetRtcpXrRrtrStatus(true);