Index: Source/core/editing/EditingUtilitiesTest.cpp |
diff --git a/Source/core/editing/EditingUtilitiesTest.cpp b/Source/core/editing/EditingUtilitiesTest.cpp |
index b59de6ae640c2b9ac8576daeda2afa3a8f3bbe74..e2b1adbcdf943519814f27564d85a277a05ea08a 100644 |
--- a/Source/core/editing/EditingUtilitiesTest.cpp |
+++ b/Source/core/editing/EditingUtilitiesTest.cpp |
@@ -12,6 +12,19 @@ namespace blink { |
class EditingUtilitiesTest : public EditingTestBase { |
}; |
+TEST_F(EditingUtilitiesTest, directionOfEnclosingBlock) |
+{ |
+ const char* bodyContent = "<p id='host'><b id='one'></b><b id='two'>22</b></p>"; |
+ const char* shadowContent = "<content select=#two></content><p dir=rtl><content select=#one></content><p>"; |
+ setBodyContent(bodyContent); |
+ setShadowContent(shadowContent); |
+ updateLayoutAndStyleForPainting(); |
+ Node* one = document().getElementById("one"); |
+ |
+ EXPECT_EQ(LTR, directionOfEnclosingBlock(Position(one, 0))); |
+ EXPECT_EQ(RTL, directionOfEnclosingBlock(PositionInComposedTree(one, 0))); |
+} |
+ |
TEST_F(EditingUtilitiesTest, firstEditablePositionAfterPositionInRoot) |
{ |
const char* bodyContent = "<p id='host' contenteditable><b id='one'></b><b id='two'>22</b></p>"; |