Bug 1598305, replace frame script in test browser_findbar.js with SpecialPowers.spawn, r=mikedeboer

Differential Revision: https://phabricator.services.mozilla.com/D61912

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Neil Deakin 2020-02-19 22:28:36 +00:00
Родитель 07a98b6fa0
Коммит 3a51183ffc
1 изменённых файлов: 8 добавлений и 9 удалений

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

@ -39,16 +39,15 @@ add_task(async function test_hotkey_event_propagation() {
}
// Stop propagation for all keyboard events.
let frameScript = () => {
const stopPropagation = e => e.stopImmediatePropagation();
await SpecialPowers.spawn(browser, [], () => {
const stopPropagation = e => {
e.stopImmediatePropagation();
};
let window = content.document.defaultView;
window.removeEventListener("keydown", stopPropagation);
window.removeEventListener("keypress", stopPropagation);
window.removeEventListener("keyup", stopPropagation);
};
let mm = browser.messageManager;
mm.loadFrameScript("data:,(" + frameScript.toString() + ")();", false);
window.addEventListener("keydown", stopPropagation);
window.addEventListener("keypress", stopPropagation);
window.addEventListener("keyup", stopPropagation);
});
// Checking if findbar still appears when any hotkey is pressed.
for (let key of HOTKEYS) {