Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: net/quic/quic_clock_test.cc

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_clock.cc ('k') | net/quic/quic_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « net/quic/quic_clock.cc ('k') | net/quic/quic_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698