diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-03 18:18:32 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-03 18:18:32 +0000 |
commit | 736f434fb17fd92e2856d7c2d5c28bea71fdebe3 (patch) | |
tree | aff14a35e709e5112786e7d04af15360a5aaf564 /base/time_unittest.cc | |
parent | 2d31666a58e746b7a1d415c99e5f68ad9256d236 (diff) | |
download | chromium_src-736f434fb17fd92e2856d7c2d5c28bea71fdebe3.zip chromium_src-736f434fb17fd92e2856d7c2d5c28bea71fdebe3.tar.gz chromium_src-736f434fb17fd92e2856d7c2d5c28bea71fdebe3.tar.bz2 |
Add at least some code that tests UnreliableHighResNow. I realize it can be broken, but we should test it if we're going to have the code.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/time_unittest.cc')
-rw-r--r-- | base/time_unittest.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/time_unittest.cc b/base/time_unittest.cc index 3cd9595..039913b 100644 --- a/base/time_unittest.cc +++ b/base/time_unittest.cc @@ -95,6 +95,14 @@ TEST(TimeTicks, Deltas) { EXPECT_EQ(delta.InSeconds(), 0); } +TEST(TimeTicks, UnreliableHighResNow) { + TimeTicks ticks_start = TimeTicks::UnreliableHighResNow(); + PlatformThread::Sleep(10); + TimeTicks ticks_stop = TimeTicks::UnreliableHighResNow(); + TimeDelta delta = ticks_stop - ticks_start; + EXPECT_GE(delta.InMilliseconds(), 10); +} + TEST(TimeDelta, FromAndIn) { EXPECT_TRUE(TimeDelta::FromDays(2) == TimeDelta::FromHours(48)); EXPECT_TRUE(TimeDelta::FromHours(3) == TimeDelta::FromMinutes(180)); |