Index: base/time/time_unittest.cc |
diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc |
index 8906c3bee193e1b876ceb0627a3cc844693fca6a..f25315ff647139634fdd2d93a7430381b5154795 100644 |
--- a/base/time/time_unittest.cc |
+++ b/base/time/time_unittest.cc |
@@ -159,6 +159,15 @@ TEST_F(TimeTest, JsTime) { |
EXPECT_EQ(700.0003, t.ToDoubleT()); |
t = Time::FromDoubleT(800.73); |
EXPECT_EQ(800730.0, t.ToJsTime()); |
+ |
+ // Correctly convert |- epoch offset| which is valid time in javascript. |
+ Time minusEpoch = Time::FromJsTime(-11644473600000.0); |
+ EXPECT_EQ(-11644473600000, minusEpoch.ToJsTime()); |
+ |
+ // Check conversion of boundary javascript time values. |
+ // See http://www.ecma-international.org/ecma-262/6.0/#sec-timeclip |
+ EXPECT_EQ(-8.46e15, Time::FromJsTime(-8.46e15).ToJsTime()); |
+ EXPECT_EQ(8.46e15, Time::FromJsTime(8.46e15).ToJsTime()); |
} |
#if defined(OS_POSIX) |