| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/net_util.h" | 5 #include "net/base/net_util.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2253 base::Time(), | 2253 base::Time(), |
| 2254 "<script>addRow(\"quo\\\"tes\",\"quo%22tes\",0,\"9.8 kB\",\"\");</script>" | 2254 "<script>addRow(\"quo\\\"tes\",\"quo%22tes\",0,\"9.8 kB\",\"\");</script>" |
| 2255 "\n"}, | 2255 "\n"}, |
| 2256 // U+D55C0 U+AE00. raw_bytes is empty (either a local file with | 2256 // U+D55C0 U+AE00. raw_bytes is empty (either a local file with |
| 2257 // UTF-8/UTF-16 encoding or a remote file on an ftp server using UTF-8 | 2257 // UTF-8/UTF-16 encoding or a remote file on an ftp server using UTF-8 |
| 2258 {L"\xD55C\xAE00.txt", | 2258 {L"\xD55C\xAE00.txt", |
| 2259 "", | 2259 "", |
| 2260 false, | 2260 false, |
| 2261 10000, | 2261 10000, |
| 2262 base::Time(), | 2262 base::Time(), |
| 2263 "<script>addRow(\"\\uD55C\\uAE00.txt\",\"%ED%95%9C%EA%B8%80.txt\"" | 2263 "<script>addRow(\"\xED\x95\x9C\xEA\xB8\x80.txt\"," |
| 2264 ",0,\"9.8 kB\",\"\");</script>\n"}, | 2264 "\"%ED%95%9C%EA%B8%80.txt\",0,\"9.8 kB\",\"\");</script>\n"}, |
| 2265 // U+D55C0 U+AE00. raw_bytes is the corresponding EUC-KR sequence: | 2265 // U+D55C0 U+AE00. raw_bytes is the corresponding EUC-KR sequence: |
| 2266 // a local or remote file in EUC-KR. | 2266 // a local or remote file in EUC-KR. |
| 2267 {L"\xD55C\xAE00.txt", | 2267 {L"\xD55C\xAE00.txt", |
| 2268 "\xC7\xD1\xB1\xDB.txt", | 2268 "\xC7\xD1\xB1\xDB.txt", |
| 2269 false, | 2269 false, |
| 2270 10000, | 2270 10000, |
| 2271 base::Time(), | 2271 base::Time(), |
| 2272 "<script>addRow(\"\\uD55C\\uAE00.txt\",\"%C7%D1%B1%DB.txt\"" | 2272 "<script>addRow(\"\xED\x95\x9C\xEA\xB8\x80.txt\",\"%C7%D1%B1%DB.txt\"" |
| 2273 ",0,\"9.8 kB\",\"\");</script>\n"}, | 2273 ",0,\"9.8 kB\",\"\");</script>\n"}, |
| 2274 }; | 2274 }; |
| 2275 | 2275 |
| 2276 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { | 2276 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { |
| 2277 const std::string results = GetDirectoryListingEntry( | 2277 const std::string results = GetDirectoryListingEntry( |
| 2278 WideToUTF16(test_cases[i].name), | 2278 WideToUTF16(test_cases[i].name), |
| 2279 test_cases[i].raw_bytes, | 2279 test_cases[i].raw_bytes, |
| 2280 test_cases[i].is_dir, | 2280 test_cases[i].is_dir, |
| 2281 test_cases[i].filesize, | 2281 test_cases[i].filesize, |
| 2282 test_cases[i].time); | 2282 test_cases[i].time); |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3516 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) { | 3516 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) { |
| 3517 const NonUniqueNameTestData& test_data = GetParam(); | 3517 const NonUniqueNameTestData& test_data = GetParam(); |
| 3518 | 3518 |
| 3519 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname)); | 3519 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname)); |
| 3520 } | 3520 } |
| 3521 | 3521 |
| 3522 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest, | 3522 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest, |
| 3523 testing::ValuesIn(kNonUniqueNameTestData)); | 3523 testing::ValuesIn(kNonUniqueNameTestData)); |
| 3524 | 3524 |
| 3525 } // namespace net | 3525 } // namespace net |
| OLD | NEW |