OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "platform/fonts/win/FontFallbackWin.h" | 5 #include "platform/fonts/win/FontFallbackWin.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromLocale( | 29 EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromLocale( |
30 icu::Locale("ja", "US"))); | 30 icu::Locale("ja", "US"))); |
31 EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale( | 31 EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale( |
32 icu::Locale("ko"))); | 32 icu::Locale("ko"))); |
33 EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale( | 33 EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale( |
34 icu::Locale("ko", "US"))); | 34 icu::Locale("ko", "US"))); |
35 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, scriptCodeForUnifiedHanFromLocale( | 35 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, scriptCodeForUnifiedHanFromLocale( |
36 icu::Locale("zh", "hant"))); | 36 icu::Locale("zh", "hant"))); |
37 } | 37 } |
38 | 38 |
| 39 TEST(FontFallbackWinTest, scriptCodeForUnifiedHanFromSubtagsTest) |
| 40 { |
| 41 EXPECT_EQ(USCRIPT_SIMPLIFIED_HAN, |
| 42 scriptCodeForUnifiedHanFromSubtags("en-CN")); |
| 43 EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromSubtags("en-JP")); |
| 44 EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromSubtags("en-KR")); |
| 45 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, |
| 46 scriptCodeForUnifiedHanFromSubtags("en-HK")); |
| 47 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, |
| 48 scriptCodeForUnifiedHanFromSubtags("en-TW")); |
| 49 |
| 50 EXPECT_EQ(USCRIPT_SIMPLIFIED_HAN, |
| 51 scriptCodeForUnifiedHanFromSubtags("en-HanS")); |
| 52 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, |
| 53 scriptCodeForUnifiedHanFromSubtags("en-HanT")); |
| 54 |
| 55 EXPECT_EQ(USCRIPT_SIMPLIFIED_HAN, |
| 56 scriptCodeForUnifiedHanFromSubtags("en-HanS-JP")); |
| 57 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, |
| 58 scriptCodeForUnifiedHanFromSubtags("en-HanT-JP")); |
| 59 |
| 60 EXPECT_EQ(USCRIPT_HAN, scriptCodeForUnifiedHanFromSubtags("en-US")); |
| 61 } |
| 62 |
39 } // namespace blink | 63 } // namespace blink |
OLD | NEW |