0

Update PDF MouseEventBuilder to support buttons on mouse move

Expand the support for setting buttons to include mouse move.  Also add
support for button type kNoButton.

This combination will allow tests to more accurately reflect how the
button state can be set during a mouse down-move-up sequence, and for
tests to distinguish between mouse moves where a mouse button might be
up or down.

Change-Id: I88d17085fddda8e8339761ccce3c3ef4033e4714
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6040485
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1386500}
This commit is contained in:
Alan Screen
2024-11-21 22:28:32 +00:00
committed by Chromium LUCI CQ
parent 5ee7e0e79c
commit 18ce99f7ae

@ -20,8 +20,11 @@ MouseEventBuilder::~MouseEventBuilder() = default;
blink::WebMouseEvent MouseEventBuilder::Build() const {
CHECK(blink::WebInputEvent::IsMouseEventType(type_));
int actual_modifiers = modifiers_;
if (type_ == blink::WebInputEvent::Type::kMouseDown) {
if (type_ == blink::WebInputEvent::Type::kMouseDown ||
type_ == blink::WebInputEvent::Type::kMouseMove) {
switch (button_) {
case blink::WebPointerProperties::Button::kNoButton:
break;
case blink::WebPointerProperties::Button::kLeft:
actual_modifiers |= blink::WebInputEvent::Modifiers::kLeftButtonDown;
break;