mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #14189 from janekotovich/security_handler
[api-minor] Implement securityHandler in the scripting API (bug 1731578)
This commit is contained in:
commit
74bc6d2625
7 changed files with 32 additions and 1 deletions
|
@ -896,4 +896,26 @@ describe("Interaction", () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("in secHandler.pdf", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait("secHandler.pdf", "#\\32 5R");
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
it("must print securityHandler value in a text field", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
const text = await actAndWaitForInput(page, "#\\32 5R", async () => {
|
||||
await page.click("[data-annotation-id='26R']");
|
||||
});
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("Standard");
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -477,3 +477,4 @@
|
|||
!issue12337.pdf
|
||||
!pr12564.pdf
|
||||
!pr12828.pdf
|
||||
!secHandler.pdf
|
||||
|
|
BIN
test/pdfs/secHandler.pdf
Normal file
BIN
test/pdfs/secHandler.pdf
Normal file
Binary file not shown.
|
@ -1166,6 +1166,7 @@ describe("api", function () {
|
|||
// The following are PDF.js specific, non-standard, properties.
|
||||
expect(info.PDFFormatVersion).toEqual("1.7");
|
||||
expect(info.Language).toEqual("en");
|
||||
expect(info.EncryptFilterName).toEqual(null);
|
||||
expect(info.IsLinearized).toEqual(false);
|
||||
expect(info.IsAcroFormPresent).toEqual(false);
|
||||
expect(info.IsXFAPresent).toEqual(false);
|
||||
|
@ -1201,6 +1202,7 @@ describe("api", function () {
|
|||
// The following are PDF.js specific, non-standard, properties.
|
||||
expect(info.PDFFormatVersion).toEqual("1.4");
|
||||
expect(info.Language).toEqual(null);
|
||||
expect(info.EncryptFilterName).toEqual(null);
|
||||
expect(info.IsLinearized).toEqual(false);
|
||||
expect(info.IsAcroFormPresent).toEqual(false);
|
||||
expect(info.IsXFAPresent).toEqual(false);
|
||||
|
@ -1223,6 +1225,7 @@ describe("api", function () {
|
|||
// The following are PDF.js specific, non-standard, properties.
|
||||
expect(info.PDFFormatVersion).toEqual(null);
|
||||
expect(info.Language).toEqual(null);
|
||||
expect(info.EncryptFilterName).toEqual(null);
|
||||
expect(info.IsLinearized).toEqual(false);
|
||||
expect(info.IsAcroFormPresent).toEqual(false);
|
||||
expect(info.IsXFAPresent).toEqual(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue