Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: third_party/WebKit/Source/core/input/EventHandlerTest.cpp

Issue 2871703003: Clear the state of scroll and selection onmouseup (Closed)
Patch Set: Remove redundant parameter Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 2a0c6f72df8448d56f6be7b99aeb557f3c3df5bb..641ba710be21239cf25614faf122adb2c38c7ad7 100644
--- a/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
@@ -9,6 +9,7 @@
#include "core/dom/Range.h"
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
+#include "core/editing/SelectionController.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
@@ -117,6 +118,12 @@ TEST_F(EventHandlerTest, dragSelectionAfterScroll) {
GetDocument().GetFrame()->GetEventHandler().HandleMousePressEvent(
mouse_down_event);
+ ASSERT_TRUE(GetDocument()
+ .GetFrame()
+ ->GetEventHandler()
+ .GetSelectionController()
+ .MouseDownMayStartSelect());
+
WebMouseEvent mouse_move_event(
WebInputEvent::kMouseMove, WebFloatPoint(100, 50),
WebFloatPoint(200, 250), WebPointerProperties::Button::kLeft, 1,
@@ -139,6 +146,12 @@ TEST_F(EventHandlerTest, dragSelectionAfterScroll) {
GetDocument().GetFrame()->GetEventHandler().HandleMouseReleaseEvent(
mouse_up_event);
+ ASSERT_FALSE(GetDocument()
+ .GetFrame()
+ ->GetEventHandler()
+ .GetSelectionController()
+ .MouseDownMayStartSelect());
+
ASSERT_TRUE(
Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsRange());
Range* range = CreateRange(Selection()
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.cpp ('k') | third_party/WebKit/Source/core/input/MouseEventManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698