fune/browser/extensions/pdfjs/test/head.js
Ryan VanderMeulen 8354e335b0 Bug 1332170 - Make the pdf.js mochitests pass ESLint and remove them from the whitelist. r=yury
--HG--
extra : rebase_source : aea237747a5869bcab945bdfd3e6b6ecada7be17
2017-01-19 10:11:57 -05:00

15 lines
539 B
JavaScript

function waitForPdfJS(browser, url) {
// Runs tests after all "load" event handlers have fired off
return ContentTask.spawn(browser, url, function* (contentUrl) {
yield new Promise((resolve) => {
// NB: Add the listener to the global object so that we receive the
// event fired from the new window.
addEventListener("documentload", function listener() {
removeEventListener("documentload", listener, false);
resolve();
}, false, true);
content.location = contentUrl;
});
});
}