mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1233497 - Avoid unsafe CPOWs in devtools tests. r=jryans
This commit is contained in:
parent
cedcf91446
commit
005a054df5
@ -48,27 +48,24 @@ function selectPreviousNodeWithArrowUp(inspector) {
|
||||
}
|
||||
|
||||
function* selectWithBrowserMenu(inspector) {
|
||||
let contentAreaContextMenu = document.querySelector("#contentAreaContextMenu");
|
||||
let contextOpened = once(contentAreaContextMenu, "popupshown");
|
||||
|
||||
yield BrowserTestUtils.synthesizeMouseAtCenter("div", {
|
||||
type: "contextmenu",
|
||||
button: 2
|
||||
}, gBrowser.selectedBrowser);
|
||||
|
||||
// nsContextMenu also requires the popupNode to be set, but we can't set it to
|
||||
// node under e10s as it's a CPOW, not a DOM node. But under e10s,
|
||||
// nsContextMenu won't use the property anyway, so just try/catching is ok.
|
||||
try {
|
||||
document.popupNode = getNode("div");
|
||||
} catch (e) {}
|
||||
yield contextOpened;
|
||||
|
||||
let contentAreaContextMenu = document.querySelector("#contentAreaContextMenu");
|
||||
let contextMenu = new nsContextMenu(contentAreaContextMenu);
|
||||
yield contextMenu.inspectNode();
|
||||
yield gContextMenu.inspectNode();
|
||||
|
||||
let contextClosed = once(contentAreaContextMenu, "popuphidden");
|
||||
contentAreaContextMenu.hidden = true;
|
||||
contentAreaContextMenu.hidePopup();
|
||||
contextMenu.hiding();
|
||||
|
||||
yield inspector.once("inspector-updated");
|
||||
yield contextClosed;
|
||||
}
|
||||
|
||||
function* selectWithElementPicker(inspector, testActor) {
|
||||
|
@ -117,29 +117,24 @@ function* testBreadcrumbs(selector, inspector) {
|
||||
|
||||
function* clickOnInspectMenuItem(testActor, selector) {
|
||||
info("Showing the contextual menu on node " + selector);
|
||||
let contentAreaContextMenu = document.querySelector("#contentAreaContextMenu");
|
||||
let contextOpened = once(contentAreaContextMenu, "popupshown");
|
||||
|
||||
yield testActor.synthesizeMouse({
|
||||
selector: selector,
|
||||
center: true,
|
||||
options: {type: "contextmenu", button: 2}
|
||||
});
|
||||
|
||||
// nsContextMenu also requires the popupNode to be set, but we can't set it to
|
||||
// node under e10s as it's a CPOW, not a DOM node. But under e10s,
|
||||
// nsContextMenu won't use the property anyway, so just try/catching is ok.
|
||||
try {
|
||||
document.popupNode = content.document.querySelector(selector);
|
||||
} catch (e) {}
|
||||
|
||||
let contentAreaContextMenu = document.querySelector("#contentAreaContextMenu");
|
||||
let contextMenu = new nsContextMenu(contentAreaContextMenu);
|
||||
yield contextOpened;
|
||||
|
||||
info("Triggering inspect action and hiding the menu.");
|
||||
yield contextMenu.inspectNode();
|
||||
yield gContextMenu.inspectNode();
|
||||
|
||||
contentAreaContextMenu.hidden = true;
|
||||
let contextClosed = once(contentAreaContextMenu, "popuphidden");
|
||||
contentAreaContextMenu.hidePopup();
|
||||
contextMenu.hiding();
|
||||
|
||||
info("Waiting for inspector to update.");
|
||||
yield getActiveInspector().once("inspector-updated");
|
||||
yield contextClosed;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user