| Index: third_party/WebKit/Source/core/input/EventHandlerTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/input/EventHandlerTest.cpp b/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
|
| index 11ba2c8e64f6c51c2eebd0ba145f4f0cfa5e52cc..590a65e187fb4a527a7d0dd63ea146e397d8e35d 100644
|
| --- a/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
|
| +++ b/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
|
| @@ -171,4 +171,72 @@ TEST_F(EventHandlerTest, multiClickSelectionFromTapDisabledIfNotEditable)
|
| EXPECT_EQ(Position(line, 0), selection.start());
|
| }
|
|
|
| +TEST_F(EventHandlerTest, draggedInlinePositionTest)
|
| +{
|
| + setHtmlInnerHTML(
|
| + "<style>"
|
| + "body { margin: 0px; }"
|
| + "</style>"
|
| + "<div style='width: 300px; height: 100px;'>"
|
| + "<span style='background: blue; width: 50px; height: 50px; margin-left: 250px; font-size: 50px;' draggable='true'>abcd</span>"
|
| + "</div>");
|
| + PlatformMouseEvent mouseDownEvent1(
|
| + IntPoint(262, 29),
|
| + IntPoint(329, 167),
|
| + LeftButton,
|
| + PlatformEvent::MousePressed,
|
| + 1,
|
| + PlatformEvent::Modifiers::LeftButtonDown,
|
| + WTF::monotonicallyIncreasingTime());
|
| + document().frame()->eventHandler().handleMousePressEvent(mouseDownEvent1);
|
| +
|
| + PlatformMouseEvent mouseMoveEvent(
|
| + IntPoint(618, 298),
|
| + IntPoint(685, 436),
|
| + LeftButton,
|
| + PlatformEvent::MouseMoved,
|
| + 1,
|
| + PlatformEvent::Modifiers::LeftButtonDown,
|
| + WTF::monotonicallyIncreasingTime());
|
| + document().frame()->eventHandler().handleMouseMoveEvent(mouseMoveEvent);
|
| +
|
| + EXPECT_EQ(IntPoint(12, 29), document().frame()->eventHandler().dragDataTransferLocationForTesting());
|
| +}
|
| +
|
| +TEST_F(EventHandlerTest, draggedSVGImagePositionTest)
|
| +{
|
| + setHtmlInnerHTML(
|
| + "<style>"
|
| + "body { margin: 0px; }"
|
| + "[draggable] {"
|
| + "-webkit-user-select: none; user-select: none; -webkit-user-drag: element; }"
|
| + "</style>"
|
| + "<div style='width: 300px; height: 100px;'>"
|
| + "<svg width='500' height='500'>"
|
| + "<rect x='100' y='100' width='100px' height='100px' fill='blue' draggable='true'/>"
|
| + "</svg>"
|
| + "</div>");
|
| + PlatformMouseEvent mouseDownEvent1(
|
| + IntPoint(145, 144),
|
| + IntPoint(212, 282),
|
| + LeftButton,
|
| + PlatformEvent::MousePressed,
|
| + 1,
|
| + PlatformEvent::Modifiers::LeftButtonDown,
|
| + WTF::monotonicallyIncreasingTime());
|
| + document().frame()->eventHandler().handleMousePressEvent(mouseDownEvent1);
|
| +
|
| + PlatformMouseEvent mouseMoveEvent(
|
| + IntPoint(618, 298),
|
| + IntPoint(685, 436),
|
| + LeftButton,
|
| + PlatformEvent::MouseMoved,
|
| + 1,
|
| + PlatformEvent::Modifiers::LeftButtonDown,
|
| + WTF::monotonicallyIncreasingTime());
|
| + document().frame()->eventHandler().handleMouseMoveEvent(mouseMoveEvent);
|
| +
|
| + EXPECT_EQ(IntPoint(45, 44), document().frame()->eventHandler().dragDataTransferLocationForTesting());
|
| +}
|
| +
|
| } // namespace blink
|
|
|