Commit 77c2c069 authored by Maggie Cai's avatar Maggie Cai Committed by Commit Bot

Revert "[ChromeDriver] Support triple click in Chromedriver PerformActions"

This reverts commit 2576e02f.

Reason for revert: This CL is likely the cause of the build failure for test external/wpt/webdriver/tests/release_actions/sequence.py>>test_no_release_mouse_sequence_keeps_dblclick_state, in buildes first occurs in:
https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests%20%28dbg%29%281%29/91045 and
https://ci.chromium.org/p/chromium/builders/ci/linux-trusty-rel/14964

Original change's description:
> [ChromeDriver] Support triple click in Chromedriver PerformActions
> 
> When we are using PerformActions from ChromeDriver to simulate three
> mouse click, it only set the click count to 2, not 3, so this test fails
> third_party/blink/web_tests/external/wpt/webdriver/tests/perform_actions
> /pointer_tripleclick.py.
> 
> PerformActions should keep the mouse click count and decide if we should
> increase the count or set to 1 when we have a mouse press based on the
> interval of two mouse presses and difference between the current mouse
> positions and the last one.
> 
> Bug: 1119679
> Change-Id: I2b941c5d295cdd457109c8866c55e02bb2360555
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366655
> Reviewed-by: John Chen <johnchen@chromium.org>
> Commit-Queue: Lan Wei <lanwei@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#800201}

TBR=lanwei@chromium.org,johnchen@chromium.org

Change-Id: Ie57866e4aef6ac88eca708a05459032c1fee2128
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1119679
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2368620Reviewed-by: default avatarMaggie Cai <mxcai@chromium.org>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800511}
parent 796f4db3
...@@ -1492,7 +1492,6 @@ Status ExecutePerformActions(Session* session, ...@@ -1492,7 +1492,6 @@ Status ExecutePerformActions(Session* session,
std::map<std::string, bool> has_touch_start; std::map<std::string, bool> has_touch_start;
std::map<std::string, int> buttons; std::map<std::string, int> buttons;
std::map<std::string, std::string> button_type; std::map<std::string, std::string> button_type;
std::map<std::string, int> click_counts;
int viewport_width = 0, viewport_height = 0; int viewport_width = 0, viewport_height = 0;
int init_x = 0, init_y = 0; int init_x = 0, init_y = 0;
...@@ -1562,12 +1561,10 @@ Status ExecutePerformActions(Session* session, ...@@ -1562,12 +1561,10 @@ Status ExecutePerformActions(Session* session,
std::string pointer_type; std::string pointer_type;
action->GetString("pointerType", &pointer_type); action->GetString("pointerType", &pointer_type);
if (pointer_type == "mouse" || pointer_type == "pen") { if (pointer_type == "mouse" || pointer_type == "pen")
buttons[id] = input_state->FindKey("pressed")->GetInt(); buttons[id] = input_state->FindKey("pressed")->GetInt();
click_counts[id] = 0; else if (pointer_type == "touch")
} else if (pointer_type == "touch") {
has_touch_start[id] = false; has_touch_start[id] = false;
}
} }
} }
...@@ -1691,7 +1688,6 @@ Status ExecutePerformActions(Session* session, ...@@ -1691,7 +1688,6 @@ Status ExecutePerformActions(Session* session,
} else if (buttons[id] == 0) { } else if (buttons[id] == 0) {
button_type[id].clear(); button_type[id].clear();
} }
MouseEvent event(StringToMouseEventType(action_type), MouseEvent event(StringToMouseEventType(action_type),
StringToMouseButton(button_type[id]), StringToMouseButton(button_type[id]),
action_locations[id].x(), action_locations[id].x(),
...@@ -1705,8 +1701,7 @@ Status ExecutePerformActions(Session* session, ...@@ -1705,8 +1701,7 @@ Status ExecutePerformActions(Session* session,
event.x, event.y, session->mouse_position.x, event.x, event.y, session->mouse_position.x,
session->mouse_position.y, session->click_count, session->mouse_position.y, session->click_count,
timestamp, session->mouse_click_timestamp); timestamp, session->mouse_click_timestamp);
click_counts[id] = is_repeated_click ? ++click_counts[id] : 1; event.click_count = is_repeated_click ? 2 : 1;
event.click_count = click_counts[id];
buttons[id] |= StringToModifierMouseButton(button_type[id]); buttons[id] |= StringToModifierMouseButton(button_type[id]);
session->mouse_position = WebPoint(event.x, event.y); session->mouse_position = WebPoint(event.x, event.y);
session->click_count = event.click_count; session->click_count = event.click_count;
......
...@@ -4,7 +4,7 @@ from tests.support.inline import inline ...@@ -4,7 +4,7 @@ from tests.support.inline import inline
lots_of_text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "\ lots_of_text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "\
"incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud "\ "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud "\
"exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." " exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
def test_tripleclick_at_coordinates(session, mouse_chain): def test_tripleclick_at_coordinates(session, mouse_chain):
......
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