From 890d5c2e57cdee7d73915a878bda86b72e26b608 Mon Sep 17 00:00:00 2001 From: Maksim Sadym <69349599+sadym-chromium@users.noreply.github.com> Date: Tue, 2 Feb 2021 17:24:10 +0100 Subject: [PATCH] feat(chromium): roll Chromium to r848005 (#6801) This corresponds to Chromium 90.0.4403.0 This roll includes: - Cut screenshot by ViewPort size, not position (crrev.com/c/2643792) BREAKING CHANGE: - `page.screenshot` cuts screenshot content by the ViewPort size, not ViewPort position. --- package.json | 2 +- src/revisions.ts | 2 +- .../screenshot-offscreen-clip-artefacts.png | Bin 0 -> 194 bytes .../screenshot-offscreen-clip.png | Bin 326 -> 161 bytes .../screenshot-offscreen-clip-artefacts.png | Bin 0 -> 279 bytes .../screenshot-offscreen-clip.png | Bin 326 -> 279 bytes test/screenshot.spec.ts | 32 +++++++++++++++--- versions.js | 1 + 8 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 test/golden-chromium/screenshot-offscreen-clip-artefacts.png create mode 100644 test/golden-firefox/screenshot-offscreen-clip-artefacts.png diff --git a/package.json b/package.json index 3bbaf44d..6874e095 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "license": "Apache-2.0", "dependencies": { "debug": "^4.1.0", - "devtools-protocol": "0.0.842839", + "devtools-protocol": "0.0.847576", "extract-zip": "^2.0.0", "https-proxy-agent": "^5.0.0", "node-fetch": "^2.6.1", diff --git a/src/revisions.ts b/src/revisions.ts index eaeb33a1..6a524c70 100644 --- a/src/revisions.ts +++ b/src/revisions.ts @@ -20,6 +20,6 @@ type Revisions = Readonly<{ }>; export const PUPPETEER_REVISIONS: Revisions = { - chromium: '843427', + chromium: '848005', firefox: 'latest', }; diff --git a/test/golden-chromium/screenshot-offscreen-clip-artefacts.png b/test/golden-chromium/screenshot-offscreen-clip-artefacts.png new file mode 100644 index 0000000000000000000000000000000000000000..c41be2be1e7fa3c00975328be5f0f9864a773d60 GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^DImna**Z)9p{>=X~XEtrxw0iaG zl`B_Hn>NkU(^F4RPf1BhOiT=@@Y3b-79bVr>EaktaqI2rjl2y8JPeNO4{(VoWVtzh zGRZl}X28Vy`J$k?rp_d#Q}Oji_kJ1rZ+fOZ)pxSzrfJGC-%MlVc*U0nXuK6Kel_*r n!T^nCc+q$DOL z22{ewG3gDEvh#Ft45_&F_Vh;10}28R4&fC-m(thtOca!HEJ!$b=$3x#?tiDQCTUi` vo27StzTW-WdbXETMO-cS1NAaoX85*LH0*NMjXnkjE(QiqS3j3^P6BI42E5#xo|41ePP)|E diff --git a/test/golden-firefox/screenshot-offscreen-clip-artefacts.png b/test/golden-firefox/screenshot-offscreen-clip-artefacts.png new file mode 100644 index 0000000000000000000000000000000000000000..846b810386f7c69f2bb976e1426cd3509f9a6630 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^DImCFH0Xa1i#vv1$N zJ$v?S*|KHr+O;cJuADx7dVha^a&oedkB_^%yOEKRo}QkTmX@ljs*H>bA0Ho3?+LZ^ z{XmMbB*-tA!Qt5rkhyK1E{-7;x8C0HOfI_U+rZXV0E3TehrSyLRQu zmD8tB@9*zVPEPjm@o{%|H!?EP)6>(^(o$7bm64I*2BBI42E5#xo|41ePP)|E diff --git a/test/screenshot.spec.ts b/test/screenshot.spec.ts index fbe50097..607b1369 100644 --- a/test/screenshot.spec.ts +++ b/test/screenshot.spec.ts @@ -50,21 +50,43 @@ describe('Screenshots', function () { }); expect(screenshot).toBeGolden('screenshot-clip-rect.png'); }); - itFailsFirefox('should clip elements to the viewport', async () => { + // TODO: enable after the screenshot is fixed. + // https://crbug.com/1173457 + it.skip('should clip elements to the viewport size without artefacts', async () => { const { page, server } = getTestState(); - - await page.setViewport({ width: 500, height: 500 }); + await page.setViewport({ width: 50, height: 50 }); await page.goto(server.PREFIX + '/grid.html'); const screenshot = await page.screenshot({ clip: { - x: 50, - y: 600, + x: 25, + y: 25, width: 100, height: 100, }, }); expect(screenshot).toBeGolden('screenshot-offscreen-clip.png'); }); + // TODO: remove after the screenshot is fixed. + // https://crbug.com/1173457 + itFailsFirefox( + 'should clip elements to the viewport size with artefacts', + async () => { + const { page, server } = getTestState(); + await page.setViewport({ width: 50, height: 50 }); + await page.goto(server.PREFIX + '/grid.html'); + const screenshot = await page.screenshot({ + clip: { + x: 25, + y: 25, + width: 100, + height: 100, + }, + }); + expect(screenshot).toBeGolden( + 'screenshot-offscreen-clip-artefacts.png' + ); + } + ); it('should run in parallel', async () => { const { page, server } = getTestState(); diff --git a/versions.js b/versions.js index ee92dffb..28e72dae 100644 --- a/versions.js +++ b/versions.js @@ -17,6 +17,7 @@ const versionsPerRelease = new Map([ // This is a mapping from Chromium version => Puppeteer version. // In Chromium roll patches, use 'NEXT' for the Puppeteer version. + ['90.0.4403.0', 'NEXT'], ['89.0.4389.0', 'v6.0.0'], ['88.0.4298.0', 'v5.5.0'], ['87.0.4272.0', 'v5.4.0'],