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

Unified Diff: net/ftp/ftp_directory_listing_parser_ls_unittest.cc

Issue 3448029: FTP: fix directory listing parser for ftp.usa.hp.com (Closed)
Patch Set: attempt to fix Windows trybots Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/ftp/ftp_directory_listing_parser_ls_unittest.cc
diff --git a/net/ftp/ftp_directory_listing_parser_ls_unittest.cc b/net/ftp/ftp_directory_listing_parser_ls_unittest.cc
index 2b57b403628bfbbadffddf626c166ccbfed8c9f3..72450d7bf5374ddf196a67d0ff59900aa864f448 100644
--- a/net/ftp/ftp_directory_listing_parser_ls_unittest.cc
+++ b/net/ftp/ftp_directory_listing_parser_ls_unittest.cc
@@ -14,10 +14,6 @@ namespace {
typedef net::FtpDirectoryListingParserTest FtpDirectoryListingParserLsTest;
TEST_F(FtpDirectoryListingParserLsTest, Good) {
- base::Time mock_current_time;
- ASSERT_TRUE(base::Time::FromString(L"Tue, 15 Nov 1994 12:45:26 GMT",
- &mock_current_time));
-
const struct SingleLineTestData good_cases[] = {
{ "-rw-r--r-- 1 ftp ftp 528 Nov 01 2007 README",
net::FtpDirectoryListingEntry::FILE, "README", 528,
@@ -84,17 +80,14 @@ TEST_F(FtpDirectoryListingParserLsTest, Good) {
SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i,
good_cases[i].input));
- net::FtpDirectoryListingParserLs parser(mock_current_time);
+ net::FtpDirectoryListingParserLs parser(GetMockCurrentTime());
RunSingleLineTestCase(&parser, good_cases[i]);
}
}
TEST_F(FtpDirectoryListingParserLsTest, Bad) {
- base::Time mock_current_time;
- ASSERT_TRUE(base::Time::FromString(L"Tue, 15 Nov 1994 12:45:26 GMT",
- &mock_current_time));
-
const char* bad_cases[] = {
+ " foo",
"garbage",
"-rw-r--r-- ftp ftp",
"-rw-r--rgb ftp ftp 528 Nov 01 2007 README",
@@ -121,7 +114,7 @@ TEST_F(FtpDirectoryListingParserLsTest, Bad) {
"drwxr-xr-x folder 0 May 15 18:11",
};
for (size_t i = 0; i < arraysize(bad_cases); i++) {
- net::FtpDirectoryListingParserLs parser(mock_current_time);
+ net::FtpDirectoryListingParserLs parser(GetMockCurrentTime());
EXPECT_FALSE(parser.ConsumeLine(UTF8ToUTF16(bad_cases[i]))) << bad_cases[i];
}
}
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_hprc_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser_mlsd_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698