Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Issue 2486643002: Mac: Offset test scroll events when attaching them to an NSWindow. (Closed)

Created:
4 years, 1 month ago by tapted
Modified:
4 years, 1 month ago
Reviewers:
Avi (use Gerrit)
CC:
chromium-reviews, mac-reviews_chromium.org, tdresser+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Offset test scroll events when attaching them to an NSWindow. This fixes WidgetTest.MouseWheelEvent on Mac. Currently it's affected by the screen height: It passes on the bots because the window is large enough to fill most of the (virtual) screen. However, on larger screens, it fails. It hasn't been a problem in the past because tests using cocoa_test_event_utils::TestScrollEvent() typically don't care about the x/y location of the event, but WidgetTest.MouseWheelEvent does. BUG=662763 Committed: https://crrev.com/233eb52fb2c8eeeec2eb27a9fdb08e66836974cc Cr-Commit-Position: refs/heads/master@{#430751}

Patch Set 1 #

Patch Set 2 : fix diff #

Patch Set 3 : not needed #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -0 lines) Patch
M ui/events/test/cocoa_test_event_utils.mm View 1 2 2 chunks +17 lines, -0 lines 3 comments Download

Dependent Patchsets:

Messages

Total messages: 24 (17 generated)
tapted
Hi avi, please take a look. Thanks!
4 years, 1 month ago (2016-11-08 05:05:19 UTC) #11
Avi (use Gerrit)
lgtm https://codereview.chromium.org/2486643002/diff/40001/ui/events/test/cocoa_test_event_utils.mm File ui/events/test/cocoa_test_event_utils.mm (right): https://codereview.chromium.org/2486643002/diff/40001/ui/events/test/cocoa_test_event_utils.mm#newcode37 ui/events/test/cocoa_test_event_utils.mm:37: // origin, but in different directions for x/y. ...
4 years, 1 month ago (2016-11-08 16:20:47 UTC) #16
tapted
https://codereview.chromium.org/2486643002/diff/40001/ui/events/test/cocoa_test_event_utils.mm File ui/events/test/cocoa_test_event_utils.mm (right): https://codereview.chromium.org/2486643002/diff/40001/ui/events/test/cocoa_test_event_utils.mm#newcode37 ui/events/test/cocoa_test_event_utils.mm:37: // origin, but in different directions for x/y. On ...
4 years, 1 month ago (2016-11-08 23:05:52 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2486643002/40001
4 years, 1 month ago (2016-11-08 23:07:21 UTC) #19
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 1 month ago (2016-11-08 23:18:30 UTC) #21
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/233eb52fb2c8eeeec2eb27a9fdb08e66836974cc Cr-Commit-Position: refs/heads/master@{#430751}
4 years, 1 month ago (2016-11-08 23:38:18 UTC) #23
tapted
4 years, 1 month ago (2016-11-08 23:54:20 UTC) #24
Message was sent while issue was closed.
https://codereview.chromium.org/2486643002/diff/40001/ui/events/test/cocoa_te...
File ui/events/test/cocoa_test_event_utils.mm (right):

https://codereview.chromium.org/2486643002/diff/40001/ui/events/test/cocoa_te...
ui/events/test/cocoa_test_event_utils.mm:37: // origin, but in different
directions for x/y.
On 2016/11/08 23:05:52, tapted wrote:
> On 2016/11/08 16:20:47, Avi wrote:
> > o_O
> > 
> > Is there a bug filed? This is surprising. (Though not really.)
> 
> No bug.. It's annoying, but I think it's reasonable for things to be this way.
> It would be "nice" if NSEvent provided ways to make test events specifically
for
> trackpad scrolling, but it's often device-specific, and Apple's opinion is
> probably that only NSScrollView should ever care about them and NSScrollView
> will do the Right Thing for you.
> 
> Instead, all they give is +[NSEvent eventWithCGEvent:] - there's no way to
pass
> in an NSWindow with this initializer, so it's reasonable that NSEvent caters
for
> part of the coordinate conversion, but not all of it.
> 
> It would also be nice if NSEvent had some mutators - its API is immutable, but
> AppKit has access to the internals and tinkers with things during event
> dispatch.
> 
> And while I'm at it, it would be nice if Mac didn't use different coordinate
> systems for CG events and NS events :p
> 
> I don't see NSEvent becoming mutable any time soon, so I think all I can
really
> do  is file a rdar asking for better methods to create test NSEvents for
> scrolling.

Filed http://crbug.com/663553 that collects my current research around
cocoa_test_event_utils:: and the things I dream of doing to it one day.

Powered by Google App Engine
This is Rietveld 408576698