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 "base/i18n/rtl.h" | 5 #include "base/i18n/rtl.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
10 #include "chrome/common/extensions/extension_manifest_constants.h" | 10 #include "chrome/common/extensions/extension_manifest_constants.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 scoped_refptr<Extension> extension(LoadAndExpectSuccess( | 143 scoped_refptr<Extension> extension(LoadAndExpectSuccess( |
144 "init_valid_name_no_rtl.json")); | 144 "init_valid_name_no_rtl.json")); |
145 | 145 |
146 string16 localized_name(ASCIIToUTF16("Dictionary (by Google)")); | 146 string16 localized_name(ASCIIToUTF16("Dictionary (by Google)")); |
147 base::i18n::AdjustStringForLocaleDirection(&localized_name); | 147 base::i18n::AdjustStringForLocaleDirection(&localized_name); |
148 EXPECT_EQ(localized_name, UTF8ToUTF16(extension->name())); | 148 EXPECT_EQ(localized_name, UTF8ToUTF16(extension->name())); |
149 | 149 |
150 // Strong RTL characters in name. | 150 // Strong RTL characters in name. |
151 extension = LoadAndExpectSuccess("init_valid_name_strong_rtl.json"); | 151 extension = LoadAndExpectSuccess("init_valid_name_strong_rtl.json"); |
152 | 152 |
153 localized_name = WideToUTF16(L"Dictionary (\x05D1\x05D2"L" Google)"); | 153 localized_name = WideToUTF16(L"Dictionary (\x05D1\x05D2" L" Google)"); |
154 base::i18n::AdjustStringForLocaleDirection(&localized_name); | 154 base::i18n::AdjustStringForLocaleDirection(&localized_name); |
155 EXPECT_EQ(localized_name, UTF8ToUTF16(extension->name())); | 155 EXPECT_EQ(localized_name, UTF8ToUTF16(extension->name())); |
156 | 156 |
157 // Reset locale. | 157 // Reset locale. |
158 #if defined(TOOLKIT_GTK) | 158 #if defined(TOOLKIT_GTK) |
159 gtk_widget_set_default_direction(gtk_dir); | 159 gtk_widget_set_default_direction(gtk_dir); |
160 #else | 160 #else |
161 base::i18n::SetICUDefaultLocale(locale); | 161 base::i18n::SetICUDefaultLocale(locale); |
162 #endif | 162 #endif |
163 } | 163 } |
164 | 164 |
165 } // namespace extensions | 165 } // namespace extensions |
OLD | NEW |