Remove the xfatest command

The XFA development work has been completed, with mostly regular
maintance/bugfixing remaining, so while this special-casing for the
tests made sense at the time we should now be able to remove it (see also
https://github.com/mozilla/pdf.js/issues/11851#issuecomment-2419790237).
This commit is contained in:
Tim van der Meij 2026-03-15 16:15:43 +01:00
parent ab228da9ce
commit f51419854f
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762
3 changed files with 5 additions and 53 deletions

View File

@ -680,7 +680,7 @@ function getTempFile(prefix, suffix) {
return filePath;
}
function runTests(testsName, { bot = false, xfaOnly = false } = {}) {
function runTests(testsName, { bot = false } = {}) {
return new Promise((resolve, reject) => {
console.log("\n### Running " + testsName + " tests");
@ -696,9 +696,6 @@ function runTests(testsName, { bot = false, xfaOnly = false } = {}) {
// causing a timeout, hence disabling them for now.
forceNoChrome = true;
}
if (xfaOnly) {
args.push("--xfaOnly");
}
args.push("--manifestFile=" + PDF_TEST);
collectArgs(
{
@ -1811,29 +1808,6 @@ gulp.task(
})
);
gulp.task(
"xfatest",
gulp.series(setTestEnv, "generic", "components", async function runXfaTest() {
await runTests("unit");
await runTests("browser", { xfaOnly: true });
await runTests("integration");
})
);
gulp.task(
"botxfatest",
gulp.series(
setTestEnv,
"generic",
"components",
async function runBotXfaTest() {
await runTests("unit", { bot: true });
await runTests("browser", { bot: true, xfaOnly: true });
await runTests("integration");
}
)
);
gulp.task(
"browsertest",
gulp.series(

View File

@ -505,7 +505,6 @@ class Driver {
this.delay = params.get("delay") | 0;
this.inFlightRequests = 0;
this.testFilter = JSON.parse(params.get("testfilter") || "[]");
this.xfaOnly = params.get("xfaonly") === "true";
this.masterMode = params.get("mastermode") === "true";
// Create a working canvas
@ -544,14 +543,11 @@ class Driver {
this._log("done\n");
this.manifest = await response.json();
if (this.testFilter?.length || this.xfaOnly) {
if (this.testFilter?.length) {
this.manifest = this.manifest.filter(item => {
if (this.testFilter.includes(item.id)) {
return true;
}
if (this.xfaOnly && item.enableXfa) {
return true;
}
return false;
});
}

View File

@ -57,7 +57,6 @@ function parseOptions() {
strictVerify: { type: "boolean", default: false },
testfilter: { type: "string", short: "t", multiple: true, default: [] },
unitTest: { type: "boolean", default: false },
xfaOnly: { type: "boolean", default: false },
},
});
@ -83,8 +82,7 @@ function parseOptions() {
" --statsFile File where to store stats.\n" +
" --strictVerify Error if manifest file verification fails.\n" +
" --testfilter, -t Run specific reftest(s), e.g. -t=issue5567.\n" +
" --unitTest Run the unit tests.\n" +
" --xfaOnly Only run the XFA reftest(s)."
" --unitTest Run the unit tests.\n"
);
process.exit(0);
}
@ -97,17 +95,6 @@ function parseOptions() {
"--reftest, --unitTest, --fontTest, and --masterMode must not be specified together."
);
}
if (
+values.unitTest + values.fontTest + values.integration + values.xfaOnly >
1
) {
throw new Error(
"--unitTest, --fontTest, --integration, and --xfaOnly must not be specified together."
);
}
if (values.testfilter.length > 0 && values.xfaOnly) {
throw new Error("--testfilter and --xfaOnly cannot be used together.");
}
if (values.noDownload && values.downloadOnly) {
throw new Error("--noDownload and --downloadOnly cannot be used together.");
}
@ -347,18 +334,14 @@ function handleSessionTimeout(session) {
function getTestManifest() {
var manifest = JSON.parse(fs.readFileSync(options.manifestFile));
const testFilter = options.testfilter.slice(0),
xfaOnly = options.xfaOnly;
if (testFilter.length || xfaOnly) {
const testFilter = options.testfilter.slice(0);
if (testFilter.length) {
manifest = manifest.filter(function (item) {
var i = testFilter.indexOf(item.id);
if (i !== -1) {
testFilter.splice(i, 1);
return true;
}
if (xfaOnly && item.enableXfa) {
return true;
}
return false;
});
if (testFilter.length) {
@ -968,7 +951,6 @@ async function startBrowsers({ baseUrl, initializeSession }) {
`?browser=${encodeURIComponent(browserName)}` +
`&manifestFile=${encodeURIComponent("/test/" + options.manifestFile)}` +
`&testFilter=${JSON.stringify(options.testfilter)}` +
`&xfaOnly=${options.xfaOnly}` +
`&delay=${options.statsDelay}` +
`&masterMode=${options.masterMode}`;
startUrl = baseUrl + queryParameters;