[WIP] Download required linked PDFs only

This commit is contained in:
Tim van der Meij 2025-11-02 18:38:58 +01:00
parent 4d9d770806
commit ec6e27de0f
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762
8 changed files with 27 additions and 22 deletions

View File

@ -169,7 +169,6 @@ describe("Checkbox annotation", () => {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait("bug1847733.pdf", getAnnotationSelector("18R")); pages = await loadAndWait("bug1847733.pdf", getAnnotationSelector("18R"));
}); });

View File

@ -219,7 +219,6 @@ describe("autolinker", function () {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait( pages = await loadAndWait(
"issue3115r.pdf", "issue3115r.pdf",
".annotationLayer", ".annotationLayer",

View File

@ -90,7 +90,6 @@ describe("find bar", () => {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait("xfa_imm5257e.pdf", ".xfaLayer"); pages = await loadAndWait("xfa_imm5257e.pdf", ".xfaLayer");
}); });

View File

@ -2391,7 +2391,6 @@ describe("FreeText Editor", () => {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait("bug1823296.pdf", ".annotationEditorLayer"); pages = await loadAndWait("bug1823296.pdf", ".annotationEditorLayer");
}); });

View File

@ -800,7 +800,6 @@ describe("Highlight Editor", () => {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait( pages = await loadAndWait(
"issue12233.pdf", "issue12233.pdf",
".annotationEditorLayer", ".annotationEditorLayer",

View File

@ -813,7 +813,6 @@ describe("Interaction", () => {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait("issue13132.pdf", getSelector("171R")); pages = await loadAndWait("issue13132.pdf", getSelector("171R"));
}); });
@ -1277,7 +1276,6 @@ describe("Interaction", () => {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait("bug1766987.pdf", getSelector("75R")); pages = await loadAndWait("bug1766987.pdf", getSelector("75R"));
}); });
@ -1985,7 +1983,6 @@ describe("Interaction", () => {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait("issue16863.pdf", getSelector("334R")); pages = await loadAndWait("issue16863.pdf", getSelector("334R"));
}); });
@ -2125,7 +2122,6 @@ describe("Interaction", () => {
let pages; let pages;
beforeEach(async () => { beforeEach(async () => {
pending("Linked PDFs are not supported.");
pages = await loadAndWait("bug1860602.pdf", getSelector("22R")); pages = await loadAndWait("bug1860602.pdf", getSelector("22R"));
}); });

View File

@ -410,18 +410,21 @@ function handleSessionTimeout(session) {
closeSession(browser); closeSession(browser);
} }
function getTestManifest() { function getTestManifest(label = null) {
var manifest = JSON.parse(fs.readFileSync(options.manifestFile)); var manifest = JSON.parse(fs.readFileSync(options.manifestFile));
const testFilter = options.testfilter.slice(0), const testFilter = options.testfilter.slice(0),
xfaOnly = options.xfaOnly; xfaOnly = options.xfaOnly;
if (testFilter.length || xfaOnly) { if (label || testFilter.length || xfaOnly) {
manifest = manifest.filter(function (item) { manifest = manifest.filter(function (item) {
var i = testFilter.indexOf(item.id); var i = testFilter.indexOf(item.id);
if (i !== -1) { if (i !== -1) {
testFilter.splice(i, 1); testFilter.splice(i, 1);
return true; return true;
} }
if (label && item.labels?.includes(label)) {
return true;
}
if (xfaOnly && item.enableXfa) { if (xfaOnly && item.enableXfa) {
return true; return true;
} }
@ -1089,8 +1092,8 @@ async function closeSession(browser) {
} }
} }
async function ensurePDFsDownloaded() { async function ensurePDFsDownloaded(label = null) {
const manifest = getTestManifest(); const manifest = getTestManifest(label);
await downloadManifestFiles(manifest); await downloadManifestFiles(manifest);
try { try {
await verifyManifestFiles(manifest); await verifyManifestFiles(manifest);
@ -1124,6 +1127,8 @@ async function main() {
} else if (options.fontTest) { } else if (options.fontTest) {
await startUnitTest("/test/font/font_test.html", "font"); await startUnitTest("/test/font/font_test.html", "font");
} else if (options.integration) { } else if (options.integration) {
// Allows linked PDF files in integration-tests as well.
await ensurePDFsDownloaded("integration");
await startIntegrationTest(); await startIntegrationTest();
} else { } else {
await startRefTest(options.masterMode, options.reftest); await startRefTest(options.masterMode, options.reftest);

View File

@ -1028,7 +1028,8 @@
"type": "eq", "type": "eq",
"link": true, "link": true,
"lastPage": 1, "lastPage": 1,
"about": "The same file as issue2337." "about": "The same file as issue2337.",
"labels": ["integration"]
}, },
{ {
"id": "freeculture", "id": "freeculture",
@ -2081,7 +2082,8 @@
"rounds": 1, "rounds": 1,
"link": true, "link": true,
"enableXfa": true, "enableXfa": true,
"type": "eq" "type": "eq",
"labels": ["integration"]
}, },
{ {
"id": "xfa_bug1716380", "id": "xfa_bug1716380",
@ -5151,7 +5153,8 @@
"file": "pdfs/issue13132.pdf", "file": "pdfs/issue13132.pdf",
"md5": "1b28964b9188047bc6c786302c95029f", "md5": "1b28964b9188047bc6c786302c95029f",
"link": true, "link": true,
"type": "other" "type": "other",
"labels": ["integration"]
}, },
{ {
"id": "issue11518", "id": "issue11518",
@ -8480,7 +8483,8 @@
"link": true, "link": true,
"rounds": 1, "rounds": 1,
"type": "eq", "type": "eq",
"forms": true "forms": true,
"labels": ["integration"]
}, },
{ {
"id": "issue12233-print", "id": "issue12233-print",
@ -9095,7 +9099,8 @@
"md5": "3ce134ead03d6158c3e8207453dcd21d", "md5": "3ce134ead03d6158c3e8207453dcd21d",
"rounds": 1, "rounds": 1,
"link": true, "link": true,
"type": "other" "type": "other",
"labels": ["integration"]
}, },
{ {
"id": "issue14301", "id": "issue14301",
@ -9983,7 +9988,8 @@
"file": "pdfs/bug1823296.pdf", "file": "pdfs/bug1823296.pdf",
"md5": "f71e89ebe3d6e75e0c83ce41cd72df1f", "md5": "f71e89ebe3d6e75e0c83ce41cd72df1f",
"link": true, "link": true,
"type": "other" "type": "other",
"labels": ["integration"]
}, },
{ {
"id": "bug1942064", "id": "bug1942064",
@ -10427,7 +10433,8 @@
"md5": "d2e167216493a50f732b4b3685a91792", "md5": "d2e167216493a50f732b4b3685a91792",
"rounds": 1, "rounds": 1,
"link": true, "link": true,
"type": "other" "type": "other",
"labels": ["integration"]
}, },
{ {
"id": "protected-stamp-editor-save-print", "id": "protected-stamp-editor-save-print",
@ -10463,7 +10470,8 @@
"file": "pdfs/issue16863.pdf", "file": "pdfs/issue16863.pdf",
"md5": "af8abe281721f92a0d46646969f061de", "md5": "af8abe281721f92a0d46646969f061de",
"link": true, "link": true,
"type": "other" "type": "other",
"labels": ["integration"]
}, },
{ {
"id": "bug1851498", "id": "bug1851498",
@ -10497,7 +10505,8 @@
"firstPage": 2, "firstPage": 2,
"lastPage": 2, "lastPage": 2,
"type": "eq", "type": "eq",
"forms": true "forms": true,
"labels": ["integration"]
}, },
{ {
"id": "issue17169", "id": "issue17169",