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

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

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/ftp/ftp_directory_listing_parser_windows.h" 10 #include "net/ftp/ftp_directory_listing_parser_windows.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 std::vector<FtpDirectoryListingEntry> entries; 64 std::vector<FtpDirectoryListingEntry> entries;
65 EXPECT_TRUE(ParseFtpDirectoryListingWindows( 65 EXPECT_TRUE(ParseFtpDirectoryListingWindows(
66 GetSingleLineTestCase(good_cases[i].input), 66 GetSingleLineTestCase(good_cases[i].input),
67 &entries)); 67 &entries));
68 VerifySingleLineTestCase(good_cases[i], entries); 68 VerifySingleLineTestCase(good_cases[i], entries);
69 } 69 }
70 } 70 }
71 71
72 TEST_F(FtpDirectoryListingParserWindowsTest, Ignored) { 72 TEST_F(FtpDirectoryListingParserWindowsTest, Ignored) {
73 const char* ignored_cases[] = { 73 const char* const ignored_cases[] = {
74 "12-07-10 12:05AM <DIR> ", // http://crbug.com/66097 74 "12-07-10 12:05AM <DIR> ", // http://crbug.com/66097
75 "12-07-10 12:05AM 1234 ", 75 "12-07-10 12:05AM 1234 ",
76 "11-02-09 05:32 <DIR>", 76 "11-02-09 05:32 <DIR>",
77 "11-02-09 05:32PM <DIR>", 77 "11-02-09 05:32PM <DIR>",
78 }; 78 };
79 for (size_t i = 0; i < arraysize(ignored_cases); i++) { 79 for (size_t i = 0; i < arraysize(ignored_cases); i++) {
80 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i, 80 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i,
81 ignored_cases[i])); 81 ignored_cases[i]));
82 82
83 std::vector<FtpDirectoryListingEntry> entries; 83 std::vector<FtpDirectoryListingEntry> entries;
84 EXPECT_TRUE(ParseFtpDirectoryListingWindows( 84 EXPECT_TRUE(ParseFtpDirectoryListingWindows(
85 GetSingleLineTestCase(ignored_cases[i]), 85 GetSingleLineTestCase(ignored_cases[i]),
86 &entries)); 86 &entries));
87 EXPECT_EQ(0U, entries.size()); 87 EXPECT_EQ(0U, entries.size());
88 } 88 }
89 } 89 }
90 90
91 TEST_F(FtpDirectoryListingParserWindowsTest, Bad) { 91 TEST_F(FtpDirectoryListingParserWindowsTest, Bad) {
92 const char* bad_cases[] = { 92 const char* const bad_cases[] = {
93 "garbage", 93 "garbage",
94 "11-02-09 05:32PM <GARBAGE>", 94 "11-02-09 05:32PM <GARBAGE>",
95 "11-02-09 05:32PM <GARBAGE> NT", 95 "11-02-09 05:32PM <GARBAGE> NT",
96 "11-FEB-09 05:32PM <DIR>", 96 "11-FEB-09 05:32PM <DIR>",
97 "11-02 05:32PM <DIR>", 97 "11-02 05:32PM <DIR>",
98 "11-02-09 05:32PM -1", 98 "11-02-09 05:32PM -1",
99 "11-FEB-09 05:32PM <DIR> NT", 99 "11-FEB-09 05:32PM <DIR> NT",
100 "11-02 05:32PM <DIR> NT", 100 "11-02 05:32PM <DIR> NT",
101 "11-02-09 05:32PM -1 NT", 101 "11-02-09 05:32PM -1 NT",
102 "99-25-10 12:00AM 0", 102 "99-25-10 12:00AM 0",
(...skipping 14 matching lines...) Expand all
117 std::vector<FtpDirectoryListingEntry> entries; 117 std::vector<FtpDirectoryListingEntry> entries;
118 EXPECT_FALSE(ParseFtpDirectoryListingWindows( 118 EXPECT_FALSE(ParseFtpDirectoryListingWindows(
119 GetSingleLineTestCase(bad_cases[i]), 119 GetSingleLineTestCase(bad_cases[i]),
120 &entries)); 120 &entries));
121 } 121 }
122 } 122 }
123 123
124 } // namespace 124 } // namespace
125 125
126 } // namespace net 126 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms_unittest.cc ('k') | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698