Skip to content

Commit de4fc1a

Browse files
committed
[WIP] Download required linked PDFs only
1 parent ec4a8ec commit de4fc1a

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
@@ -2381,7 +2381,6 @@ describe("FreeText Editor", () => {
23812381
let pages;
23822382

23832383
beforeEach(async () => {
2384-
pending("Linked PDFs are not supported.");
23852384
pages = await loadAndWait("bug1823296.pdf", ".annotationEditorLayer");
23862385
});
23872386

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
}
@@ -1084,8 +1087,8 @@ async function closeSession(browser) {
10841087
}
10851088
}
10861089

1087-
async function ensurePDFsDownloaded() {
1088-
const manifest = getTestManifest();
1090+
async function ensurePDFsDownloaded(label = null) {
1091+
const manifest = getTestManifest(label);
10891092
await downloadManifestFiles(manifest);
10901093
try {
10911094
await verifyManifestFiles(manifest);
@@ -1119,6 +1122,8 @@ async function main() {
11191122
} else if (options.fontTest) {
11201123
await startUnitTest("/test/font/font_test.html", "font");
11211124
} else if (options.integration) {
1125+
// Allows linked PDF files in integration-tests as well.
1126+
await ensurePDFsDownloaded("integration");
11221127
await startIntegrationTest();
11231128
} else {
11241129
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",
@@ -2073,7 +2074,8 @@
20732074
"rounds": 1,
20742075
"link": true,
20752076
"enableXfa": true,
2076-
"type": "eq"
2077+
"type": "eq",
2078+
"labels": ["integration"]
20772079
},
20782080
{
20792081
"id": "xfa_bug1716380",
@@ -5143,7 +5145,8 @@
51435145
"file": "pdfs/issue13132.pdf",
51445146
"md5": "1b28964b9188047bc6c786302c95029f",
51455147
"link": true,
5146-
"type": "other"
5148+
"type": "other",
5149+
"labels": ["integration"]
51475150
},
51485151
{
51495152
"id": "issue11518",
@@ -8472,7 +8475,8 @@
84728475
"link": true,
84738476
"rounds": 1,
84748477
"type": "eq",
8475-
"forms": true
8478+
"forms": true,
8479+
"labels": ["integration"]
84768480
},
84778481
{
84788482
"id": "issue12233-print",
@@ -9087,7 +9091,8 @@
90879091
"md5": "3ce134ead03d6158c3e8207453dcd21d",
90889092
"rounds": 1,
90899093
"link": true,
9090-
"type": "other"
9094+
"type": "other",
9095+
"labels": ["integration"]
90919096
},
90929097
{
90939098
"id": "issue14301",
@@ -9975,7 +9980,8 @@
99759980
"file": "pdfs/bug1823296.pdf",
99769981
"md5": "f71e89ebe3d6e75e0c83ce41cd72df1f",
99779982
"link": true,
9978-
"type": "other"
9983+
"type": "other",
9984+
"labels": ["integration"]
99799985
},
99809986
{
99819987
"id": "bug1942064",
@@ -10419,7 +10425,8 @@
1041910425
"md5": "d2e167216493a50f732b4b3685a91792",
1042010426
"rounds": 1,
1042110427
"link": true,
10422-
"type": "other"
10428+
"type": "other",
10429+
"labels": ["integration"]
1042310430
},
1042410431
{
1042510432
"id": "protected-stamp-editor-save-print",
@@ -10455,7 +10462,8 @@
1045510462
"file": "pdfs/issue16863.pdf",
1045610463
"md5": "af8abe281721f92a0d46646969f061de",
1045710464
"link": true,
10458-
"type": "other"
10465+
"type": "other",
10466+
"labels": ["integration"]
1045910467
},
1046010468
{
1046110469
"id": "bug1851498",
@@ -10489,7 +10497,8 @@
1048910497
"firstPage": 2,
1049010498
"lastPage": 2,
1049110499
"type": "eq",
10492-
"forms": true
10500+
"forms": true,
10501+
"labels": ["integration"]
1049310502
},
1049410503
{
1049510504
"id": "issue17169",

0 commit comments

Comments
 (0)