зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1742797 - Fix intermittent test failures, r=hiro.
Depends on D151481 Differential Revision: https://phabricator.services.mozilla.com/D151480
This commit is contained in:
Родитель
4907d4f03c
Коммит
ab3e31f024
|
@ -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(
|
||||
|
@ -55,5 +66,14 @@ add_task(
|
|||
"closed",
|
||||
"Check that panel state is 'closed'"
|
||||
);
|
||||
|
||||
// Move the cursor to the center of the browser window where hopefully it
|
||||
// will cause less intermittent failures in the next tests than keeping it
|
||||
// in the toolbar area.
|
||||
EventUtils.synthesizeNativeMouseEvent({
|
||||
type: "mousemove",
|
||||
target: document.documentElement,
|
||||
atCenter: true,
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче