DescriptionMac: More robust "window under location" for interactive_ui_tests
The interactive_ui_tests for toolkit-views' custom menus (e.g. for combo
boxes) would work fine when running tests locally, but refuse pass when
run on a trybot.
Tracing narrowed the discrepancy down to the
"WindowAtCurrentMouseLocation()" function in ui_controls_mac.mm. This
was working for windows at some positions on the screen, but not others,
and attempting to add a [NSApp activateIgnoringOtherApps:YES] call at
the appropriate place (e.g. ShowAndFocusNativeWindow() in
interactive_test_utils_mac.mm) had no effect.
This CL makes WindowAtCurrentMouseLocation more robust by effectively
ignoring the influence of windows in other applications that may be on
top of windows created in the test. Instead, iterate through [NSApp
orderedWindows] and use NSPointInRect. This allows all the toolkit-views
menu interactive_ui_tests to pass (except drag & drop - still working on
that).
Note that, historically, Mac's SendMouseMoveNotifyWhenDone would just
use the keyWindow, but that doesn't work for menus (it's also "wrong"
for mouse events).
I suspect this will also allow me to de-flake a bunch of disabled, Cocoa
interactive_ui_tests that have been accumulating.
BUG=403679
Committed: https://crrev.com/1285ca09eaaea056fcbedf0ec621084766449497
Cr-Commit-Position: refs/heads/master@{#309620}
Patch Set 1 #
Messages
Total messages: 11 (4 generated)
|