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

Unified Diff: base/i18n/file_util_icu_unittest.cc

Issue 9854011: Normalize download file name on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/i18n/file_util_icu.cc ('k') | chrome/browser/download/download_file_picker_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/file_util_icu_unittest.cc
diff --git a/base/i18n/file_util_icu_unittest.cc b/base/i18n/file_util_icu_unittest.cc
index 6c5d34d39fae19573bb6c2dc81bb00f641e32e4e..a26fe99ffd0c3f9e341c93ba14bfea04d263a932 100644
--- a/base/i18n/file_util_icu_unittest.cc
+++ b/base/i18n/file_util_icu_unittest.cc
@@ -82,3 +82,25 @@ TEST_F(FileUtilICUTest, ReplaceIllegalCharactersInPathTest) {
#endif
+#if defined(OS_CHROMEOS)
+static const struct normalize_name_encoding_test_cases {
+ const char* original_path;
+ const char* normalized_path;
+} kNormalizeFileNameEncodingTestCases[] = {
+ { "foo_na\xcc\x88me.foo", "foo_n\xc3\xa4me.foo"},
+ { "foo_dir_na\xcc\x88me/foo_na\xcc\x88me.foo",
+ "foo_dir_na\xcc\x88me/foo_n\xc3\xa4me.foo"},
+ { "", ""},
+ { "foo_dir_na\xcc\x88me/", "foo_dir_n\xc3\xa4me"}
+};
+
+TEST_F(FileUtilICUTest, NormalizeFileNameEncoding) {
+ for (size_t i = 0; i < arraysize(kNormalizeFileNameEncodingTestCases); i++) {
+ FilePath path(kNormalizeFileNameEncodingTestCases[i].original_path);
+ file_util::NormalizeFileNameEncoding(&path);
+ EXPECT_EQ(FilePath(kNormalizeFileNameEncodingTestCases[i].normalized_path),
+ path);
+ }
+}
+
+#endif
« no previous file with comments | « base/i18n/file_util_icu.cc ('k') | chrome/browser/download/download_file_picker_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698