Index: Source/core/editing/EditingUtilitiesTest.cpp |
diff --git a/Source/core/editing/EditingUtilitiesTest.cpp b/Source/core/editing/EditingUtilitiesTest.cpp |
index 0ad6ab745225f0c5bc938963876f41813b84fe56..3a6481280c5ee06603c399978cbcda46b48a73ad 100644 |
--- a/Source/core/editing/EditingUtilitiesTest.cpp |
+++ b/Source/core/editing/EditingUtilitiesTest.cpp |
@@ -12,6 +12,21 @@ namespace blink { |
class EditingUtilitiesTest : public EditingTestBase { |
}; |
+TEST_F(EditingUtilitiesTest, enclosingNodeOfType) |
+{ |
+ const char* bodyContent = "<p id='host'><b id='one'>11</b></p>"; |
+ const char* shadowContent = "<content select=#two></content><div id='three'><content select=#one></div></content>"; |
+ setBodyContent(bodyContent); |
+ RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent); |
+ updateLayoutAndStyleForPainting(); |
+ Node* host = document().getElementById("host"); |
+ Node* one = document().getElementById("one"); |
+ Node* three = shadowRoot->getElementById("three"); |
+ |
+ EXPECT_EQ(host, enclosingNodeOfType(Position(one, 0), isBlock)); |
+ EXPECT_EQ(three, enclosingNodeOfType(PositionInComposedTree(one, 0), isBlock)); |
+} |
+ |
TEST_F(EditingUtilitiesTest, NextNodeIndex) |
{ |
const char* bodyContent = "<p id='host'>00<b id='one'>11</b><b id='two'>22</b>33</p>"; |