| 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 f2646b81383d95a16de6278b3eefabff8c681747..9e03c33fc7b400621f0945fa7446647546b33200 100644
|
| --- a/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
|
| +++ b/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
|
| @@ -153,7 +153,8 @@ TEST_F(EventHandlerTest, multiClickSelectionFromTap) {
|
|
|
| TapEventBuilder singleTapEvent(IntPoint(0, 0), 1);
|
| document().frame()->eventHandler().handleGestureEvent(singleTapEvent);
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| EXPECT_EQ(Position(line, 0), selection().start());
|
|
|
| // Multi-tap events on editable elements should trigger selection, just
|
| @@ -188,18 +189,21 @@ TEST_F(EventHandlerTest, multiClickSelectionFromTapDisabledIfNotEditable) {
|
|
|
| TapEventBuilder singleTapEvent(IntPoint(0, 0), 1);
|
| document().frame()->eventHandler().handleGestureEvent(singleTapEvent);
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| EXPECT_EQ(Position(line, 0), selection().start());
|
|
|
| // As the text is readonly, multi-tap events should not trigger selection.
|
| TapEventBuilder doubleTapEvent(IntPoint(0, 0), 2);
|
| document().frame()->eventHandler().handleGestureEvent(doubleTapEvent);
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| EXPECT_EQ(Position(line, 0), selection().start());
|
|
|
| TapEventBuilder tripleTapEvent(IntPoint(0, 0), 3);
|
| document().frame()->eventHandler().handleGestureEvent(tripleTapEvent);
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| EXPECT_EQ(Position(line, 0), selection().start());
|
| }
|
|
|
| @@ -304,7 +308,8 @@ TEST_F(EventHandlerTest, EmptyTextfieldInsertionOnTap) {
|
| TapEventBuilder singleTapEvent(IntPoint(200, 200), 1);
|
| document().frame()->eventHandler().handleGestureEvent(singleTapEvent);
|
|
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| ASSERT_FALSE(selection().isHandleVisible());
|
| }
|
|
|
| @@ -314,7 +319,8 @@ TEST_F(EventHandlerTest, NonEmptyTextfieldInsertionOnTap) {
|
| TapEventBuilder singleTapEvent(IntPoint(200, 200), 1);
|
| document().frame()->eventHandler().handleGestureEvent(singleTapEvent);
|
|
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| ASSERT_TRUE(selection().isHandleVisible());
|
| }
|
|
|
| @@ -324,14 +330,16 @@ TEST_F(EventHandlerTest, EmptyTextfieldInsertionOnLongPress) {
|
| LongPressEventBuilder longPressEvent(IntPoint(200, 200));
|
| document().frame()->eventHandler().handleGestureEvent(longPressEvent);
|
|
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| ASSERT_TRUE(selection().isHandleVisible());
|
|
|
| // Single Tap on an empty edit field should clear insertion handle
|
| TapEventBuilder singleTapEvent(IntPoint(200, 200), 1);
|
| document().frame()->eventHandler().handleGestureEvent(singleTapEvent);
|
|
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| ASSERT_FALSE(selection().isHandleVisible());
|
| }
|
|
|
| @@ -341,7 +349,8 @@ TEST_F(EventHandlerTest, NonEmptyTextfieldInsertionOnLongPress) {
|
| LongPressEventBuilder longPressEvent(IntPoint(200, 200));
|
| document().frame()->eventHandler().handleGestureEvent(longPressEvent);
|
|
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| ASSERT_TRUE(selection().isHandleVisible());
|
| }
|
|
|
| @@ -352,7 +361,8 @@ TEST_F(EventHandlerTest, ClearHandleAfterTap) {
|
| LongPressEventBuilder longPressEvent(IntPoint(200, 200));
|
| document().frame()->eventHandler().handleGestureEvent(longPressEvent);
|
|
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| ASSERT_TRUE(selection().isHandleVisible());
|
|
|
| // Tap away from text area should clear handle
|
| @@ -370,7 +380,8 @@ TEST_F(EventHandlerTest, HandleNotShownOnMouseEvents) {
|
| IntPoint(200, 200), 1, WebPointerProperties::Button::Left);
|
| document().frame()->eventHandler().handleMousePressEvent(leftMousePressEvent);
|
|
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| ASSERT_FALSE(selection().isHandleVisible());
|
|
|
| MousePressEventBuilder rightMousePressEvent(
|
| @@ -378,7 +389,8 @@ TEST_F(EventHandlerTest, HandleNotShownOnMouseEvents) {
|
| document().frame()->eventHandler().handleMousePressEvent(
|
| rightMousePressEvent);
|
|
|
| - ASSERT_TRUE(selection().isCaret());
|
| + ASSERT_TRUE(
|
| + selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
|
| ASSERT_FALSE(selection().isHandleVisible());
|
|
|
| MousePressEventBuilder doubleClickMousePressEvent(
|
|
|