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

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

Issue 1421853006: Landing Recent QUIC changes until: Fri Oct 30 22:23:58 2015 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments 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
« no previous file with comments | « net/tools/quic/quic_epoll_clock.cc ('k') | net/tools/quic/quic_server_bin.cc » ('j') | 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..6fe7c0e46cf2a82edaa8fd6d891e3118ee496ac5 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) {
@@ -37,21 +45,6 @@ TEST(QuicEpollClockTest, NowInUsec) {
clock.Now().Subtract(QuicTime::Zero()).ToMicroseconds());
}
-TEST(QuicEpollClockTest, WallNow) {
- MockEpollServer epoll_server;
- QuicEpollClock clock(&epoll_server);
-
- 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.ToTimeT()), now.ToUNIXSeconds());
- EXPECT_LE(now.ToUNIXSeconds(), static_cast<uint64>(end.ToTimeT()));
- }
-}
-
} // namespace test
} // namespace tools
} // namespace net
« no previous file with comments | « net/tools/quic/quic_epoll_clock.cc ('k') | net/tools/quic/quic_server_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698