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

Issue 2794213002: MacViews: Fix some TableView tests, add ui::EventGenerator::set_assume_window_at_origin(bool) (Closed)

Created:
3 years, 8 months ago by tapted
Modified:
3 years, 8 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Fix some TableView tests, add ui::EventGenerator::set_assume_window_at_origin(bool) EventGenerator uses root window coordinates, and many tests using EventGenerator assume that a window it creates at (0,0) will be placed at the origin of the root window when Show()n. However, on Mac, this is rarely the case for "real" Widgets. The WindowServer forcefully shifts the window into the work area so that it doesn't overlap the OS mainMenu bar. On Mac, the EventGenerator currently doesn't remap mouse coordinates to a "hit" window: effectively treating all windows as if they are positioned at (0,0). But tests that *do* correctly take into account the screen position of a test window, and correctly map their test event coordinates, will not like this. By calling EventGenerator::set_assume_window_at_origin(false) a test can disable the "fake" coordinate mapping. Using EventGenerator and "real" NSEvents exposed some other bugs in TreeView. Ctrl+LeftClick on Mac is actually a right-click so can't be used for multi-row selection. Update TableView and its tests to use Command on Mac. Also the Mac EventGenerator was passing event->changed_button_flags() as the event modifiers, but it should pass event->flags() instead for mouse events. (Only NSFlagsChanged key events should use changed_button_flags(), but EventGenerator hasn't needed them yet. BUG=708401 Review-Url: https://codereview.chromium.org/2794213002 Cr-Commit-Position: refs/heads/master@{#462342} Committed: https://chromium.googlesource.com/chromium/src/+/a1746a908f94b40aea3c37d63734d4667e3835bc

Patch Set 1 #

Patch Set 2 : nit header #

Patch Set 3 : Different approach #

Patch Set 4 : rebase + enable tests #

Patch Set 5 : What does default to false do? #

Patch Set 6 : Yeah. that's a lot of failures #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -50 lines) Patch
M ui/events/test/event_generator.h View 1 2 3 4 5 2 chunks +27 lines, -5 lines 3 comments Download
M ui/events/test/event_generator.cc View 1 2 1 chunk +4 lines, -24 lines 0 comments Download
M ui/views/controls/table/table_view.cc View 1 2 3 4 4 chunks +15 lines, -7 lines 0 comments Download
M ui/views/controls/table/table_view_unittest.cc View 1 2 3 5 chunks +9 lines, -5 lines 0 comments Download
M ui/views/test/event_generator_delegate_mac.mm View 1 2 3 chunks +15 lines, -9 lines 0 comments Download

Messages

Total messages: 34 (28 generated)
tapted
Hi sky, please take a look https://codereview.chromium.org/2794213002/diff/100001/ui/events/test/event_generator.h File ui/events/test/event_generator.h (right): https://codereview.chromium.org/2794213002/diff/100001/ui/events/test/event_generator.h#newcode476 ui/events/test/event_generator.h:476: bool assume_window_at_origin_ = ...
3 years, 8 months ago (2017-04-05 04:54:17 UTC) #26
sky
Suggestion on naming. https://codereview.chromium.org/2794213002/diff/100001/ui/events/test/event_generator.h File ui/events/test/event_generator.h (right): https://codereview.chromium.org/2794213002/diff/100001/ui/events/test/event_generator.h#newcode171 ui/events/test/event_generator.h:171: void set_assume_window_at_origin(bool assume_window_at_origin) { Is a ...
3 years, 8 months ago (2017-04-05 15:39:53 UTC) #27
tapted
https://codereview.chromium.org/2794213002/diff/100001/ui/events/test/event_generator.h File ui/events/test/event_generator.h (right): https://codereview.chromium.org/2794213002/diff/100001/ui/events/test/event_generator.h#newcode171 ui/events/test/event_generator.h:171: void set_assume_window_at_origin(bool assume_window_at_origin) { On 2017/04/05 15:39:53, sky wrote: ...
3 years, 8 months ago (2017-04-05 23:57:18 UTC) #28
sky
Ok, fair enough. LGTM
3 years, 8 months ago (2017-04-06 02:05:58 UTC) #29
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/2794213002/100001
3 years, 8 months ago (2017-04-06 03:13:33 UTC) #31
commit-bot: I haz the power
3 years, 8 months ago (2017-04-06 03:21:02 UTC) #34
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/a1746a908f94b40aea3c37d63734...

Powered by Google App Engine
This is Rietveld 408576698