ui_test_utils::SendMouseMoveSync with Ozone never holds down mouse buttons |
|||
Issue description
REPRO STEPS:
Use ui_test_utils to simulate start of a drag and drop:
1. // Simulate mouse move to the middle of an image / frame:
ui_test_utils::SendMouseMoveSync(kMiddleOfLeftFrame);
2. // Simulate mouse down:
ui_test_utils::SendMouseEventsSync(ui_controls::LEFT,
ui_controls::DOWN);
3. // Simulate dragging the mouse:
ui_test_utils::SendMouseMoveSync(kMiddleOfLeftFrame +
gfx::Vector2d(10, 10)))
EXPECTED BEHAVIOR:
- Step #3 triggers sending to renderer a WebInputEvent with
button field set to WebPointerProperties::Button::Left
- Drag starts.
The expected and desired behavior above is what happens with Aura, but without Ozone:
$ cat out/cros/args.gn
dcheck_always_on = true
is_component_build = true
is_debug = false
use_goma = true
enable_nacl = false
target_os = "chromeos"
ACTUAL BEHAVIOR:
- Step #3 triggers sending to renderer a WebInputEvent with
button field set to WebPointerProperties::Button::NoButton
- Drag doesn't start, because WebInputEventResult MouseEventManager::handleMouseDraggedEvent explicitly checks whether a mouse button was held down:
WebInputEventResult MouseEventManager::handleMouseDraggedEvent(
const MouseEventWithHitTestResults& event) {
...
if (event.event().pointerProperties().button !=
WebPointerProperties::Button::Left)
m_mousePressed = false;
if (!m_mousePressed)
return WebInputEventResult::NotHandled;
The unexpected behavior above is what happens with Ozone:
$ cat out/ozone/args.gn
dcheck_always_on = true
is_component_build = true
is_debug = false
use_goma = true
enable_nacl = false
target_os = "chromeos"
use_ozone = true
,
Nov 14 2016
I think that the fix might be just passing button_down_mask_:
diff --git a/ui/aura/test/ui_controls_factory_ozone.cc b/ui/aura/test/ui_controls_factory_ozone.cc
index fb83983..30f6bae 100644
--- a/ui/aura/test/ui_controls_factory_ozone.cc
+++ b/ui/aura/test/ui_controls_factory_ozone.cc
@@ -116,7 +116,7 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
else
event_type = ui::ET_MOUSE_MOVED;
- PostMouseEvent(event_type, host_location, 0, 0);
+ PostMouseEvent(event_type, host_location, button_down_mask_, 0);
,
Nov 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4efeebff3065b8de77bc01b16c1788010d7ea3eb commit 4efeebff3065b8de77bc01b16c1788010d7ea3eb Author: lukasza <lukasza@chromium.org> Date: Wed Nov 16 15:17:51 2016 Use remembered mouse button state when simulating a mouse move in Ozone. BUG= 665042 Review-Url: https://codereview.chromium.org/2499103002 Cr-Commit-Position: refs/heads/master@{#432491} [modify] https://crrev.com/4efeebff3065b8de77bc01b16c1788010d7ea3eb/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc [modify] https://crrev.com/4efeebff3065b8de77bc01b16c1788010d7ea3eb/ui/aura/test/ui_controls_factory_ozone.cc
,
Nov 16 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by lukasza@chromium.org
, Nov 14 2016