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 30 matching lines...) Expand all Loading... |
41 test_dir = test_dir.AppendASCII("net"); | 41 test_dir = test_dir.AppendASCII("net"); |
42 test_dir = test_dir.AppendASCII("data"); | 42 test_dir = test_dir.AppendASCII("data"); |
43 test_dir = test_dir.AppendASCII("ftp"); | 43 test_dir = test_dir.AppendASCII("ftp"); |
44 | 44 |
45 base::Time::Exploded mock_current_time_exploded = { 0 }; | 45 base::Time::Exploded mock_current_time_exploded = { 0 }; |
46 mock_current_time_exploded.year = 1994; | 46 mock_current_time_exploded.year = 1994; |
47 mock_current_time_exploded.month = 11; | 47 mock_current_time_exploded.month = 11; |
48 mock_current_time_exploded.day_of_month = 15; | 48 mock_current_time_exploded.day_of_month = 15; |
49 mock_current_time_exploded.hour = 12; | 49 mock_current_time_exploded.hour = 12; |
50 mock_current_time_exploded.minute = 45; | 50 mock_current_time_exploded.minute = 45; |
51 base::Time mock_current_time( | 51 base::Time mock_current_time; |
52 base::Time::FromLocalExploded(mock_current_time_exploded)); | 52 EXPECT_TRUE(base::Time::FromLocalExploded(mock_current_time_exploded, |
| 53 &mock_current_time)); |
53 | 54 |
54 SCOPED_TRACE(base::StringPrintf("Test case: %s", param.name)); | 55 SCOPED_TRACE(base::StringPrintf("Test case: %s", param.name)); |
55 | 56 |
56 std::string test_listing; | 57 std::string test_listing; |
57 EXPECT_TRUE( | 58 EXPECT_TRUE( |
58 base::ReadFileToString(test_dir.AppendASCII(param.name), &test_listing)); | 59 base::ReadFileToString(test_dir.AppendASCII(param.name), &test_listing)); |
59 | 60 |
60 std::vector<FtpDirectoryListingEntry> entries; | 61 std::vector<FtpDirectoryListingEntry> entries; |
61 EXPECT_EQ( | 62 EXPECT_EQ( |
62 param.expected_result, | 63 param.expected_result, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 }; | 176 }; |
176 | 177 |
177 INSTANTIATE_TEST_CASE_P(, | 178 INSTANTIATE_TEST_CASE_P(, |
178 FtpDirectoryListingParserTest, | 179 FtpDirectoryListingParserTest, |
179 testing::ValuesIn(kTestParams), | 180 testing::ValuesIn(kTestParams), |
180 TestName); | 181 TestName); |
181 | 182 |
182 } // namespace | 183 } // namespace |
183 | 184 |
184 } // namespace net | 185 } // namespace net |
OLD | NEW |