1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #17966 from timvandermeij/waitForTimeout

Remove `waitForTimeout` usage from the helper functions
This commit is contained in:
Tim van der Meij 2024-04-18 17:51:34 +02:00 committed by GitHub
commit aaa55d2b38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -115,8 +115,9 @@ async function clearInput(page, selector) {
await page.click(selector);
await kbSelectAll(page);
await page.keyboard.press("Backspace");
// eslint-disable-next-line no-restricted-syntax
await waitForTimeout(10);
await page.waitForFunction(
`document.querySelector('${selector}').value === ""`
);
}
function getSelector(id) {
@ -354,8 +355,6 @@ async function serializeBitmapDimensions(page) {
async function dragAndDropAnnotation(page, startX, startY, tX, tY) {
await page.mouse.move(startX, startY);
await page.mouse.down();
// eslint-disable-next-line no-restricted-syntax
await waitForTimeout(10);
await page.mouse.move(startX + tX, startY + tY);
await page.mouse.up();
await page.waitForSelector("#viewer:not(.noUserSelect)");