| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/input/EventHandler.h" | 5 #include "core/input/EventHandler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Range.h" | 9 #include "core/dom/Range.h" |
| 10 #include "core/editing/Editor.h" | 10 #include "core/editing/Editor.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 document().frame()->eventHandler().handleGestureEvent(longPressEvent); | 375 document().frame()->eventHandler().handleGestureEvent(longPressEvent); |
| 376 | 376 |
| 377 ASSERT_TRUE( | 377 ASSERT_TRUE( |
| 378 selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret()); | 378 selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret()); |
| 379 ASSERT_TRUE(selection().isHandleVisible()); | 379 ASSERT_TRUE(selection().isHandleVisible()); |
| 380 | 380 |
| 381 // Tap away from text area should clear handle | 381 // Tap away from text area should clear handle |
| 382 TapEventBuilder singleTapEvent(IntPoint(700, 700), 1); | 382 TapEventBuilder singleTapEvent(IntPoint(700, 700), 1); |
| 383 document().frame()->eventHandler().handleGestureEvent(singleTapEvent); | 383 document().frame()->eventHandler().handleGestureEvent(singleTapEvent); |
| 384 | 384 |
| 385 ASSERT_TRUE(selection().isNone()); | 385 ASSERT_TRUE( |
| 386 selection().computeVisibleSelectionInDOMTreeDeprecated().isNone()); |
| 386 ASSERT_FALSE(selection().isHandleVisible()); | 387 ASSERT_FALSE(selection().isHandleVisible()); |
| 387 } | 388 } |
| 388 | 389 |
| 389 TEST_F(EventHandlerTest, HandleNotShownOnMouseEvents) { | 390 TEST_F(EventHandlerTest, HandleNotShownOnMouseEvents) { |
| 390 setHtmlInnerHTML("<textarea cols=50 rows=50>Enter text</textarea>"); | 391 setHtmlInnerHTML("<textarea cols=50 rows=50>Enter text</textarea>"); |
| 391 | 392 |
| 392 MousePressEventBuilder leftMousePressEvent( | 393 MousePressEventBuilder leftMousePressEvent( |
| 393 IntPoint(200, 200), 1, WebPointerProperties::Button::Left); | 394 IntPoint(200, 200), 1, WebPointerProperties::Button::Left); |
| 394 document().frame()->eventHandler().handleMousePressEvent(leftMousePressEvent); | 395 document().frame()->eventHandler().handleMousePressEvent(leftMousePressEvent); |
| 395 | 396 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 WebInputEvent::MouseLeave, WebFloatPoint(0, 0), WebFloatPoint(0, 0), | 516 WebInputEvent::MouseLeave, WebFloatPoint(0, 0), WebFloatPoint(0, 0), |
| 516 WebPointerProperties::Button::NoButton, 0, WebInputEvent::NoModifiers, | 517 WebPointerProperties::Button::NoButton, 0, WebInputEvent::NoModifiers, |
| 517 TimeTicks::Now().InSeconds()); | 518 TimeTicks::Now().InSeconds()); |
| 518 mouseLeaveEvent.setFrameScale(1); | 519 mouseLeaveEvent.setFrameScale(1); |
| 519 document().frame()->eventHandler().handleMouseLeaveEvent(mouseLeaveEvent); | 520 document().frame()->eventHandler().handleMouseLeaveEvent(mouseLeaveEvent); |
| 520 | 521 |
| 521 EXPECT_EQ(WTF::String(), lastToolTip()); | 522 EXPECT_EQ(WTF::String(), lastToolTip()); |
| 522 } | 523 } |
| 523 | 524 |
| 524 } // namespace blink | 525 } // namespace blink |
| OLD | NEW |