This source file includes following definitions.
- TEST
- TEST
#include "net/quic/quic_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace test {
TEST(QuicClockTest, Now) {
QuicClock clock;
QuicTime start(base::TimeTicks::Now());
QuicTime now = clock.ApproximateNow();
QuicTime end(base::TimeTicks::Now());
EXPECT_LE(start, now);
EXPECT_LE(now, end);
}
TEST(QuicClockTest, WallNow) {
QuicClock clock;
base::Time start = base::Time::Now();
QuicWallTime now = clock.WallNow();
base::Time end = base::Time::Now();
if (end > start) {
EXPECT_LE(static_cast<uint64>(start.ToTimeT()), now.ToUNIXSeconds());
EXPECT_LE(now.ToUNIXSeconds(), static_cast<uint64>(end.ToTimeT()));
}
}
}
}