|  | 
| 19 | 19 | #include "base/files/scoped_temp_dir.h" | 
| 20 | 20 | #include "base/functional/bind.h" | 
| 21 | 21 | #include "base/hash/md5.h" | 
|  | 22 | +#include "base/i18n/time_formatting.h" | 
| 22 | 23 | #include "base/path_service.h" | 
| 23 | 24 | #include "base/run_loop.h" | 
| 24 | 25 | #include "base/strings/string_piece.h" | 
|  | 
| 31 | 32 | #include "testing/gmock/include/gmock/gmock.h" | 
| 32 | 33 | #include "testing/gtest/include/gtest/gtest.h" | 
| 33 | 34 | #include "testing/platform_test.h" | 
|  | 35 | +#include "third_party/icu/source/i18n/unicode/timezone.h" | 
| 34 | 36 | #include "third_party/zlib/google/zip_internal.h" | 
| 35 | 37 | 
 | 
| 36 | 38 | using ::testing::_; | 
| @@ -288,18 +290,10 @@ TEST_F(ZipReaderTest, RegularFile) { | 
| 288 | 290 | 
 | 
| 289 | 291 |   EXPECT_EQ(target_path, entry->path); | 
| 290 | 292 |   EXPECT_EQ(13527, entry->original_size); | 
| 291 |  | - | 
| 292 |  | -  // The expected time stamp: 2009-05-29 06:22:20 | 
| 293 |  | -  base::Time::Exploded exploded = {};  // Zero-clear. | 
| 294 |  | -  entry->last_modified.UTCExplode(&exploded); | 
| 295 |  | -  EXPECT_EQ(2009, exploded.year); | 
| 296 |  | -  EXPECT_EQ(5, exploded.month); | 
| 297 |  | -  EXPECT_EQ(29, exploded.day_of_month); | 
| 298 |  | -  EXPECT_EQ(6, exploded.hour); | 
| 299 |  | -  EXPECT_EQ(22, exploded.minute); | 
| 300 |  | -  EXPECT_EQ(20, exploded.second); | 
| 301 |  | -  EXPECT_EQ(0, exploded.millisecond); | 
| 302 |  | - | 
|  | 293 | +  EXPECT_EQ("2009-05-29 06:22:20.000", | 
|  | 294 | +            base::UnlocalizedTimeFormatWithPattern(entry->last_modified, | 
|  | 295 | +                                                   "y-MM-dd HH:mm:ss.SSS", | 
|  | 296 | +                                                   icu::TimeZone::getGMT())); | 
| 303 | 297 |   EXPECT_FALSE(entry->is_unsafe); | 
| 304 | 298 |   EXPECT_FALSE(entry->is_directory); | 
| 305 | 299 | } | 
| @@ -396,18 +390,10 @@ TEST_F(ZipReaderTest, Directory) { | 
| 396 | 390 |   EXPECT_EQ(target_path, entry->path); | 
| 397 | 391 |   // The directory size should be zero. | 
| 398 | 392 |   EXPECT_EQ(0, entry->original_size); | 
| 399 |  | - | 
| 400 |  | -  // The expected time stamp: 2009-05-31 15:49:52 | 
| 401 |  | -  base::Time::Exploded exploded = {};  // Zero-clear. | 
| 402 |  | -  entry->last_modified.UTCExplode(&exploded); | 
| 403 |  | -  EXPECT_EQ(2009, exploded.year); | 
| 404 |  | -  EXPECT_EQ(5, exploded.month); | 
| 405 |  | -  EXPECT_EQ(31, exploded.day_of_month); | 
| 406 |  | -  EXPECT_EQ(15, exploded.hour); | 
| 407 |  | -  EXPECT_EQ(49, exploded.minute); | 
| 408 |  | -  EXPECT_EQ(52, exploded.second); | 
| 409 |  | -  EXPECT_EQ(0, exploded.millisecond); | 
| 410 |  | - | 
|  | 393 | +  EXPECT_EQ("2009-05-31 15:49:52.000", | 
|  | 394 | +            base::UnlocalizedTimeFormatWithPattern(entry->last_modified, | 
|  | 395 | +                                                   "y-MM-dd HH:mm:ss.SSS", | 
|  | 396 | +                                                   icu::TimeZone::getGMT())); | 
| 411 | 397 |   EXPECT_FALSE(entry->is_unsafe); | 
| 412 | 398 |   EXPECT_TRUE(entry->is_directory); | 
| 413 | 399 | } | 
|  | 
0 commit comments