From 75a6b2fa13aa6270c4d3d357b8037a12a1a94426 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 30 Mar 2021 13:24:04 +0200 Subject: [PATCH] Improve handling of *linked* test-cases for the unit/integration suites (#13160) - Actually support *linked* test-cases in the integration-tests (in the same way as the unit-tests). - Add a new `"type": "other"`-kind to the test-manifest, to support *linked* test-cases in the unit/integration-tests without requiring the PDF document in question to also be a reference-test. --- test/driver.js | 14 ++++++++++++++ test/test.js | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/test/driver.js b/test/driver.js index 717b6caaa..a83f64218 100644 --- a/test/driver.js +++ b/test/driver.js @@ -392,6 +392,20 @@ var Driver = (function DriverClosure() { task.pageNum = task.firstPage || 1; task.stats = { times: [] }; + // Support *linked* test-cases for the other suites, e.g. unit- and + // integration-tests, without needing to run them as reference-tests. + if (task.type === "other") { + this._log(`Skipping file "${task.file}"\n`); + + if (!task.link) { + this._nextPage(task, 'Expected "other" test-case to be linked.'); + return; + } + this.currentTask++; + this._nextTask(); + return; + } + this._log('Loading file "' + task.file + '"\n'); const absoluteUrl = new URL(task.file, window.location).href; diff --git a/test/test.js b/test/test.js index 957ceb69d..3321e6fec 100644 --- a/test/test.js +++ b/test/test.js @@ -1000,7 +1000,10 @@ function main() { } else if (options.fontTest) { startUnitTest("/test/font/font_test.html", "font"); } else if (options.integration) { - startIntegrationTest(); + // Allows linked PDF files in integration-tests as well. + ensurePDFsDownloaded(function () { + startIntegrationTest(); + }); } else { startRefTest(options.masterMode, options.reftest); }