Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Side by Side Diff: net/ftp/ftp_directory_listing_parser_ls_unittest.cc

Issue 3774002: Fix FTP directory listing for ftp.cisco.com. (Closed)
Patch Set: fixes Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_ls.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 net::FtpDirectoryListingEntry::FILE, "UpTime.exe", 13274, 68 net::FtpDirectoryListingEntry::FILE, "UpTime.exe", 13274,
69 2006, 3, 1, 0, 0 }, 69 2006, 3, 1, 0, 0 },
70 { "dr--r--r-- 1 ftp ----- 0 Nov 17 17:08 kernels", 70 { "dr--r--r-- 1 ftp ----- 0 Nov 17 17:08 kernels",
71 net::FtpDirectoryListingEntry::DIRECTORY, "kernels", -1, 71 net::FtpDirectoryListingEntry::DIRECTORY, "kernels", -1,
72 1993, 11, 17, 17, 8 }, 72 1993, 11, 17, 17, 8 },
73 73
74 // Tests for "ls -l" style listing sent by Xplain FTP Server. 74 // Tests for "ls -l" style listing sent by Xplain FTP Server.
75 { "drwxr-xr-x folder 0 Jul 17 2006 online", 75 { "drwxr-xr-x folder 0 Jul 17 2006 online",
76 net::FtpDirectoryListingEntry::DIRECTORY, "online", -1, 76 net::FtpDirectoryListingEntry::DIRECTORY, "online", -1,
77 2006, 7, 17, 0, 0 }, 77 2006, 7, 17, 0, 0 },
78
79 // Tests for "ls -l" style listing with owning group name
80 // not separated from file size (http://crbug.com/58963).
81 { "-rw-r--r-- 1 ftpadmin ftpadmin125435904 Apr 9 2008 .pureftpd-upload",
82 net::FtpDirectoryListingEntry::FILE, ".pureftpd-upload", 0,
83 2008, 4, 9, 0, 0 },
78 }; 84 };
79 for (size_t i = 0; i < arraysize(good_cases); i++) { 85 for (size_t i = 0; i < arraysize(good_cases); i++) {
80 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i, 86 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i,
81 good_cases[i].input)); 87 good_cases[i].input));
82 88
83 net::FtpDirectoryListingParserLs parser(GetMockCurrentTime()); 89 net::FtpDirectoryListingParserLs parser(GetMockCurrentTime());
84 RunSingleLineTestCase(&parser, good_cases[i]); 90 RunSingleLineTestCase(&parser, good_cases[i]);
85 } 91 }
86 } 92 }
87 93
(...skipping 25 matching lines...) Expand all
113 "drwxr-xr-x 3 ftp 4096 May 15 18:11", 119 "drwxr-xr-x 3 ftp 4096 May 15 18:11",
114 "drwxr-xr-x folder 0 May 15 18:11", 120 "drwxr-xr-x folder 0 May 15 18:11",
115 }; 121 };
116 for (size_t i = 0; i < arraysize(bad_cases); i++) { 122 for (size_t i = 0; i < arraysize(bad_cases); i++) {
117 net::FtpDirectoryListingParserLs parser(GetMockCurrentTime()); 123 net::FtpDirectoryListingParserLs parser(GetMockCurrentTime());
118 EXPECT_FALSE(parser.ConsumeLine(UTF8ToUTF16(bad_cases[i]))) << bad_cases[i]; 124 EXPECT_FALSE(parser.ConsumeLine(UTF8ToUTF16(bad_cases[i]))) << bad_cases[i];
119 } 125 }
120 } 126 }
121 127
122 } // namespace 128 } // namespace
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_ls.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698