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

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

Issue 2653493012: Brush up localSelectionRectOfPositionTemplate (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
index 3d71e54d8f096db05946560f3c35cb43baca6368..ee051fb97d1c336feedf533cf1d0a40d5cffca12 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
@@ -1997,4 +1997,14 @@ TEST_F(VisibleUnitsTest,
EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button));
}
+// Repro case of crbug.com/680428
+TEST_F(VisibleUnitsTest, localSelectionRectOfPositionTemplateNotCrash) {
+ setBodyContent("<div>foo<img></div>");
+
+ Node* node = document().querySelector("img");
+ IntRect rect = absoluteSelectionBoundsOf(VisiblePosition::create(
+ PositionWithAffinity(Position(node, PositionAnchorType::AfterChildren))));
+ EXPECT_FALSE(rect.isEmpty());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698