Commit 015261d0 authored by John Chen's avatar John Chen Committed by Commit Bot

[ChromeDriver] Fix mouse move after click

In a sequence of mouse pointerDown, pointerUp, and pointerMove actions,
the mouse button saved by the first two actions needs to be cleared
while processing the last action, as no button is pressed.

Fixes the following Selenium Java test:
CombinedInputActionsTest.testControlClickingOnMultiSelectionList

Bug: chromedriver:1897
Change-Id: I0bd7b377fa0c977c8c20c5c0e306f772ee30ca98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1547130
Auto-Submit: John Chen <johnchen@chromium.org>
Reviewed-by: default avatarLan Wei <lanwei@chromium.org>
Commit-Queue: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646444}
parent e3d8f94c
...@@ -1361,6 +1361,8 @@ Status ExecutePerformActions(Session* session, ...@@ -1361,6 +1361,8 @@ Status ExecutePerformActions(Session* session,
if (action_type == "pointerDown" || action_type == "pointerUp") { if (action_type == "pointerDown" || action_type == "pointerUp") {
pointer_action->GetString("button", &button_type); pointer_action->GetString("button", &button_type);
click_count = 1; click_count = 1;
} else if (buttons == 0) {
button_type.clear();
} }
MouseEvent event(StringToMouseEventType(action_type), MouseEvent event(StringToMouseEventType(action_type),
StringToMouseButton(button_type), x, y, 0, buttons, StringToMouseButton(button_type), x, y, 0, buttons,
......
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