1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 15:47:57 +02:00

Update puppeteer to version 22.0.0

This is a major version bump that requires two changes on our side:

- The new headless mode is now the default, so we can remove our
  transformation code (see https://github.com/puppeteer/puppeteer/pull/11815).
- The `page.waitForTimeout` API is removed. Sadly we still used it in
  the integration tests (but fortunately much less than before we worked
  on fixing intermittent failures), so until we remove the final
  occurrences we provide an implementation ourselves (see
  https://github.com/puppeteer/puppeteer/pull/11780).

The full changelog can be found here:
https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-core-v22.0.0
This commit is contained in:
Tim van der Meij 2024-02-10 18:21:34 +01:00
parent 4feab0c1fa
commit 28418598e5
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
7 changed files with 72 additions and 60 deletions

View file

@ -18,6 +18,7 @@ import {
getQuerySelector,
getSelector,
loadAndWait,
waitForTimeout,
} from "./test_utils.mjs";
describe("Annotation highlight", () => {
@ -140,7 +141,7 @@ describe("Checkbox annotation", () => {
);
for (const selector of selectors) {
await page.click(selector);
page.waitForTimeout(10);
await waitForTimeout(10);
}
for (const selector of selectors) {
await page.waitForFunction(
@ -199,7 +200,7 @@ describe("Text widget", () => {
pages.map(async ([browserName, page]) => {
await page.type(getSelector("22R"), "a");
await page.keyboard.press("Tab");
await page.waitForTimeout(10);
await waitForTimeout(10);
const text = await page.$eval(getSelector("22R"), el => el.value);
expect(text).withContext(`In ${browserName}`).toEqual("aHello World");
@ -485,12 +486,12 @@ describe("ResetForm action", () => {
`document.querySelector("[data-annotation-id='25R']").hidden === false`
);
await page.click("#editorFreeText");
await page.waitForTimeout(10);
await waitForTimeout(10);
await page.waitForFunction(
`document.querySelector("[data-annotation-id='25R']").hidden === true`
);
await page.click("#editorFreeText");
await page.waitForTimeout(10);
await waitForTimeout(10);
await page.waitForFunction(
`document.querySelector("[data-annotation-id='25R']").hidden === false`
);
@ -553,7 +554,7 @@ describe("ResetForm action", () => {
expect(hidden).withContext(`In ${browserName}`).toEqual(true);
await page.focus("[data-annotation-id='20R']");
await page.keyboard.press("Enter");
await page.waitForTimeout(10);
await waitForTimeout(10);
hidden = await page.$eval(
"[data-annotation-id='21R']",
el => el.hidden
@ -561,7 +562,7 @@ describe("ResetForm action", () => {
expect(hidden).withContext(`In ${browserName}`).toEqual(false);
await page.keyboard.press("Enter");
await page.waitForTimeout(10);
await waitForTimeout(10);
hidden = await page.$eval(
"[data-annotation-id='21R']",
el => el.hidden
@ -569,7 +570,7 @@ describe("ResetForm action", () => {
expect(hidden).withContext(`In ${browserName}`).toEqual(true);
await page.keyboard.press("Enter");
await page.waitForTimeout(10);
await waitForTimeout(10);
hidden = await page.$eval(
"[data-annotation-id='21R']",
el => el.hidden
@ -577,7 +578,7 @@ describe("ResetForm action", () => {
expect(hidden).withContext(`In ${browserName}`).toEqual(false);
await page.keyboard.press("Escape");
await page.waitForTimeout(10);
await waitForTimeout(10);
hidden = await page.$eval(
"[data-annotation-id='21R']",
el => el.hidden