зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1190687 - [webext] Convert openContextMenu and closeContextMenu test helpers into async functions. r=kmag
MozReview-Commit-ID: AD57ftJiVlR --HG-- extra : rebase_source : 335fad80d92844ae2d773abf39186d772a67c08a
This commit is contained in:
Родитель
bd60fe4e05
Коммит
de5896b417
|
@ -225,19 +225,19 @@ function closeBrowserAction(extension, win = window) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
function* openContextMenu(selector = "#img1") {
|
async function openContextMenu(selector = "#img1") {
|
||||||
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
||||||
let popupShownPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popupshown");
|
let popupShownPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popupshown");
|
||||||
yield BrowserTestUtils.synthesizeMouseAtCenter(selector, {type: "contextmenu"}, gBrowser.selectedBrowser);
|
await BrowserTestUtils.synthesizeMouseAtCenter(selector, {type: "contextmenu"}, gBrowser.selectedBrowser);
|
||||||
yield popupShownPromise;
|
await popupShownPromise;
|
||||||
return contentAreaContextMenu;
|
return contentAreaContextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
function* closeContextMenu() {
|
async function closeContextMenu() {
|
||||||
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
||||||
let popupHiddenPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popuphidden");
|
let popupHiddenPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popuphidden");
|
||||||
contentAreaContextMenu.hidePopup();
|
contentAreaContextMenu.hidePopup();
|
||||||
yield popupHiddenPromise;
|
await popupHiddenPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
function* openExtensionContextMenu(selector = "#img1") {
|
function* openExtensionContextMenu(selector = "#img1") {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче