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

Unified Diff: Source/core/editing/EditingUtilitiesTest.cpp

Issue 1317463002: Introduce composed tree version of nextVisuallyDistinctCandidate() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-25T11:26:15 Created 5 years, 4 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/core/editing/EditingUtilities.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingUtilitiesTest.cpp
diff --git a/Source/core/editing/EditingUtilitiesTest.cpp b/Source/core/editing/EditingUtilitiesTest.cpp
index 1e32f298af7a990cf4c8e20a31fea87b43835d40..5eb35ff972fc879baf6b4f767b215fd99d4ec528 100644
--- a/Source/core/editing/EditingUtilitiesTest.cpp
+++ b/Source/core/editing/EditingUtilitiesTest.cpp
@@ -25,4 +25,19 @@ TEST_F(EditingUtilitiesTest, NextNodeIndex)
EXPECT_EQ(PositionInComposedTree(host, 1), nextPositionOf(PositionInComposedTree(two, 2), PositionMoveType::CodePoint));
}
+TEST_F(EditingUtilitiesTest, NextVisuallyDistinctCandidate)
+{
+ const char* bodyContent = "<p id='host'>00<b id='one'>11</b><b id='two'>22</b><b id='three'>33</b></p>";
+ const char* shadowContent = "<content select=#two></content><content select=#one></content><content select=#three></content>";
+ setBodyContent(bodyContent);
+ setShadowContent(shadowContent);
+ updateLayoutAndStyleForPainting();
+ Node* one = document().getElementById("one");
+ Node* two = document().getElementById("two");
+ Node* three = document().getElementById("three");
+
+ EXPECT_EQ(Position(two->firstChild(), 1), nextVisuallyDistinctCandidate(Position(one, 2)));
yoichio 2015/08/25 05:22:33 'one' has only 1 child so what is |Position(one, 2
yosin_UTC9 2015/08/25 05:44:24 Done.
+ EXPECT_EQ(PositionInComposedTree(three->firstChild(), 1), nextVisuallyDistinctCandidate(PositionInComposedTree(one, 2)));
+}
+
} // namespace blink
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698