Chromium Code Reviews| Index: base/time/time_unittest.cc |
| diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc |
| index 7f3fde0c5eeac59621fd6fb5b9f4b7ce74424dcd..81a3358f08ca91a84af020dd2c646093a972bfd0 100644 |
| --- a/base/time/time_unittest.cc |
| +++ b/base/time/time_unittest.cc |
| @@ -7,6 +7,8 @@ |
| #include <time.h> |
| #include "base/compiler_specific.h" |
| +#include "base/logging.h" |
| +#include "base/strings/stringprintf.h" |
| #include "base/threading/platform_thread.h" |
| #include "build/build_config.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -541,6 +543,28 @@ TEST_F(TimeTest, TimeTOverflow) { |
| } |
| #endif |
| +#if defined(OS_ANDROID) |
| +TEST_F(TimeTest, FromLocalExplodedCrashOnAndroid) { |
|
jar (doing other things)
2013/10/21 18:15:20
nit: IMO, you should have "similar" tests on all p
|
| + // This crashed inside Time:: FromLocalExploded() on Android 4.1.2. |
| + // See http://crbug.com/287821 |
| + Time::Exploded midnight = {2013, // year |
| + 10, // month |
| + 0, // day_of_week |
| + 13, // day_of_month |
| + 0, // hour |
| + 0, // minute |
| + 0, // second |
| + }; |
| + // The string passed to putenv() must be a char* and the documentation states |
| + // that it 'becomes part of the environment', so use a static buffer. |
| + static char buffer[] = "TZ=America/Santiago"; |
| + putenv(buffer); |
| + tzset(); |
| + Time t = Time::FromLocalExploded(midnight); |
| + EXPECT_EQ(1381633200, t.ToTimeT()); |
| +} |
| +#endif // OS_ANDROID |
| + |
| TEST(TimeTicks, Deltas) { |
| for (int index = 0; index < 50; index++) { |
| TimeTicks ticks_start = TimeTicks::Now(); |