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

Unified Diff: third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp

Issue 2118083003: Emoji modifier should be deleted at the same time in ZWJ sequence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp b/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp
index 712dd56852400af7bec13bbdc89bf030b2525937..468c4126c4bc24020d2ab525f3d4242042c818e2 100644
--- a/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp
+++ b/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp
@@ -813,6 +813,25 @@ TEST(BackspaceStateMachineTest, ZWJSequence)
EXPECT_EQ(-11, machine.finalizeAndGetBoundaryOffset());
EXPECT_EQ(-11, machine.finalizeAndGetBoundaryOffset());
+ // Sot + EMOJI_MODIFIER_BASE + EMOJI_MODIFIER + ZWJ + ZWJ_EMOJI
+ // As an example, use WOMAN + MODIFIER + ZWJ + BRIEFCASE
+ const UChar womanLead = 0xD83D;
+ const UChar womanTrail = 0xDC69;
+ const UChar emojiModifierLead = 0xD83C;
+ const UChar emojiModifierTrail = 0xDFFB;
+ const UChar briefcaseLead = 0xD83D;
+ const UChar briefcaseTrail = 0xDCBC;
+ machine.reset();
+ EXPECT_EQ(kNeedMoreCodeUnit, machine.feedPrecedingCodeUnit(briefcaseTrail));
+ EXPECT_EQ(kNeedMoreCodeUnit, machine.feedPrecedingCodeUnit(briefcaseLead));
+ EXPECT_EQ(kNeedMoreCodeUnit, machine.feedPrecedingCodeUnit(zwj));
+ EXPECT_EQ(kNeedMoreCodeUnit, machine.feedPrecedingCodeUnit(emojiModifierTrail));
+ EXPECT_EQ(kNeedMoreCodeUnit, machine.feedPrecedingCodeUnit(emojiModifierLead));
+ EXPECT_EQ(kNeedMoreCodeUnit, machine.feedPrecedingCodeUnit(womanTrail));
+ EXPECT_EQ(kFinished, machine.feedPrecedingCodeUnit(womanLead));
+ EXPECT_EQ(-7, machine.finalizeAndGetBoundaryOffset());
+ EXPECT_EQ(-7, machine.finalizeAndGetBoundaryOffset());
+
// Followings are not edge cases but good to check.
// If leading character is not zwj, delete only ZWJ_EMOJI.
// other + ZWJ_EMOJI
« no previous file with comments | « third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698