Index: net/quic/quic_clock_test.cc |
diff --git a/net/quic/quic_clock_test.cc b/net/quic/quic_clock_test.cc |
index 1f2859424a2c7ef9536ee9e52500a307d9f74b02..7b106c1efdbd1176fc054c4b3758ebb63e9a5d7b 100644 |
--- a/net/quic/quic_clock_test.cc |
+++ b/net/quic/quic_clock_test.cc |
@@ -20,15 +20,20 @@ TEST(QuicClockTest, Now) { |
EXPECT_LE(now, end); |
} |
-TEST(QuicClockTest, NowAsDeltaSinceUnixEpoch) { |
+TEST(QuicClockTest, WallNow) { |
QuicClock clock; |
- QuicTime::Delta start(base::Time::Now() - base::Time::UnixEpoch()); |
- QuicTime::Delta now = clock.NowAsDeltaSinceUnixEpoch(); |
- QuicTime::Delta end(base::Time::Now() - base::Time::UnixEpoch()); |
- |
- EXPECT_LE(start, now); |
- EXPECT_LE(now, end); |
+ base::Time start = base::Time::Now(); |
+ QuicWallTime now = clock.WallNow(); |
+ base::Time end = base::Time::Now(); |
+ |
+ // If end > start, then we can check now is between start and end. |
+ if (end > start) { |
+ EXPECT_LE(static_cast<uint64>(start.ToInternalValue() / 1000000), |
+ now.ToUNIXSeconds()); |
+ EXPECT_LE(now.ToUNIXSeconds(), |
+ static_cast<uint64>(end.ToInternalValue() / 1000000)); |
+ } |
} |
} // namespace test |