Bug 1742797 - Address review comment and ignore spurious popuphiding events on Linux r=mconley

Differential Revision: https://phabricator.services.mozilla.com/D151622
This commit is contained in:
Florian Quèze 2022-07-12 15:17:21 +00:00
Родитель 04b02aad0d
Коммит 330fea72a1
2 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -34,6 +34,21 @@ 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"

Просмотреть файл

@ -1099,6 +1099,9 @@ void nsMenuPopupFrame::HidePopup(bool aDeselectMenu, nsPopupState aNewState) {
mHFlip = mVFlip = false;
if (auto* widget = GetWidget()) {
// Ideally we should call ClearCachedWebrenderResources but there are
// intermittent failures (see bug 1748788), so we currently call
// ClearWebrenderAnimationResources instead.
widget->ClearWebrenderAnimationResources();
}