Chromium Code Reviews| Index: base/i18n/rtl_unittest.cc |
| diff --git a/base/i18n/rtl_unittest.cc b/base/i18n/rtl_unittest.cc |
| index 87ac87d242a7a8ec01ff370f96d8e137795d2966..ccdb5b9571bf7b4f9dd22027c93eeeda58b1add3 100644 |
| --- a/base/i18n/rtl_unittest.cc |
| +++ b/base/i18n/rtl_unittest.cc |
| @@ -399,6 +399,36 @@ 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")); |
| +#if 0 |
| + // Enable these when we include the minimal locale data for Azerbaijani |
| + // written in Arabic and Dhivehi. At the moment, our copy of |
| + // ICU data does not have entries for them. |
| + EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("az_Arab")); |
| + // Dhivehi that uses Thaana script. |
| + EXPECT_EQ(RIGHT_TO_LEFT, GetTextDirectionForLocaleInStartUp("dv")); |
| +#endif |
|
jungshik at Google
2015/08/11 19:23:13
I don't think we need these #if-0'd lines because
danduong
2015/08/11 20:01:10
Removed the if-0 lines.
|
| + 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[] = { |