1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Set a print listener as soon as possible in the autoprint integration test

This test intermittently fails, likely because the auto-print is triggered fast enough
that we don't manage to get it.
So this patch aims to try to set a listener very early in order to be sure that
we'll be aware that a print has been triggered.
This commit is contained in:
Calixte Denizet 2023-12-09 15:00:11 +01:00
parent 553729869b
commit 82be74d036
2 changed files with 41 additions and 8 deletions

View file

@ -46,9 +46,11 @@ function loadAndWait(filename, selector, zoom, pageSetup) {
}
await page.bringToFront();
await page.waitForSelector(selector, {
timeout: 0,
});
if (selector) {
await page.waitForSelector(selector, {
timeout: 0,
});
}
return [session.name, page];
})
);