Chromium Code Reviews| Index: base/time/time_unittest.cc |
| diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc |
| index 4f47d56522b0d30b883f86b236110ca9722750f5..8e880edf5182105b8f72766847554dc3da2d1730 100644 |
| --- a/base/time/time_unittest.cc |
| +++ b/base/time/time_unittest.cc |
| @@ -21,6 +21,11 @@ namespace base { |
| namespace { |
| +// For TimeDelta::ConstexprInitialization |
| +enum { kExpectedDeltaInMilliseconds = 10 }; |
|
miu
2016/08/11 21:48:56
Is it necessary for this to be an enum to trigger
liberato (no reviews please)
2016/08/11 22:10:35
it's not necessary.
originally, i had it as const
|
| +constexpr TimeDelta kConstexprTimeDelta = |
| + TimeDelta::FromMilliseconds(kExpectedDeltaInMilliseconds); |
| + |
| TEST(TimeTestOutOfBounds, FromExplodedOutOfBoundsTime) { |
| // FromUTCExploded must set time to Time(0) and failure, if the day is set to |
| // 31 on a 28-30 day month. Test |exploded| returns Time(0) on 31st of |
| @@ -1093,6 +1098,11 @@ TEST(TimeDelta, Overflows) { |
| EXPECT_EQ(one_second, (ticks_now + one_second) - ticks_now); |
| } |
| +TEST(TimeDelta, ConstexprInitialization) { |
|
miu
2016/08/11 21:48:56
Please put these changes in time_win_unittest.cc i
liberato (no reviews please)
2016/08/11 22:10:35
Done.
|
| + // Make sure that TimeDelta works around crbug.com/635974 |
| + EXPECT_EQ(kExpectedDeltaInMilliseconds, kConstexprTimeDelta.InMilliseconds()); |
| +} |
| + |
| TEST(TimeDeltaLogging, DCheckEqCompiles) { |
| DCHECK_EQ(TimeDelta(), TimeDelta()); |
| } |