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 |