| 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/files/file_util.h" | 7 #include "base/files/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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // Special case for empty listings. | 75 // Special case for empty listings. |
| 76 if (lines.size() == 1 && lines[0].empty()) | 76 if (lines.size() == 1 && lines[0].empty()) |
| 77 lines.clear(); | 77 lines.clear(); |
| 78 | 78 |
| 79 ASSERT_EQ(9 * entries.size(), lines.size()); | 79 ASSERT_EQ(9 * entries.size(), lines.size()); |
| 80 | 80 |
| 81 for (size_t i = 0; i < lines.size() / 9; i++) { | 81 for (size_t i = 0; i < lines.size() / 9; i++) { |
| 82 std::string type(lines[9 * i]); | 82 std::string type(lines[9 * i]); |
| 83 std::string name(lines[9 * i + 1]); | 83 std::string name(lines[9 * i + 1]); |
| 84 int64 size; | 84 int64_t size; |
| 85 base::StringToInt64(lines[9 * i + 2], &size); | 85 base::StringToInt64(lines[9 * i + 2], &size); |
| 86 | 86 |
| 87 SCOPED_TRACE(base::StringPrintf("Filename: %s", name.c_str())); | 87 SCOPED_TRACE(base::StringPrintf("Filename: %s", name.c_str())); |
| 88 | 88 |
| 89 int year, month, day_of_month, hour, minute; | 89 int year, month, day_of_month, hour, minute; |
| 90 base::StringToInt(lines[9 * i + 3], &year); | 90 base::StringToInt(lines[9 * i + 3], &year); |
| 91 base::StringToInt(lines[9 * i + 4], &month); | 91 base::StringToInt(lines[9 * i + 4], &month); |
| 92 base::StringToInt(lines[9 * i + 5], &day_of_month); | 92 base::StringToInt(lines[9 * i + 5], &day_of_month); |
| 93 base::StringToInt(lines[9 * i + 6], &hour); | 93 base::StringToInt(lines[9 * i + 6], &hour); |
| 94 base::StringToInt(lines[9 * i + 7], &minute); | 94 base::StringToInt(lines[9 * i + 7], &minute); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 INSTANTIATE_TEST_CASE_P(, | 177 INSTANTIATE_TEST_CASE_P(, |
| 178 FtpDirectoryListingParserTest, | 178 FtpDirectoryListingParserTest, |
| 179 testing::ValuesIn(kTestParams), | 179 testing::ValuesIn(kTestParams), |
| 180 TestName); | 180 TestName); |
| 181 | 181 |
| 182 } // namespace | 182 } // namespace |
| 183 | 183 |
| 184 } // namespace net | 184 } // namespace net |
| OLD | NEW |