Index: third_party/WebKit/Source/core/editing/EphemeralRangeTest.cpp |
diff --git a/third_party/WebKit/Source/core/editing/EphemeralRangeTest.cpp b/third_party/WebKit/Source/core/editing/EphemeralRangeTest.cpp |
index 85a6ae2df79dc4443e2576f577fd66f25ab0ee92..3629a57388fa2a61e6a85d4a87cc762704821fdc 100644 |
--- a/third_party/WebKit/Source/core/editing/EphemeralRangeTest.cpp |
+++ b/third_party/WebKit/Source/core/editing/EphemeralRangeTest.cpp |
@@ -221,4 +221,25 @@ TEST_F(EphemeralRangeTest, commonAncesstorFlatTree) { |
EXPECT_EQ(document().getElementById("host"), range.commonAncestorContainer()); |
} |
+TEST_F(EphemeralRangeTest, boundingBox) { |
Xiaocheng
2017/03/29 19:51:08
Please move the test case to VisibleUnitsTest, and
|
+ const char* bodyContent = |
+ "<p id='host'>1" |
+ "<b id='one'>22</b>" |
+ "<b id='two'>333</b>" |
+ "<b id='three'>4444</b>" |
+ "</p>"; |
+ setBodyContent(bodyContent); |
+ |
+ const Position startPosition(document().getElementById("one"), 0); |
+ const Position endPosition(document().getElementById("three"), 0); |
+ Range* range = getBodyRange(); |
+ range->setStart(document().getElementById("one"), 0, |
+ IGNORE_EXCEPTION_FOR_TESTING); |
+ range->setEnd(document().getElementById("three"), 0, |
+ IGNORE_EXCEPTION_FOR_TESTING); |
+ const EphemeralRange ephemeralRange(startPosition, endPosition); |
+ EXPECT_EQ(range->boundingBox().toString(), |
Xiaocheng
2017/03/29 19:51:07
Please inspect the return value directly. No need
|
+ ephemeralRange.boundingBox().toString()); |
+} |
+ |
} // namespace blink |