mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Upgrade Puppeteer to version 23.1.1
This major version contains three breaking changes that impact us: - The `product` option has been renamed to the more suitable `browser`. - The `page.screenshot()` API returns a `Uint8Array` instead of a `Buffer`, but since `pngjs` requires a `Buffer` object we need to do the conversion using `Buffer.from()` before passing data to `pngjs`. - The browser configuration should be set using a configuration file instead of environment variables. Note that as a bonus this allows us to remove the `cross-env` dependency since that was only used to set the Puppeteer environment variable equally for all operating systems. For more information about the changes between the old and new Puppeteer versions refer to https://github.com/puppeteer/puppeteer/releases.
This commit is contained in:
parent
cd99be0aa5
commit
54eead78ab
5 changed files with 46 additions and 51 deletions
|
@ -1675,7 +1675,7 @@ describe("FreeText Editor", () => {
|
|||
clip: rect,
|
||||
type: "png",
|
||||
});
|
||||
const editorImage = PNG.sync.read(editorPng);
|
||||
const editorImage = PNG.sync.read(Buffer.from(editorPng));
|
||||
const editorFirstPix = getFirstPixel(
|
||||
editorImage.data,
|
||||
editorImage.width,
|
||||
|
@ -1703,7 +1703,7 @@ describe("FreeText Editor", () => {
|
|||
clip: rect,
|
||||
type: "png",
|
||||
});
|
||||
const editorImage = PNG.sync.read(editorPng);
|
||||
const editorImage = PNG.sync.read(Buffer.from(editorPng));
|
||||
const editorFirstPix = getFirstPixel(
|
||||
editorImage.data,
|
||||
editorImage.width,
|
||||
|
@ -1836,7 +1836,7 @@ describe("FreeText Editor", () => {
|
|||
clip: rect,
|
||||
type: "png",
|
||||
});
|
||||
const editorImage = PNG.sync.read(editorPng);
|
||||
const editorImage = PNG.sync.read(Buffer.from(editorPng));
|
||||
const editorFirstPix = getFirstPixel(
|
||||
editorImage.data,
|
||||
editorImage.width,
|
||||
|
@ -1870,7 +1870,7 @@ describe("FreeText Editor", () => {
|
|||
clip: rect,
|
||||
type: "png",
|
||||
});
|
||||
const editorImage = PNG.sync.read(editorPng);
|
||||
const editorImage = PNG.sync.read(Buffer.from(editorPng));
|
||||
const editorFirstPix = getFirstPixel(
|
||||
editorImage.data,
|
||||
editorImage.width,
|
||||
|
@ -3589,7 +3589,7 @@ describe("FreeText Editor", () => {
|
|||
"[data-annotation-id='998R']",
|
||||
el => (el.hidden = false)
|
||||
);
|
||||
let editorImage = PNG.sync.read(editorPng);
|
||||
let editorImage = PNG.sync.read(Buffer.from(editorPng));
|
||||
expect(editorImage.data.every(x => x === 0xff))
|
||||
.withContext(`In ${browserName}`)
|
||||
.toBeTrue();
|
||||
|
@ -3636,7 +3636,7 @@ describe("FreeText Editor", () => {
|
|||
clip: editorRect,
|
||||
type: "png",
|
||||
});
|
||||
editorImage = PNG.sync.read(editorPng);
|
||||
editorImage = PNG.sync.read(Buffer.from(editorPng));
|
||||
expect(editorImage.data.every(x => x === 0xff))
|
||||
.withContext(`In ${browserName}`)
|
||||
.toBeFalse();
|
||||
|
|
|
@ -882,7 +882,7 @@ async function startBrowser({
|
|||
extraPrefsFirefox = {},
|
||||
}) {
|
||||
const options = {
|
||||
product: browserName,
|
||||
browser: browserName,
|
||||
protocol: "webDriverBiDi",
|
||||
headless,
|
||||
dumpio: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue