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

Unified Diff: base/time_unittest.cc

Issue 4471001: Reland http://codereview.chromium.org/4139008, with a different (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: this crap still does not work Created 10 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 | « base/time_mac.cc ('k') | chrome/browser/extensions/convert_user_script.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time_unittest.cc
diff --git a/base/time_unittest.cc b/base/time_unittest.cc
index 21e6f89c6d826fccd1e05cf979bd7546c49162f9..6ddf4d326ce2d2c8715fb829f186b3a56ec7a6ee 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());
« no previous file with comments | « base/time_mac.cc ('k') | chrome/browser/extensions/convert_user_script.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698