Skip to content
Snippets Groups Projects
Commit ad2cbd92 authored by Neil Deakin's avatar Neil Deakin
Browse files

Bug 1266952, remove cpow usage from browser_contextmenu_childprocess.js, r=felipe

parent 463cd06d
No related branches found
No related tags found
No related merge requests found
......@@ -4,26 +4,23 @@
const gBaseURL = "https://example.com/browser/browser/base/content/test/general/";
add_task(function *() {
let tab = gBrowser.addTab();
let browser = gBrowser.getBrowserForTab(tab);
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, gBaseURL + "subtst_contextmenu.html");
gBrowser.selectedTab = tab;
yield promiseTabLoadEvent(tab, gBaseURL + "subtst_contextmenu.html");
let popupShownPromise = promiseWaitForEvent(window, "popupshown", true);
let contextMenu = document.getElementById("contentAreaContextMenu");
// Get the point of the element with the page menu (test-pagemenu) and
// synthesize a right mouse click there.
let eventDetails = { type : "contextmenu", button : 2 };
let rect = browser.contentWindow.document.getElementById("test-pagemenu").getBoundingClientRect();
EventUtils.synthesizeMouse(browser, rect.x + rect.width / 2, rect.y + rect.height / 2, eventDetails, window);
let popupShownPromise = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
yield BrowserTestUtils.synthesizeMouse("#test-pagemenu", 5, 5, { type : "contextmenu", button : 2 }, tab.linkedBrowser);
let event = yield popupShownPromise;
let contextMenu = document.getElementById("contentAreaContextMenu");
checkMenu(contextMenu);
let popupHiddenPromise = BrowserTestUtils.waitForEvent(contextMenu, "popuphidden");
contextMenu.hidePopup();
gBrowser.removeCurrentTab();
yield popupHiddenPromise;
yield BrowserTestUtils.removeTab(tab);
});
function checkItems(menuitem, arr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment