diff --git a/browser/base/content/test/performance/browser_panel_vsync.js b/browser/base/content/test/performance/browser_panel_vsync.js index 11e95a61fcf3..a00b977ca98f 100644 --- a/browser/base/content/test/performance/browser_panel_vsync.js +++ b/browser/base/content/test/performance/browser_panel_vsync.js @@ -34,20 +34,31 @@ add_task( // Should not already be using vsync ok(!ChromeUtils.vsyncEnabled(), "vsync should be off initially"); + if ( + AppConstants.platform == "linux" && + DownloadsPanel.panel.state != "open" + ) { + // Panels sometime receive spurious popuphiding events on Linux. + // Given the main target of this test is Windows, avoid causing + // intermittent failures and just make the test return early. + todo( + false, + "panel should still be 'open', current state: " + + DownloadsPanel.panel.state + ); + return; + } + const hiddenPromise = BrowserTestUtils.waitForEvent( DownloadsPanel.panel, "popuphidden" ); - EventUtils.synthesizeNativeMouseEvent({ - type: "click", - target: downloadsButton, - atCenter: true, - }); - - await Promise.all([ - hiddenPromise, - TestUtils.waitForCondition(() => !ChromeUtils.vsyncEnabled()), - ]); + EventUtils.synthesizeKey("VK_ESCAPE", {}, window); + await hiddenPromise; + await TestUtils.waitForCondition( + () => !ChromeUtils.vsyncEnabled(), + "wait for vsync to be disabled again" + ); ok(!ChromeUtils.vsyncEnabled(), "vsync should still be off"); is( diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 03763b914a0b..c55270501e0e 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -1099,7 +1099,10 @@ void nsMenuPopupFrame::HidePopup(bool aDeselectMenu, nsPopupState aNewState) { mHFlip = mVFlip = false; if (auto* widget = GetWidget()) { - widget->ClearCachedWebrenderResources(); + // Ideally we should call ClearCachedWebrenderResources but there are + // intermittent failures (see bug 1748788), so we currently call + // ClearWebrenderAnimationResources instead. + widget->ClearWebrenderAnimationResources(); } nsView* view = GetView();