OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_unittest.h" | 5 #include "net/ftp/ftp_directory_listing_parser_unittest.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "net/ftp/ftp_directory_listing_parser_windows.h" | 10 #include "net/ftp/ftp_directory_listing_parser_windows.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 typedef net::FtpDirectoryListingParserTest FtpDirectoryListingParserWindowsTest; | 14 typedef net::FtpDirectoryListingParserTest FtpDirectoryListingParserWindowsTest; |
15 | 15 |
16 TEST_F(FtpDirectoryListingParserWindowsTest, Good) { | 16 TEST_F(FtpDirectoryListingParserWindowsTest, Good) { |
17 base::Time::Exploded now_exploded; | |
18 base::Time::Now().LocalExplode(&now_exploded); | |
19 | |
20 const struct SingleLineTestData good_cases[] = { | 17 const struct SingleLineTestData good_cases[] = { |
21 { "11-02-09 05:32PM <DIR> NT", | 18 { "11-02-09 05:32PM <DIR> NT", |
22 net::FtpDirectoryListingEntry::DIRECTORY, "NT", -1, | 19 net::FtpDirectoryListingEntry::DIRECTORY, "NT", -1, |
23 2009, 11, 2, 17, 32 }, | 20 2009, 11, 2, 17, 32 }, |
24 { "01-06-09 02:42PM 458 Readme.txt", | 21 { "01-06-09 02:42PM 458 Readme.txt", |
25 net::FtpDirectoryListingEntry::FILE, "Readme.txt", 458, | 22 net::FtpDirectoryListingEntry::FILE, "Readme.txt", 458, |
26 2009, 1, 6, 14, 42 }, | 23 2009, 1, 6, 14, 42 }, |
27 { "01-06-09 02:42AM 1 Readme.txt", | 24 { "01-06-09 02:42AM 1 Readme.txt", |
28 net::FtpDirectoryListingEntry::FILE, "Readme.txt", 1, | 25 net::FtpDirectoryListingEntry::FILE, "Readme.txt", 1, |
29 2009, 1, 6, 2, 42 }, | 26 2009, 1, 6, 2, 42 }, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 "12-25-10 12:99AM 0 minutes out of range", | 79 "12-25-10 12:99AM 0 minutes out of range", |
83 "12-25-10 12:00ZM 0 what does ZM mean", | 80 "12-25-10 12:00ZM 0 what does ZM mean", |
84 }; | 81 }; |
85 for (size_t i = 0; i < arraysize(bad_cases); i++) { | 82 for (size_t i = 0; i < arraysize(bad_cases); i++) { |
86 net::FtpDirectoryListingParserWindows parser; | 83 net::FtpDirectoryListingParserWindows parser; |
87 EXPECT_FALSE(parser.ConsumeLine(UTF8ToUTF16(bad_cases[i]))) << bad_cases[i]; | 84 EXPECT_FALSE(parser.ConsumeLine(UTF8ToUTF16(bad_cases[i]))) << bad_cases[i]; |
88 } | 85 } |
89 } | 86 } |
90 | 87 |
91 } // namespace | 88 } // namespace |
OLD | NEW |