Bug 1742797 - Fix intermittent test failures, r=hiro.

Differential Revision: https://phabricator.services.mozilla.com/D151480
This commit is contained in:
Florian Quèze 2022-07-18 18:01:52 +00:00
Родитель 30a66f3945
Коммит b00890b2e8
2 изменённых файлов: 25 добавлений и 11 удалений

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

@ -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(

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

@ -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();