mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Annotation] Send correctly the updated values to the JS sandbox
This commit is contained in:
parent
ff9d21ff0e
commit
20fd9099f8
4 changed files with 65 additions and 5 deletions
|
@ -1598,4 +1598,57 @@ describe("Interaction", () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("in issue15753.pdf", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait("issue15753.pdf", getSelector("27R"));
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must check field value is correctly updated when committed with ENTER key", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.waitForFunction(
|
||||
"window.PDFViewerApplication.scriptingReady === true"
|
||||
);
|
||||
|
||||
await page.type(getSelector("27R"), "abc", {
|
||||
delay: 10,
|
||||
});
|
||||
await page.keyboard.press("Enter");
|
||||
await page.waitForFunction(`${getQuerySelector("28R")}.value !== ""`);
|
||||
let value = await page.$eval(getSelector("28R"), el => el.value);
|
||||
expect(value).withContext(`In ${browserName}`).toEqual("abc");
|
||||
|
||||
await page.type(getSelector("27R"), "def", {
|
||||
delay: 10,
|
||||
});
|
||||
|
||||
await page.keyboard.press("Enter");
|
||||
await page.waitForFunction(
|
||||
`${getQuerySelector("28R")}.value !== "abc"`
|
||||
);
|
||||
value = await page.$eval(getSelector("28R"), el => el.value);
|
||||
expect(value).withContext(`In ${browserName}`).toEqual("abcdef");
|
||||
|
||||
await page.keyboard.down("Control");
|
||||
await page.keyboard.press("A");
|
||||
await page.keyboard.up("Control");
|
||||
await page.keyboard.press("Backspace");
|
||||
|
||||
await page.keyboard.press("Enter");
|
||||
await page.waitForFunction(
|
||||
`${getQuerySelector("28R")}.value !== "abcdef"`
|
||||
);
|
||||
value = await page.$eval(getSelector("28R"), el => el.value);
|
||||
expect(value).withContext(`In ${browserName}`).toEqual("");
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -558,3 +558,4 @@
|
|||
!issue15690.pdf
|
||||
!bug1802888.pdf
|
||||
!issue15759.pdf
|
||||
!issue15753.pdf
|
||||
|
|
BIN
test/pdfs/issue15753.pdf
Executable file
BIN
test/pdfs/issue15753.pdf
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue