Skip to content

Commit 2f7d163

Browse files
authoredApr 13, 2025··
Merge pull request #19812 from timvandermeij/disable-permafail
Remove debug code from the integration tests, and skip the "must check that canvas perfectly fits the page whatever the zoom level" integration test in Chrome
2 parents 35f85c5 + 923753a commit 2f7d163

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed
 

‎test/integration/stamp_editor_spec.mjs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1388,15 +1388,10 @@ describe("Stamp Editor", () => {
13881388

13891389
await Promise.all(
13901390
pages.map(async ([browserName, page]) => {
1391-
const debug = false;
1392-
13931391
await page.click("#secondaryToolbarToggleButton");
13941392
await page.waitForSelector("#secondaryToolbar", { visible: true });
13951393
const secondary = await page.$("#secondaryToolbar");
1396-
const png = await secondary.screenshot({
1397-
type: "png",
1398-
path: debug ? `foo.png` : "",
1399-
});
1394+
const png = await secondary.screenshot({ type: "png" });
14001395
const secondaryImage = PNG.sync.read(Buffer.from(png));
14011396
const buffer = new Uint32Array(secondaryImage.data.buffer);
14021397
expect(buffer.every(x => x === 0xff0000ff))

‎test/integration/viewer_spec.mjs

+8-5
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,13 @@ describe("PDF viewer", () => {
400400
it("must check that canvas perfectly fits the page whatever the zoom level is", async () => {
401401
await Promise.all(
402402
pages.map(async ([browserName, page]) => {
403-
const debug = false;
403+
if (browserName === "chrome") {
404+
// Skip the test for Chrome as `scrollIntoView` below hangs since
405+
// Puppeteer 24.5.0 and higher.
406+
// See https://github.com/mozilla/pdf.js/issues/19811.
407+
// TODO: Remove this check once the issue is fixed.
408+
return;
409+
}
404410

405411
// The pdf has a single page with a red background.
406412
// We set the viewer background to red, because when screenshoting
@@ -426,10 +432,7 @@ describe("PDF viewer", () => {
426432
await scrollIntoView(page, `.page[data-page-number="1"]`);
427433

428434
const element = await page.$(`.page[data-page-number="1"]`);
429-
const png = await element.screenshot({
430-
type: "png",
431-
path: debug ? `foo${i}.png` : "",
432-
});
435+
const png = await element.screenshot({ type: "png" });
433436
const pageImage = PNG.sync.read(Buffer.from(png));
434437
let buffer = new Uint32Array(pageImage.data.buffer);
435438

0 commit comments

Comments
 (0)
Please sign in to comment.