Skip to content

Commit fd07002

Browse files
committed
[WIP] Download required linked PDFs only
1 parent 42caa61 commit fd07002

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
@@ -1030,7 +1030,8 @@
10301030
"type": "eq",
10311031
"link": true,
10321032
"lastPage": 1,
1033-
"about": "The same file as issue2337."
1033+
"about": "The same file as issue2337.",
1034+
"labels": ["integration"]
10341035
},
10351036
{
10361037
"id": "freeculture",
@@ -2083,7 +2084,8 @@
20832084
"rounds": 1,
20842085
"link": true,
20852086
"enableXfa": true,
2086-
"type": "eq"
2087+
"type": "eq",
2088+
"labels": ["integration"]
20872089
},
20882090
{
20892091
"id": "xfa_bug1716380",
@@ -5167,7 +5169,8 @@
51675169
"file": "pdfs/issue13132.pdf",
51685170
"md5": "1b28964b9188047bc6c786302c95029f",
51695171
"link": true,
5170-
"type": "other"
5172+
"type": "other",
5173+
"labels": ["integration"]
51715174
},
51725175
{
51735176
"id": "issue11518",
@@ -8496,7 +8499,8 @@
84968499
"link": true,
84978500
"rounds": 1,
84988501
"type": "eq",
8499-
"forms": true
8502+
"forms": true,
8503+
"labels": ["integration"]
85008504
},
85018505
{
85028506
"id": "issue12233-print",
@@ -9111,7 +9115,8 @@
91119115
"md5": "3ce134ead03d6158c3e8207453dcd21d",
91129116
"rounds": 1,
91139117
"link": true,
9114-
"type": "other"
9118+
"type": "other",
9119+
"labels": ["integration"]
91159120
},
91169121
{
91179122
"id": "issue14301",
@@ -9999,7 +10004,8 @@
999910004
"file": "pdfs/bug1823296.pdf",
1000010005
"md5": "f71e89ebe3d6e75e0c83ce41cd72df1f",
1000110006
"link": true,
10002-
"type": "other"
10007+
"type": "other",
10008+
"labels": ["integration"]
1000310009
},
1000410010
{
1000510011
"id": "bug1942064",
@@ -10443,7 +10449,8 @@
1044310449
"md5": "d2e167216493a50f732b4b3685a91792",
1044410450
"rounds": 1,
1044510451
"link": true,
10446-
"type": "other"
10452+
"type": "other",
10453+
"labels": ["integration"]
1044710454
},
1044810455
{
1044910456
"id": "protected-stamp-editor-save-print",
@@ -10479,7 +10486,8 @@
1047910486
"file": "pdfs/issue16863.pdf",
1048010487
"md5": "af8abe281721f92a0d46646969f061de",
1048110488
"link": true,
10482-
"type": "other"
10489+
"type": "other",
10490+
"labels": ["integration"]
1048310491
},
1048410492
{
1048510493
"id": "bug1851498",
@@ -10513,7 +10521,8 @@
1051310521
"firstPage": 2,
1051410522
"lastPage": 2,
1051510523
"type": "eq",
10516-
"forms": true
10524+
"forms": true,
10525+
"labels": ["integration"]
1051710526
},
1051810527
{
1051910528
"id": "issue17169",

0 commit comments

Comments
 (0)