1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #18675 from calixteman/nofirefox

Add an option (i.e. --noFirefox) to only use Chrome when running tests
This commit is contained in:
Tim van der Meij 2024-09-01 15:44:00 +02:00 committed by GitHub
commit 9b541910ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View file

@ -707,6 +707,9 @@ function runTests(testsName, { bot = false, xfaOnly = false } = {}) {
if (process.argv.includes("--noChrome") || forceNoChrome) {
args.push("--noChrome");
}
if (process.argv.includes("--noFirefox")) {
args.push("--noFirefox");
}
if (process.argv.includes("--headless")) {
args.push("--headless");
}
@ -739,6 +742,9 @@ function makeRef(done, bot) {
if (process.argv.includes("--noChrome") || forceNoChrome) {
args.push("--noChrome");
}
if (process.argv.includes("--noFirefox")) {
args.push("--noFirefox");
}
if (process.argv.includes("--headless")) {
args.push("--headless");
}

View file

@ -69,6 +69,11 @@ function parseOptions() {
describe: "Skip Chrome when running tests.",
type: "boolean",
})
.option("noFirefox", {
default: false,
describe: "Skip Firefox when running tests.",
type: "boolean",
})
.option("noDownload", {
default: false,
describe: "Skip downloading of test PDFs.",
@ -968,7 +973,13 @@ async function startBrowsers({ baseUrl, initializeSession }) {
// prevent the disk from filling up over time.
await puppeteer.trimCache();
const browserNames = options.noChrome ? ["firefox"] : ["firefox", "chrome"];
const browserNames = ["firefox", "chrome"];
if (options.noChrome) {
browserNames.splice(1, 1);
}
if (options.noFirefox) {
browserNames.splice(0, 1);
}
for (const browserName of browserNames) {
// The session must be pushed first and augmented with the browser once
// it's initialized. The reason for this is that browser initialization