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

Unified Diff: base/i18n/rtl_unittest.cc

Issue 1281343003: Optimize RTL check in ICU to avoid mmap access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile fixes Created 5 years, 4 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
« base/i18n/rtl.cc ('K') | « base/i18n/rtl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/rtl_unittest.cc
diff --git a/base/i18n/rtl_unittest.cc b/base/i18n/rtl_unittest.cc
index 87ac87d242a7a8ec01ff370f96d8e137795d2966..ddaff1e4372026b44cff21ac00906fcb8fc19db3 100644
--- a/base/i18n/rtl_unittest.cc
+++ b/base/i18n/rtl_unittest.cc
@@ -399,6 +399,28 @@ TEST_F(RTLTest, GetTextDirection) {
EXPECT_EQ(LEFT_TO_RIGHT, GetTextDirectionForLocale("ja"));
}
+TEST_F(RTLTest, GetTextDirectionForLocaleInStartUp) {
+ EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("ar"));
+ EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("ar_EG"));
+ EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("he"));
+ EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("he_IL"));
+ // iw is an obsolete code for Hebrew.
+ EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("iw"));
+ // Although we're not yet localized to Farsi and Urdu, we
+ // do have the text layout direction information for them.
+ EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("fa"));
+ EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("ur"));
+ EXPECT_EQ(LEFT_TO_RIGHT, GetTextDirectionForLocaleInStartUp("en"));
+ // Chinese in China with '-'.
+ EXPECT_EQ(LEFT_TO_RIGHT, GetTextDirectionForLocaleInStartUp("zh-CN"));
+ // Filipino : 3-letter code
+ EXPECT_EQ(LEFT_TO_RIGHT, GetTextDirectionForLocaleInStartUp("fil"));
+ // Russian
+ EXPECT_EQ(LEFT_TO_RIGHT, GetTextDirectionForLocaleInStartUp("ru"));
+ // Japanese that uses multiple scripts
+ EXPECT_EQ(LEFT_TO_RIGHT, GetTextDirectionForLocaleInStartUp("ja"));
+}
+
TEST_F(RTLTest, UnadjustStringForLocaleDirection) {
// These test strings are borrowed from WrapPathWithLTRFormatting
const wchar_t* cases[] = {
« base/i18n/rtl.cc ('K') | « base/i18n/rtl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698