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

Unified Diff: third_party/WebKit/Source/core/editing/EphemeralRangeTest.cpp

Issue 2776103002: Make RenderedRectsForMarkers() to ignore disconnected nodes. (Closed)
Patch Set: upload test file Created 3 years, 9 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
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

Powered by Google App Engine
This is Rietveld 408576698