Index: net/ftp/ftp_directory_listing_parser_netware_unittest.cc |
diff --git a/net/ftp/ftp_directory_listing_parser_netware_unittest.cc b/net/ftp/ftp_directory_listing_parser_netware_unittest.cc |
index f5e4a3536ee0e4e3f68036613c94dc8dc93630f0..c02fb974a7c5e9c2be169d2eae3705632b8d4809 100644 |
--- a/net/ftp/ftp_directory_listing_parser_netware_unittest.cc |
+++ b/net/ftp/ftp_directory_listing_parser_netware_unittest.cc |
@@ -15,10 +15,6 @@ namespace { |
typedef net::FtpDirectoryListingParserTest FtpDirectoryListingParserNetwareTest; |
TEST_F(FtpDirectoryListingParserNetwareTest, 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[] = { |
{ "d [RWCEAFMS] ftpadmin 512 Jan 29 2004 pub", |
net::FtpDirectoryListingEntry::DIRECTORY, "pub", -1, |
@@ -31,7 +27,7 @@ TEST_F(FtpDirectoryListingParserNetwareTest, Good) { |
SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i, |
good_cases[i].input)); |
- net::FtpDirectoryListingParserNetware parser(mock_current_time); |
+ net::FtpDirectoryListingParserNetware parser(GetMockCurrentTime()); |
// The parser requires a "total n" like before accepting regular input. |
ASSERT_TRUE(parser.ConsumeLine(UTF8ToUTF16("total 1"))); |
RunSingleLineTestCase(&parser, good_cases[i]); |
@@ -39,11 +35,8 @@ TEST_F(FtpDirectoryListingParserNetwareTest, Good) { |
} |
TEST_F(FtpDirectoryListingParserNetwareTest, 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", |
"d [] ftpadmin 512 Jan 29 2004 pub", |
"d [XGARBAGE] ftpadmin 512 Jan 29 2004 pub", |
@@ -52,7 +45,7 @@ TEST_F(FtpDirectoryListingParserNetwareTest, Bad) { |
"l [RW------] ftpadmin 512 Jan 29 2004 pub", |
}; |
for (size_t i = 0; i < arraysize(bad_cases); i++) { |
- net::FtpDirectoryListingParserNetware parser(mock_current_time); |
+ net::FtpDirectoryListingParserNetware parser(GetMockCurrentTime()); |
// The parser requires a "total n" like before accepting regular input. |
ASSERT_TRUE(parser.ConsumeLine(UTF8ToUTF16("total 1"))); |
EXPECT_FALSE(parser.ConsumeLine(UTF8ToUTF16(bad_cases[i]))) << bad_cases[i]; |