diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-18 02:31:04 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-18 02:31:04 +0000 |
commit | 5ba5dab9db36b81d2a808313967233d56a4d4b0c (patch) | |
tree | e35c41787d1c1ef340c6f0bf2e2a111acbd9cf55 /base | |
parent | b27a4adfce4e9dd35eb6d361e2c6b509fab85f56 (diff) | |
download | chromium_src-5ba5dab9db36b81d2a808313967233d56a4d4b0c.zip chromium_src-5ba5dab9db36b81d2a808313967233d56a4d4b0c.tar.gz chromium_src-5ba5dab9db36b81d2a808313967233d56a4d4b0c.tar.bz2 |
Reland http://codereview.chromium.org/4139008, with a different
approach to creating version numbers. The old one had troubles
with timezones. This one is simpler and better.
BUG=49233
TEST=Covered by unit tests
Review URL: http://codereview.chromium.org/4471001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/time_unittest.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/base/time_unittest.cc b/base/time_unittest.cc index 21e6f89..6ddf4d3 100644 --- a/base/time_unittest.cc +++ b/base/time_unittest.cc @@ -52,6 +52,19 @@ TEST(Time, TimeT) { EXPECT_EQ(0, Time::FromTimeT(0).ToInternalValue()); } +TEST(Time, FromExplodedWithMilliseconds) { + // Some platform implementations of FromExploded are liable to drop + // milliseconds if we aren't careful. + Time now = Time::NowFromSystemTime(); + Time::Exploded exploded1 = {0}; + now.UTCExplode(&exploded1); + exploded1.millisecond = 500; + Time time = Time::FromUTCExploded(exploded1); + Time::Exploded exploded2 = {0}; + time.UTCExplode(&exploded2); + EXPECT_EQ(exploded1.millisecond, exploded2.millisecond); +} + TEST(Time, ZeroIsSymmetric) { Time zero_time(Time::FromTimeT(0)); EXPECT_EQ(0, zero_time.ToTimeT()); |