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

Unified Diff: net/tools/quic/quic_epoll_clock_test.cc

Issue 1421873007: Change QuicWallTime to have microsecond granularity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106444524
Patch Set: Created 5 years, 1 month 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
« net/tools/quic/quic_epoll_clock.h ('K') | « net/tools/quic/quic_epoll_clock.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_epoll_clock_test.cc
diff --git a/net/tools/quic/quic_epoll_clock_test.cc b/net/tools/quic/quic_epoll_clock_test.cc
index 1ed1d15c1d7eaa6d541239c240b113c6bb90dbbf..8fe492f2acf57883269bf34578f1c52f3f9e70e4 100644
--- a/net/tools/quic/quic_epoll_clock_test.cc
+++ b/net/tools/quic/quic_epoll_clock_test.cc
@@ -18,10 +18,18 @@ TEST(QuicEpollClockTest, ApproximateNowInUsec) {
epoll_server.set_now_in_usec(1000000);
EXPECT_EQ(1000000,
clock.ApproximateNow().Subtract(QuicTime::Zero()).ToMicroseconds());
+ EXPECT_EQ(1u, clock.WallNow().ToUNIXSeconds());
+ EXPECT_EQ(1000000u, clock.WallNow().ToUNIXMicroseconds());
epoll_server.AdvanceBy(5);
EXPECT_EQ(1000005,
clock.ApproximateNow().Subtract(QuicTime::Zero()).ToMicroseconds());
+ EXPECT_EQ(1u, clock.WallNow().ToUNIXSeconds());
+ EXPECT_EQ(1000005u, clock.WallNow().ToUNIXMicroseconds());
+
+ epoll_server.AdvanceBy(10 * 1000000);
+ EXPECT_EQ(11u, clock.WallNow().ToUNIXSeconds());
+ EXPECT_EQ(11000005u, clock.WallNow().ToUNIXMicroseconds());
}
TEST(QuicEpollClockTest, NowInUsec) {
« net/tools/quic/quic_epoll_clock.h ('K') | « net/tools/quic/quic_epoll_clock.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698