OLD | NEW |
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_util.h" | 5 #include "net/ftp/ftp_util.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
| 15 using base::ASCIIToUTF16; |
| 16 using base::UTF8ToUTF16; |
| 17 |
15 namespace { | 18 namespace { |
16 | 19 |
17 TEST(FtpUtilTest, UnixFilePathToVMS) { | 20 TEST(FtpUtilTest, UnixFilePathToVMS) { |
18 const struct { | 21 const struct { |
19 const char* input; | 22 const char* input; |
20 const char* expected_output; | 23 const char* expected_output; |
21 } kTestCases[] = { | 24 } kTestCases[] = { |
22 { "", "" }, | 25 { "", "" }, |
23 { "/", "[]" }, | 26 { "/", "[]" }, |
24 { "/a", "a" }, | 27 { "/a", "a" }, |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s %d", i, | 247 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s %d", i, |
245 kTestCases[i].text, kTestCases[i].column)); | 248 kTestCases[i].text, kTestCases[i].column)); |
246 | 249 |
247 EXPECT_EQ(ASCIIToUTF16(kTestCases[i].expected_result), | 250 EXPECT_EQ(ASCIIToUTF16(kTestCases[i].expected_result), |
248 net::FtpUtil::GetStringPartAfterColumns( | 251 net::FtpUtil::GetStringPartAfterColumns( |
249 ASCIIToUTF16(kTestCases[i].text), kTestCases[i].column)); | 252 ASCIIToUTF16(kTestCases[i].text), kTestCases[i].column)); |
250 } | 253 } |
251 } | 254 } |
252 | 255 |
253 } // namespace | 256 } // namespace |
OLD | NEW |