MacViews: EventGenerator can't move mouse using screen coordinates for non (0,0)-originated Widgets
Reported by
mbl...@yandex-team.ru,
Apr 14 2017
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.137 YaBrowser/17.4.1.353 (beta) Yowser/2.5 Safari/537.36 Steps to reproduce the problem: https://codereview.chromium.org/2808223002/diff/80001/chrome/browser/ui/views/content_setting_bubble_contents_unittest.cc This test can't click the checkbox on MacViews. What is the expected behavior? What went wrong? This unit_test creates a bubble widget that's not positioned at (0,0) and tries to send a mouse click using EventGenerator::MoveMouseTo which expects a point in screen coordinates. The click misses because EventGeneratorDelegateMac treats passed coordinate as widget-local. There's a ConvertPointToTarget() function to correct for that, but after that a lot of current tests start to fail. I investigated WidgetTest.MouseEventTypesViaGenerator: the actual gfx::ScreenRectFromNSRect([window_.get() frame]) of the NSWindow is { origin_ = (x_ = 0, y_ = 23) size_ = (width_ = 100, height_ = 80) } Did this work before? No Chrome version: 57.0.2987.137 Channel: n/a OS Version: OS X 10.12.4 Flash Version: Proposed ConvertPointToTarget implementation (fails a lot of current tests) void ConvertPointToTarget(const ui::EventTarget* target, gfx::Point* point) const override {} gfx::Point* point) const override { DCHECK_EQ(this, target); DCHECK_EQ(NO, [[window_ contentView] isFlipped]); const NSPoint windowPoint = ui::ConvertPointFromScreenToWindow( window_.get(), gfx::ScreenPointToNSPoint(*point)); const NSRect contentRect = [window_ contentRectForFrameRect:[window_ frame]]; *point = gfx::Point(windowPoint.x, NSHeight(contentRect) - windowPoint.y); }
,
Apr 25 2017
Over to ellyjones for further triage.
,
Apr 26 2017
This is a deficiency in MacViews unit test support, so tagging MacViews-Cleanup and leaving Available for now.
,
Apr 13 2018
,
Apr 17 2018
Explicit M-X tag.
,
Jul 12
,
Nov 20
*** UI Mass Triage*** |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by ranjitkan@chromium.org
, Apr 17 2017