From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- browser/extensions/pdfjs/test/head.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 browser/extensions/pdfjs/test/head.js (limited to 'browser/extensions/pdfjs/test/head.js') diff --git a/browser/extensions/pdfjs/test/head.js b/browser/extensions/pdfjs/test/head.js new file mode 100644 index 000000000..d980bceb1 --- /dev/null +++ b/browser/extensions/pdfjs/test/head.js @@ -0,0 +1,15 @@ +function waitForPdfJS(browser, url) { + // Runs tests after all 'load' event handlers have fired off + return ContentTask.spawn(browser, url, function* (url) { + 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 = url; + }); + }); +} -- cgit v1.2.3