Skip to content

Commit

Permalink
Bug 1622093 - Fix print reftests. r=dholbert
Browse files Browse the repository at this point in the history
These have been broken for a while, because we don't run them on automation...

The way we import PDFJS in reftest.jsm was broken. And PDFJS updates caused
breakage.

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information
emilio committed Mar 16, 2020
1 parent 9203594 commit 14521d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions layout/tools/reftest/reftest.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ XPCOMUtils.defineLazyGetter(this, "OS", function() {
});

XPCOMUtils.defineLazyGetter(this, "PDFJS", function() {
const { require } = Cu.import("resource://gre/modules/commonjs/toolkit/require.js", {});
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
return {
main: require('resource://pdf.js/build/pdf.js'),
worker: require('resource://pdf.js/build/pdf.worker.js')
Expand Down Expand Up @@ -1765,10 +1765,11 @@ function readPdf(path, callback) {
let fakePort = new PDFJS.main.LoopbackPort(true);
PDFJS.worker.WorkerMessageHandler.initializeFromPort(fakePort);
let myWorker = new PDFJS.main.PDFWorker("worker", fakePort);
PDFJS.main.PDFJS.getDocument({
PDFJS.main.GlobalWorkerOptions.workerSrc = "resource://pdf.js/build/pdf.worker.js";
PDFJS.main.getDocument({
worker: myWorker,
data: data
}).then(function (pdf) {
}).promise.then(function (pdf) {
callback(null, pdf);
}, function () {
callback(new Error("Couldn't parse " + path));
Expand Down

0 comments on commit 14521d0

Please sign in to comment.