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

Unified Diff: Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp

Issue 1144033004: Unicode Variation Selectors support in collectCandidateRuns (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid using wcslen() in tests Created 5 years, 7 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/shaping/HarfBuzzShaper.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/shaping/HarfBuzzShaperTest.cpp
diff --git a/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp b/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
index b3f08af08a680b18ce0d07621737879e57545a7d..85904e992b4b3956ad781334b92f5c523c19ed16 100644
--- a/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
+++ b/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
@@ -67,6 +67,33 @@ TEST_F(HarfBuzzShaperTest, ResolveCandidateRunsLeadingCommon)
ASSERT_EQ(script, HB_SCRIPT_LATIN);
}
+TEST_F(HarfBuzzShaperTest, ResolveCandidateRunsUnicodeVariants)
+{
+ struct {
+ const char* name;
+ UChar string[4];
+ hb_script_t script;
+ } testlist[] = {
+ { "Standard Variants text style", { 0x30, 0xFE0E }, HB_SCRIPT_COMMON },
+ { "Standard Variants emoji style", { 0x203C, 0xFE0F }, HB_SCRIPT_COMMON },
+ { "Standard Variants of Ideograph", { 0x4FAE, 0xFE00 }, HB_SCRIPT_HAN },
+ { "Ideographic Variants", { 0x3402, 0xDB40, 0xDD00 }, HB_SCRIPT_HAN },
+ { "Not-defined Variants", { 0x41, 0xDB40, 0xDDEF }, HB_SCRIPT_LATIN },
+ };
+ for (auto& test : testlist) {
+ String str(test.string);
+ TextRun run(str);
+ HarfBuzzShaper shaper(font, run);
+ shaper.shape();
+ EXPECT_EQ(1u, shaper.numberOfRunsForTesting()) << test.name;
+ ASSERT_TRUE(shaper.runInfoForTesting(0, startIndex, numGlyphs, script)) << test.name;
+ EXPECT_EQ(0u, startIndex) << test.name;
+ // TODO(kojii): HarfBuzzFace does not support UVS yet and numGlyphs becomes 2
+ // EXPECT_EQ(1u, numGlyphs) << test.name;
+ EXPECT_EQ(test.script, script) << test.name;
+ }
+}
+
TEST_F(HarfBuzzShaperTest, ResolveCandidateRunsDevanagariCommon)
{
UChar devanagariCommonString[] = { 0x915, 0x94d, 0x930, 0x28, 0x20, 0x29 };
« no previous file with comments | « Source/platform/fonts/shaping/HarfBuzzShaper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698