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

Side by Side Diff: Source/platform/fonts/win/FontFallbackWinTest.cpp

Issue 1311043010: Improve getFallbackFamily() for Unified Han Ideographs on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « Source/platform/fonts/win/FontFallbackWin.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "platform/fonts/win/FontFallbackWin.h"
7
8 #include <gtest/gtest.h>
9
10 namespace blink {
11
12 TEST(FontFallbackWinTest, scriptCodeForUnifiedHanFromLocaleTest)
13 {
14 EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromLocale(
15 icu::Locale("ja", "JP")));
16 EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale(
17 icu::Locale("ko", "KR")));
18 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, scriptCodeForUnifiedHanFromLocale(
19 icu::Locale("zh", "TW")));
20 EXPECT_EQ(USCRIPT_SIMPLIFIED_HAN, scriptCodeForUnifiedHanFromLocale(
21 icu::Locale("zh", "CN")));
22
23 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, scriptCodeForUnifiedHanFromLocale(
24 icu::Locale("zh", "HK")));
25
26 // icu::Locale::getDefault() returns other combinations if, for instnace,
27 // English Windows with the display language set to Japanese.
28 EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromLocale(
29 icu::Locale("ja")));
30 EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromLocale(
31 icu::Locale("ja", "US")));
32 EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale(
33 icu::Locale("ko")));
34 EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale(
35 icu::Locale("ko", "US")));
36 EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, scriptCodeForUnifiedHanFromLocale(
37 icu::Locale("zh", "hant")));
38 }
39
40 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/win/FontFallbackWin.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698