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

Side by Side Diff: net/base/net_util_unittest.cc

Issue 1655: Fix IDNtoUnicode and unittest. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "net/base/net_util.h" 9 #include "net/base/net_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 20 matching lines...) Expand all
31 }; 31 };
32 32
33 struct FileNameCDCase { 33 struct FileNameCDCase {
34 const char* header_field; 34 const char* header_field;
35 const wchar_t* expected; 35 const wchar_t* expected;
36 }; 36 };
37 37
38 const wchar_t* kLanguages[] = { 38 const wchar_t* kLanguages[] = {
39 L"", L"en", L"zh-CN", L"ja", L"ko", 39 L"", L"en", L"zh-CN", L"ja", L"ko",
40 L"he", L"ar", L"ru", L"el", L"fr", 40 L"he", L"ar", L"ru", L"el", L"fr",
41 L"de", L"pt", L"se", L"th", L"hi", 41 L"de", L"pt", L"sv", L"th", L"hi",
42 L"de,en", L"el,en", L"zh,zh-TW,en", L"ko,ja", L"he,ru,en", 42 L"de,en", L"el,en", L"zh,zh-TW,en", L"ko,ja", L"he,ru,en",
43 L"zh,ru,en" 43 L"zh,ru,en"
44 }; 44 };
45 45
46 struct IDNTestCase { 46 struct IDNTestCase {
47 const char* input; 47 const char* input;
48 const wchar_t* unicode_output; 48 const wchar_t* unicode_output;
49 const bool unicode_allowed[arraysize(kLanguages)]; 49 const bool unicode_allowed[arraysize(kLanguages)];
50 }; 50 };
51 51
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 {"xn--bcher-kva.de", L"b\x00fc" L"cher.de", 388 {"xn--bcher-kva.de", L"b\x00fc" L"cher.de",
389 {true, false, false, false, false, 389 {true, false, false, false, false,
390 false, false, false, false, true, 390 false, false, false, false, true,
391 true, true, false, false, false, 391 true, true, false, false, false,
392 true, false, false, false, false, 392 true, false, false, false, false,
393 false}}, 393 false}},
394 // a with diaeresis 394 // a with diaeresis
395 {"www.xn--frgbolaget-q5a.se", L"www.f\x00e4rgbolaget.se", 395 {"www.xn--frgbolaget-q5a.se", L"www.f\x00e4rgbolaget.se",
396 {true, false, false, false, false, 396 {true, false, false, false, false,
397 false, false, false, false, false, 397 false, false, false, false, false,
398 true, false, false, false, false, 398 true, false, true, false, false,
399 true, false, false, false, false, 399 true, false, false, false, false,
400 false}}, 400 false}},
401 // c-cedilla (French) 401 // c-cedilla (French)
402 {"www.xn--alliancefranaise-npb.fr", L"www.alliancefran\x00e7" L"aise.fr", 402 {"www.xn--alliancefranaise-npb.fr", L"www.alliancefran\x00e7" L"aise.fr",
403 {true, false, false, false, false, 403 {true, false, false, false, false,
404 false, false, false, false, true, 404 false, false, false, false, true,
405 false, true, false, false, false, 405 false, true, false, false, false,
406 false, false, false, false, false, 406 false, false, false, false, false,
407 false}}, 407 false}},
408 // caf'e with acute accent' (French) 408 // caf'e with acute accent' (French)
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 }; 726 };
727 727
728 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 728 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
729 const std::string results = net::GetDirectoryListingEntry( 729 const std::string results = net::GetDirectoryListingEntry(
730 test_cases[i].name, test_cases[i].file_attrib, 730 test_cases[i].name, test_cases[i].file_attrib,
731 test_cases[i].filesize, test_cases[i].modified); 731 test_cases[i].filesize, test_cases[i].modified);
732 EXPECT_EQ(test_cases[i].expected, results); 732 EXPECT_EQ(test_cases[i].expected, results);
733 } 733 }
734 } 734 }
735 #endif 735 #endif
OLDNEW
« no previous file with comments | « net/base/net_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698