Chromium Code Reviews| 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..b57ceb1891dc5e7c67743288dc072f960e417a50 100644 |
| --- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp |
| +++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp |
| @@ -1997,4 +1997,15 @@ TEST_F(VisibleUnitsTest, |
| EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button)); |
| } |
| +TEST_F(VisibleUnitsTest, localSelectionRectOfPositionTemplateNotCrash) { |
| + // Repro case of crbug.com/584030 |
| + const char* bodyContent = "<div>foo<img></div>"; |
|
yosin_UTC9
2017/01/20 08:00:02
nit: no need to use |bodyContent|.
yoichio
2017/01/20 08:30:41
Done.
|
| + setBodyContent(bodyContent); |
| + |
| + Node* node = document().querySelector("img"); |
| + IntRect rect = absoluteSelectionBoundsOf(VisiblePosition::create( |
| + PositionWithAffinity(Position(node, PositionAnchorType::AfterChildren)))); |
| + EXPECT_EQ(IntRect(9, 9, 1, 1), rect); |
|
yosin_UTC9
2017/01/20 08:00:03
I recommend to use EXPECT_FALSE(rect.isEmpty()) be
yoichio
2017/01/20 08:30:41
Done.
|
| +} |
| + |
| } // namespace blink |