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

Unified Diff: net/ftp/ftp_directory_listing_parser_netware_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_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];
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_mlsd_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698