Skip to content

Commit 8d46a75

Browse files
committed
[WIP] Download required linked PDFs only
1 parent b4f8166 commit 8d46a75

File tree

8 files changed

+27
-22
lines changed

8 files changed

+27
-22
lines changed

test/integration/annotation_spec.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ describe("Checkbox annotation", () => {
169169
let pages;
170170

171171
beforeEach(async () => {
172-
pending("Linked PDFs are not supported.");
173172
pages = await loadAndWait("bug1847733.pdf", getAnnotationSelector("18R"));
174173
});
175174

test/integration/autolinker_spec.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ describe("autolinker", function () {
219219
let pages;
220220

221221
beforeEach(async () => {
222-
pending("Linked PDFs are not supported.");
223222
pages = await loadAndWait(
224223
"issue3115r.pdf",
225224
".annotationLayer",

test/integration/find_spec.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ describe("find bar", () => {
9090
let pages;
9191

9292
beforeEach(async () => {
93-
pending("Linked PDFs are not supported.");
9493
pages = await loadAndWait("xfa_imm5257e.pdf", ".xfaLayer");
9594
});
9695

test/integration/freetext_editor_spec.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,6 @@ describe("FreeText Editor", () => {
23912391
let pages;
23922392

23932393
beforeEach(async () => {
2394-
pending("Linked PDFs are not supported.");
23952394
pages = await loadAndWait("bug1823296.pdf", ".annotationEditorLayer");
23962395
});
23972396

test/integration/highlight_editor_spec.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ describe("Highlight Editor", () => {
800800
let pages;
801801

802802
beforeEach(async () => {
803-
pending("Linked PDFs are not supported.");
804803
pages = await loadAndWait(
805804
"issue12233.pdf",
806805
".annotationEditorLayer",

test/integration/scripting_spec.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,6 @@ describe("Interaction", () => {
813813
let pages;
814814

815815
beforeEach(async () => {
816-
pending("Linked PDFs are not supported.");
817816
pages = await loadAndWait("issue13132.pdf", getSelector("171R"));
818817
});
819818

@@ -1277,7 +1276,6 @@ describe("Interaction", () => {
12771276
let pages;
12781277

12791278
beforeEach(async () => {
1280-
pending("Linked PDFs are not supported.");
12811279
pages = await loadAndWait("bug1766987.pdf", getSelector("75R"));
12821280
});
12831281

@@ -1985,7 +1983,6 @@ describe("Interaction", () => {
19851983
let pages;
19861984

19871985
beforeEach(async () => {
1988-
pending("Linked PDFs are not supported.");
19891986
pages = await loadAndWait("issue16863.pdf", getSelector("334R"));
19901987
});
19911988

@@ -2125,7 +2122,6 @@ describe("Interaction", () => {
21252122
let pages;
21262123

21272124
beforeEach(async () => {
2128-
pending("Linked PDFs are not supported.");
21292125
pages = await loadAndWait("bug1860602.pdf", getSelector("22R"));
21302126
});
21312127

test/test.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,18 +410,21 @@ function handleSessionTimeout(session) {
410410
closeSession(browser);
411411
}
412412

413-
function getTestManifest() {
413+
function getTestManifest(label = null) {
414414
var manifest = JSON.parse(fs.readFileSync(options.manifestFile));
415415

416416
const testFilter = options.testfilter.slice(0),
417417
xfaOnly = options.xfaOnly;
418-
if (testFilter.length || xfaOnly) {
418+
if (label || testFilter.length || xfaOnly) {
419419
manifest = manifest.filter(function (item) {
420420
var i = testFilter.indexOf(item.id);
421421
if (i !== -1) {
422422
testFilter.splice(i, 1);
423423
return true;
424424
}
425+
if (label && item.labels?.includes(label)) {
426+
return true;
427+
}
425428
if (xfaOnly && item.enableXfa) {
426429
return true;
427430
}
@@ -1089,8 +1092,8 @@ async function closeSession(browser) {
10891092
}
10901093
}
10911094

1092-
async function ensurePDFsDownloaded() {
1093-
const manifest = getTestManifest();
1095+
async function ensurePDFsDownloaded(label = null) {
1096+
const manifest = getTestManifest(label);
10941097
await downloadManifestFiles(manifest);
10951098
try {
10961099
await verifyManifestFiles(manifest);
@@ -1124,6 +1127,8 @@ async function main() {
11241127
} else if (options.fontTest) {
11251128
await startUnitTest("/test/font/font_test.html", "font");
11261129
} else if (options.integration) {
1130+
// Allows linked PDF files in integration-tests as well.
1131+
await ensurePDFsDownloaded("integration");
11271132
await startIntegrationTest();
11281133
} else {
11291134
await startRefTest(options.masterMode, options.reftest);

test/test_manifest.json

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,8 @@
10281028
"type": "eq",
10291029
"link": true,
10301030
"lastPage": 1,
1031-
"about": "The same file as issue2337."
1031+
"about": "The same file as issue2337.",
1032+
"labels": ["integration"]
10321033
},
10331034
{
10341035
"id": "freeculture",
@@ -2081,7 +2082,8 @@
20812082
"rounds": 1,
20822083
"link": true,
20832084
"enableXfa": true,
2084-
"type": "eq"
2085+
"type": "eq",
2086+
"labels": ["integration"]
20852087
},
20862088
{
20872089
"id": "xfa_bug1716380",
@@ -5151,7 +5153,8 @@
51515153
"file": "pdfs/issue13132.pdf",
51525154
"md5": "1b28964b9188047bc6c786302c95029f",
51535155
"link": true,
5154-
"type": "other"
5156+
"type": "other",
5157+
"labels": ["integration"]
51555158
},
51565159
{
51575160
"id": "issue11518",
@@ -8480,7 +8483,8 @@
84808483
"link": true,
84818484
"rounds": 1,
84828485
"type": "eq",
8483-
"forms": true
8486+
"forms": true,
8487+
"labels": ["integration"]
84848488
},
84858489
{
84868490
"id": "issue12233-print",
@@ -9095,7 +9099,8 @@
90959099
"md5": "3ce134ead03d6158c3e8207453dcd21d",
90969100
"rounds": 1,
90979101
"link": true,
9098-
"type": "other"
9102+
"type": "other",
9103+
"labels": ["integration"]
90999104
},
91009105
{
91019106
"id": "issue14301",
@@ -9983,7 +9988,8 @@
99839988
"file": "pdfs/bug1823296.pdf",
99849989
"md5": "f71e89ebe3d6e75e0c83ce41cd72df1f",
99859990
"link": true,
9986-
"type": "other"
9991+
"type": "other",
9992+
"labels": ["integration"]
99879993
},
99889994
{
99899995
"id": "bug1942064",
@@ -10427,7 +10433,8 @@
1042710433
"md5": "d2e167216493a50f732b4b3685a91792",
1042810434
"rounds": 1,
1042910435
"link": true,
10430-
"type": "other"
10436+
"type": "other",
10437+
"labels": ["integration"]
1043110438
},
1043210439
{
1043310440
"id": "protected-stamp-editor-save-print",
@@ -10463,7 +10470,8 @@
1046310470
"file": "pdfs/issue16863.pdf",
1046410471
"md5": "af8abe281721f92a0d46646969f061de",
1046510472
"link": true,
10466-
"type": "other"
10473+
"type": "other",
10474+
"labels": ["integration"]
1046710475
},
1046810476
{
1046910477
"id": "bug1851498",
@@ -10497,7 +10505,8 @@
1049710505
"firstPage": 2,
1049810506
"lastPage": 2,
1049910507
"type": "eq",
10500-
"forms": true
10508+
"forms": true,
10509+
"labels": ["integration"]
1050110510
},
1050210511
{
1050310512
"id": "issue17169",

0 commit comments

Comments
 (0)