• tapted's avatar
    MacViews: Fix WidgetTest.DesktopNativeWidgetNoPaintAfterCloseTest · 5ccddf94
    tapted authored
    But.. first make some tests fail.
    
    DesktopNativeWidgetNoPaintAfterCloseTest currently passes but it
    shouldn't. WidgetTests DesktopNativeWidgetNoPaintAfterHideTest and
    TestWindowVisibilityAfterHide were also passing, but
    NativeWidgetMac::Hide() is a no-op, so that shouldn't be the case.
    
    This CL (first) makes them all fail on Mac. To do this,
    BridgedNativeWidget needs to call Widget::OnNativeWidgetPaint() rather
    than painting the RootView directly. And TestWindowVisibilityAfterHide
    must show the widget.
    
    DesktopNativeWidgetNoPaintAfterCloseTest was then fixed by skipping a
    paint when the window is not visible, as toolkit-views expects. However,
    Cocoa paints the window before changing -[NSWindow isVisible]. To fix,
    intercept -[NSWindow orderWindow:relativeTo:]. We need to do this anyway
    to send Widget::OnNativeWidgetVisibilityChanged(), but that's left for a
    follow-up.
    
    BUG=378134
    
    Review URL: https://codereview.chromium.org/654393002
    
    Cr-Commit-Position: refs/heads/master@{#300056}
    5ccddf94
native_widget_mac.mm 17.5 KB