| 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_ls.h" | 10 #include "net/ftp/ftp_directory_listing_parser_ls.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 1994, 7, 1, 2, 15 }, | 42 1994, 7, 1, 2, 15 }, |
| 43 { "-rw-r--r-- 1 2 3 3447432 May 18 2009 Foo - Manual.pdf", | 43 { "-rw-r--r-- 1 2 3 3447432 May 18 2009 Foo - Manual.pdf", |
| 44 net::FtpDirectoryListingEntry::FILE, "Foo - Manual.pdf", 3447432, | 44 net::FtpDirectoryListingEntry::FILE, "Foo - Manual.pdf", 3447432, |
| 45 2009, 5, 18, 0, 0 }, | 45 2009, 5, 18, 0, 0 }, |
| 46 { "d-wx-wx-wt+ 4 ftp 989 512 Dec 8 15:54 incoming", | 46 { "d-wx-wx-wt+ 4 ftp 989 512 Dec 8 15:54 incoming", |
| 47 net::FtpDirectoryListingEntry::DIRECTORY, "incoming", -1, | 47 net::FtpDirectoryListingEntry::DIRECTORY, "incoming", -1, |
| 48 1993, 12, 8, 15, 54 }, | 48 1993, 12, 8, 15, 54 }, |
| 49 { "drwxrwxrwx 1 owner group 0 Sep 13 0:30 audio", | 49 { "drwxrwxrwx 1 owner group 0 Sep 13 0:30 audio", |
| 50 net::FtpDirectoryListingEntry::DIRECTORY, "audio", -1, | 50 net::FtpDirectoryListingEntry::DIRECTORY, "audio", -1, |
| 51 1994, 9, 13, 0, 30 }, | 51 1994, 9, 13, 0, 30 }, |
| 52 { "lrwxrwxrwx 1 0 0 26 Sep 18 2008 pub", |
| 53 net::FtpDirectoryListingEntry::SYMLINK, "pub", -1, |
| 54 2008, 9, 18, 0, 0 }, |
| 52 | 55 |
| 53 // Tests for the wu-ftpd variant: | 56 // Tests for the wu-ftpd variant: |
| 54 { "drwxr-xr-x 2 sys 512 Mar 27 2009 pub", | 57 { "drwxr-xr-x 2 sys 512 Mar 27 2009 pub", |
| 55 net::FtpDirectoryListingEntry::DIRECTORY, "pub", -1, | 58 net::FtpDirectoryListingEntry::DIRECTORY, "pub", -1, |
| 56 2009, 3, 27, 0, 0 }, | 59 2009, 3, 27, 0, 0 }, |
| 57 { "lrwxrwxrwx 0 0 26 Sep 18 2008 pub -> vol/1/.CLUSTER/var_ftp/pub", | 60 { "lrwxrwxrwx 0 0 26 Sep 18 2008 pub -> vol/1/.CLUSTER/var_ftp/pub", |
| 58 net::FtpDirectoryListingEntry::SYMLINK, "pub", -1, | 61 net::FtpDirectoryListingEntry::SYMLINK, "pub", -1, |
| 59 2008, 9, 18, 0, 0 }, | 62 2008, 9, 18, 0, 0 }, |
| 60 { "drwxr-xr-x (?) (?) 4096 Apr 8 2007 jigdo", | 63 { "drwxr-xr-x (?) (?) 4096 Apr 8 2007 jigdo", |
| 61 net::FtpDirectoryListingEntry::DIRECTORY, "jigdo", -1, | 64 net::FtpDirectoryListingEntry::DIRECTORY, "jigdo", -1, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 "drwxr-xr-x 3 ftp 4096 May 15 18:11", | 120 "drwxr-xr-x 3 ftp 4096 May 15 18:11", |
| 118 "drwxr-xr-x folder 0 May 15 18:11", | 121 "drwxr-xr-x folder 0 May 15 18:11", |
| 119 }; | 122 }; |
| 120 for (size_t i = 0; i < arraysize(bad_cases); i++) { | 123 for (size_t i = 0; i < arraysize(bad_cases); i++) { |
| 121 net::FtpDirectoryListingParserLs parser(mock_current_time); | 124 net::FtpDirectoryListingParserLs parser(mock_current_time); |
| 122 EXPECT_FALSE(parser.ConsumeLine(UTF8ToUTF16(bad_cases[i]))) << bad_cases[i]; | 125 EXPECT_FALSE(parser.ConsumeLine(UTF8ToUTF16(bad_cases[i]))) << bad_cases[i]; |
| 123 } | 126 } |
| 124 } | 127 } |
| 125 | 128 |
| 126 } // namespace | 129 } // namespace |
| OLD | NEW |