Commit 7f75cce9 authored by amaralp's avatar amaralp Committed by Commit bot

Making sure ClearHandleAfterTap's tap occurs inside of HTML document

The last tap in ClearHandleAfterTap was causing the HitTestResult's innerNode to
be null. This change makes it so that the tap occurs on an HTML element thus
making the innerNode not be null. This is change was necessary to for
crrev.com/2616623002.

Review-Url: https://codereview.chromium.org/2748483002
Cr-Commit-Position: refs/heads/master@{#457488}
parent f113bf9d
......@@ -368,10 +368,10 @@ TEST_F(EventHandlerTest, NonEmptyTextfieldInsertionOnLongPress) {
}
TEST_F(EventHandlerTest, ClearHandleAfterTap) {
setHtmlInnerHTML("<textarea cols=50 rows=50>Enter text</textarea>");
setHtmlInnerHTML("<textarea cols=50 rows=10>Enter text</textarea>");
// Show handle
LongPressEventBuilder longPressEvent(IntPoint(200, 200));
LongPressEventBuilder longPressEvent(IntPoint(200, 10));
document().frame()->eventHandler().handleGestureEvent(longPressEvent);
ASSERT_TRUE(
......@@ -379,11 +379,9 @@ TEST_F(EventHandlerTest, ClearHandleAfterTap) {
ASSERT_TRUE(selection().isHandleVisible());
// Tap away from text area should clear handle
TapEventBuilder singleTapEvent(IntPoint(700, 700), 1);
TapEventBuilder singleTapEvent(IntPoint(200, 350), 1);
document().frame()->eventHandler().handleGestureEvent(singleTapEvent);
ASSERT_TRUE(
selection().computeVisibleSelectionInDOMTreeDeprecated().isNone());
ASSERT_FALSE(selection().isHandleVisible());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment