mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[JS] UserActivation must be enabled before running document actions
else auto-print is broken (it's a regression from patch #15822).
This commit is contained in:
parent
4faf927030
commit
dea2471e96
4 changed files with 31 additions and 0 deletions
|
@ -1753,4 +1753,31 @@ describe("Interaction", () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("in autoprint.pdf", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait("autoprint.pdf", ".endOfContent");
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must check if printing is triggered when the document is open", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.waitForFunction(
|
||||
"window.PDFViewerApplication.scriptingReady === true"
|
||||
);
|
||||
|
||||
await page.waitForFunction(
|
||||
`document.querySelector(".printedPage") !== null`
|
||||
);
|
||||
await page.keyboard.press("Escape");
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -563,3 +563,4 @@
|
|||
!fields_order.pdf
|
||||
!issue15815.pdf
|
||||
!issue15818.pdf
|
||||
!autoprint.pdf
|
||||
|
|
BIN
test/pdfs/autoprint.pdf
Executable file
BIN
test/pdfs/autoprint.pdf
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue