| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/ftp/ftp_directory_listing_parser.h" | 5 #include "net/ftp/ftp_directory_listing_parser.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if (type == "d") { | 84 if (type == "d") { |
| 85 EXPECT_EQ(FtpDirectoryListingEntry::DIRECTORY, entry.type); | 85 EXPECT_EQ(FtpDirectoryListingEntry::DIRECTORY, entry.type); |
| 86 } else if (type == "-") { | 86 } else if (type == "-") { |
| 87 EXPECT_EQ(FtpDirectoryListingEntry::FILE, entry.type); | 87 EXPECT_EQ(FtpDirectoryListingEntry::FILE, entry.type); |
| 88 } else if (type == "l") { | 88 } else if (type == "l") { |
| 89 EXPECT_EQ(FtpDirectoryListingEntry::SYMLINK, entry.type); | 89 EXPECT_EQ(FtpDirectoryListingEntry::SYMLINK, entry.type); |
| 90 } else { | 90 } else { |
| 91 ADD_FAILURE() << "invalid gold test data: " << type; | 91 ADD_FAILURE() << "invalid gold test data: " << type; |
| 92 } | 92 } |
| 93 | 93 |
| 94 EXPECT_EQ(UTF8ToUTF16(name), entry.name); | 94 EXPECT_EQ(base::UTF8ToUTF16(name), entry.name); |
| 95 EXPECT_EQ(size, entry.size); | 95 EXPECT_EQ(size, entry.size); |
| 96 | 96 |
| 97 base::Time::Exploded time_exploded; | 97 base::Time::Exploded time_exploded; |
| 98 entry.last_modified.LocalExplode(&time_exploded); | 98 entry.last_modified.LocalExplode(&time_exploded); |
| 99 EXPECT_EQ(year, time_exploded.year); | 99 EXPECT_EQ(year, time_exploded.year); |
| 100 EXPECT_EQ(month, time_exploded.month); | 100 EXPECT_EQ(month, time_exploded.month); |
| 101 EXPECT_EQ(day_of_month, time_exploded.day_of_month); | 101 EXPECT_EQ(day_of_month, time_exploded.day_of_month); |
| 102 EXPECT_EQ(hour, time_exploded.hour); | 102 EXPECT_EQ(hour, time_exploded.hour); |
| 103 EXPECT_EQ(minute, time_exploded.minute); | 103 EXPECT_EQ(minute, time_exploded.minute); |
| 104 } | 104 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 "dir-listing-windows-1", | 158 "dir-listing-windows-1", |
| 159 "dir-listing-windows-2", | 159 "dir-listing-windows-2", |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 INSTANTIATE_TEST_CASE_P(, FtpDirectoryListingParserTest, | 162 INSTANTIATE_TEST_CASE_P(, FtpDirectoryListingParserTest, |
| 163 testing::ValuesIn(kTestFiles)); | 163 testing::ValuesIn(kTestFiles)); |
| 164 | 164 |
| 165 } // namespace | 165 } // namespace |
| 166 | 166 |
| 167 } // namespace net | 167 } // namespace net |
| OLD | NEW |