OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_buffer.h" | 5 #include "net/ftp/ftp_directory_listing_buffer.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "base/string_tokenizer.h" | 11 #include "base/string_tokenizer.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
15 #include "net/ftp/ftp_directory_listing_parser.h" | 15 #include "net/ftp/ftp_directory_listing_parser.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 TEST(FtpDirectoryListingBufferTest, Parse) { | 20 TEST(FtpDirectoryListingBufferTest, Parse) { |
21 const char* test_files[] = { | 21 const char* test_files[] = { |
22 "dir-listing-hprc-1", | |
23 "dir-listing-hprc-2", | |
24 "dir-listing-hprc-3", | |
25 "dir-listing-ls-1", | 22 "dir-listing-ls-1", |
26 "dir-listing-ls-1-utf8", | 23 "dir-listing-ls-1-utf8", |
27 "dir-listing-ls-2", | 24 "dir-listing-ls-2", |
28 "dir-listing-ls-3", | 25 "dir-listing-ls-3", |
29 "dir-listing-ls-4", | 26 "dir-listing-ls-4", |
30 "dir-listing-ls-5", | 27 "dir-listing-ls-5", |
31 "dir-listing-ls-6", | 28 "dir-listing-ls-6", |
32 "dir-listing-ls-7", | 29 "dir-listing-ls-7", |
33 "dir-listing-ls-8", | 30 "dir-listing-ls-8", |
34 "dir-listing-ls-9", | 31 "dir-listing-ls-9", |
35 "dir-listing-ls-10", | 32 "dir-listing-ls-10", |
36 "dir-listing-ls-11", | 33 "dir-listing-ls-11", |
37 "dir-listing-ls-12", | 34 "dir-listing-ls-12", |
38 "dir-listing-ls-13", | 35 "dir-listing-ls-13", |
39 "dir-listing-ls-14", | 36 "dir-listing-ls-14", |
40 "dir-listing-ls-15", | 37 "dir-listing-ls-15", |
41 "dir-listing-ls-16", | 38 "dir-listing-ls-16", |
42 "dir-listing-ls-17", | 39 "dir-listing-ls-17", |
43 "dir-listing-ls-18", | 40 "dir-listing-ls-18", |
44 "dir-listing-ls-19", | 41 "dir-listing-ls-19", |
45 "dir-listing-ls-20", // TODO(phajdan.jr): should use windows-1251 encoding. | 42 "dir-listing-ls-20", // TODO(phajdan.jr): should use windows-1251 encoding. |
46 "dir-listing-ls-21", // TODO(phajdan.jr): should use windows-1251 encoding. | 43 "dir-listing-ls-21", // TODO(phajdan.jr): should use windows-1251 encoding. |
47 "dir-listing-ls-22", // TODO(phajdan.jr): should use windows-1251 encoding. | 44 "dir-listing-ls-22", // TODO(phajdan.jr): should use windows-1251 encoding. |
48 "dir-listing-mlsd-1", | |
49 "dir-listing-mlsd-2", | |
50 "dir-listing-netware-1", | 45 "dir-listing-netware-1", |
51 "dir-listing-netware-2", | 46 "dir-listing-netware-2", |
52 "dir-listing-vms-1", | 47 "dir-listing-vms-1", |
53 "dir-listing-vms-2", | 48 "dir-listing-vms-2", |
54 "dir-listing-vms-3", | 49 "dir-listing-vms-3", |
55 "dir-listing-vms-4", | 50 "dir-listing-vms-4", |
56 "dir-listing-vms-5", | 51 "dir-listing-vms-5", |
57 "dir-listing-windows-1", | 52 "dir-listing-windows-1", |
58 "dir-listing-windows-2", | 53 "dir-listing-windows-2", |
59 }; | 54 }; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 EXPECT_EQ(month, time_exploded.month); | 129 EXPECT_EQ(month, time_exploded.month); |
135 EXPECT_EQ(day_of_month, time_exploded.day_of_month); | 130 EXPECT_EQ(day_of_month, time_exploded.day_of_month); |
136 EXPECT_EQ(hour, time_exploded.hour); | 131 EXPECT_EQ(hour, time_exploded.hour); |
137 EXPECT_EQ(minute, time_exploded.minute); | 132 EXPECT_EQ(minute, time_exploded.minute); |
138 } | 133 } |
139 EXPECT_FALSE(buffer.EntryAvailable()); | 134 EXPECT_FALSE(buffer.EntryAvailable()); |
140 } | 135 } |
141 } | 136 } |
142 | 137 |
143 } // namespace | 138 } // namespace |
OLD | NEW |