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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/fonts/win/FontFallbackWin.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/win/FontFallbackWinTest.cpp
diff --git a/Source/platform/fonts/win/FontFallbackWinTest.cpp b/Source/platform/fonts/win/FontFallbackWinTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..cf0587183008c82de3bc142ff2951bb8ea53727b
--- /dev/null
+++ b/Source/platform/fonts/win/FontFallbackWinTest.cpp
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/fonts/win/FontFallbackWin.h"
+
+#include <gtest/gtest.h>
+
+namespace blink {
+
+TEST(FontFallbackWinTest, scriptCodeForUnifiedHanFromLocaleTest)
+{
+ EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("ja", "JP")));
+ EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("ko", "KR")));
+ EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("zh", "TW")));
+ EXPECT_EQ(USCRIPT_SIMPLIFIED_HAN, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("zh", "CN")));
+
+ EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("zh", "HK")));
+
+ // icu::Locale::getDefault() returns other combinations if, for instnace,
+ // English Windows with the display language set to Japanese.
+ EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("ja")));
+ EXPECT_EQ(USCRIPT_HIRAGANA, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("ja", "US")));
+ EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("ko")));
+ EXPECT_EQ(USCRIPT_HANGUL, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("ko", "US")));
+ EXPECT_EQ(USCRIPT_TRADITIONAL_HAN, scriptCodeForUnifiedHanFromLocale(
+ icu::Locale("zh", "hant")));
+}
+
+} // namespace blink
« 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