summaryrefslogtreecommitdiffstats
path: root/browser/extensions/pdfjs/test/head.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/extensions/pdfjs/test/head.js')
-rw-r--r--browser/extensions/pdfjs/test/head.js15
1 files changed, 15 insertions, 0 deletions
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;
+ });
+ });
+}