DescriptionMacViews: Fix WidgetTest.WidgetDeleted_InOnMousePressed
WidgetTest.WidgetDeleted_InOnMousePressed was failing because
the test widget is initialized with a 0x0+0+0 bounds, which is then
resized with SetSize(). Since it's also a popup type, widget.cc does
not call either of SetInitialBounds{,ForFramelessWindow}. This resulted in
a window that was offscreen, so mouse events were not sent to it.
To fix, widgets with no initial bounds are put at the top left of the screen
rather than the bottom-left.
The test was also flaky because the event generator was not retaining
the NSWindow. The tests are specifically to cover the widget being destroyed.
Cocoa retains the window during event dispatch, so the event simulator
should as well.
BUG=378134
Committed: https://crrev.com/4e3993692cad3a7835c9cb47954f60f97fdf4c23
Cr-Commit-Position: refs/heads/master@{#319532}
Patch Set 1 #
Messages
Total messages: 8 (2 generated)
|