summaryrefslogtreecommitdiffstats
path: root/net/ftp/ftp_util_unittest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 08:03:49 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 08:03:49 +0000
commit27528b197f63c0cb8d71416ffc5065570358be8b (patch)
tree5c69270196473d64a9a8aed7e9691ca3a33973ce /net/ftp/ftp_util_unittest.cc
parent597787dd161b4959eb35cc9d0b365933fd2b315e (diff)
downloadchromium_src-27528b197f63c0cb8d71416ffc5065570358be8b.zip
chromium_src-27528b197f63c0cb8d71416ffc5065570358be8b.tar.gz
chromium_src-27528b197f63c0cb8d71416ffc5065570358be8b.tar.bz2
Revert 80587 - FTP: Multiple fixes for localized directory listings:- fix detection of KOI8-R and possibly other encodings- fix parsing Russian month namesWhen detecting the listing encoding, we need to not onlycheck whether the data can be converted using given encoding,but also whether the result can be parsed as a valid directory listing.Also, we only need to compare the first three characters of theabbreviated month name, because that's how they're abbreviatedin FTP directory listings.Finally, the Russian directory listings have swapped the "month" and "day of month" columns.BUG=65917Review URL: http://codereview.chromium.org/6718043
TBR=phajdan.jr@chromium.org Failures (Windows only, both Vista and XP): FtpDirectoryListingBufferTest.Parse: .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".." Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .. .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[25]: dir-listing-ls-25 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".message" Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .message .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[25]: dir-listing-ls-25 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".." Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .. .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[26]: dir-listing-ls-26 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".message" Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .message .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[26]: dir-listing-ls-26 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".." Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .. .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[27]: dir-listing-ls-27 .\ftp\ftp_directory_listing_parser_unittest.cc(133): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(name) Which is: L".message" Google Test trace: .\ftp\ftp_directory_listing_parser_unittest.cc(112): Filename: .message .\ftp\ftp_directory_listing_parser_unittest.cc(83): Test[27]: dir-listing-ls-27 FtpDirectoryListingParserLsTest.Good: c:\b\build\slave\cr-win-rel\build\src\net/ftp/ftp_directory_listing_parser_unittest.h(47): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(test_case.filename) Which is: L"test" Google Test trace: .\ftp\ftp_directory_listing_parser_ls_unittest.cc(109): Test[21]: -rwxrwxr-x 1 ftp ftp 123 23 май 2011 test c:\b\build\slave\cr-win-rel\build\src\net/ftp/ftp_directory_listing_parser_unittest.h(47): error: Value of: entry.name Actual: L"" Expected: UTF8ToUTF16(test_case.filename) Which is: L"dir" Google Test trace: .\ftp\ftp_directory_listing_parser_ls_unittest.cc(109): Test[22]: drwxrwxr-x 1 ftp ftp 4096 19 окт 2011 dir Review URL: http://codereview.chromium.org/6802006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_util_unittest.cc')
-rw-r--r--net/ftp/ftp_util_unittest.cc19
1 files changed, 3 insertions, 16 deletions
diff --git a/net/ftp/ftp_util_unittest.cc b/net/ftp/ftp_util_unittest.cc
index 4f26817..98ae975 100644
--- a/net/ftp/ftp_util_unittest.cc
+++ b/net/ftp/ftp_util_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -125,26 +125,13 @@ TEST(FtpUtilTest, LsDateListingToTime) {
{ "Nov", "01", "2007", 2007, 11, 1, 0, 0 },
{ "Jul", "25", "13:37", 1994, 7, 25, 13, 37 },
- // Test date listings in German.
+ // Test date listings in German, we should support them for FTP servers
+ // giving localized listings.
{ "M\xc3\xa4r", "13", "2009", 2009, 3, 13, 0, 0 },
{ "Mai", "1", "10:10", 1994, 5, 1, 10, 10 },
{ "Okt", "14", "21:18", 1994, 10, 14, 21, 18 },
{ "Dez", "25", "2008", 2008, 12, 25, 0, 0 },
- // Test date listings in Russian.
- { "\xd1\x8f\xd0\xbd\xd0\xb2", "1", "2011", 2011, 1, 1, 0, 0 },
- { "\xd1\x84\xd0\xb5\xd0\xb2", "1", "2011", 2011, 2, 1, 0, 0 },
- { "\xd0\xbc\xd0\xb0\xd1\x80", "1", "2011", 2011, 3, 1, 0, 0 },
- { "\xd0\xb0\xd0\xbf\xd1\x80", "1", "2011", 2011, 4, 1, 0, 0 },
- { "\xd0\xbc\xd0\xb0\xd0\xb9", "1", "2011", 2011, 5, 1, 0, 0 },
- { "\xd0\xb8\xd1\x8e\xd0\xbd", "1", "2011", 2011, 6, 1, 0, 0 },
- { "\xd0\xb8\xd1\x8e\xd0\xbb", "1", "2011", 2011, 7, 1, 0, 0 },
- { "\xd0\xb0\xd0\xb2\xd0\xb3", "1", "2011", 2011, 8, 1, 0, 0 },
- { "\xd1\x81\xd0\xb5\xd0\xbd", "1", "2011", 2011, 9, 1, 0, 0 },
- { "\xd0\xbe\xd0\xba\xd1\x82", "1", "2011", 2011, 10, 1, 0, 0 },
- { "\xd0\xbd\xd0\xbe\xd1\x8f", "1", "2011", 2011, 11, 1, 0, 0 },
- { "\xd0\xb4\xd0\xb5\xd0\xba", "1", "2011", 2011, 12, 1, 0, 0 },
-
// Test current year detection.
{ "Nov", "01", "12:00", 1994, 11, 1, 12, 0 },
{ "Nov", "15", "12:00", 1994, 11, 15, 12, 0 },