From ded567d8f82b3dab48eb3172a685dd67094aa84f Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Fri, 27 Sep 2024 19:02:54 +0200 Subject: [PATCH] test: add test for avif image format (#32815) Fixes https://github.com/microsoft/playwright/issues/32673 --- tests/assets/rgb.avif | Bin 0 -> 543 bytes tests/library/capabilities.spec.ts | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/assets/rgb.avif diff --git a/tests/assets/rgb.avif b/tests/assets/rgb.avif new file mode 100644 index 0000000000000000000000000000000000000000..d79bff8a21b9d12cfcc693d5f0cffed1e348c4f8 GIT binary patch literal 543 zcmZQzV30{GsVqn=%S>Yc0uY^>nP!-qnF!=Fw&bRkB!a|&KrtgFrwGDiU?|8;E`hOO zG+#kxNiLYf2qaB1bMlixJQoKBCLja?#uW@884yr}uozFmMZ$oh7MYoOU}u2Uivl^R z5RD**85n{zA_RdlFu}u_1w{ow$+?*Y$@xH9I5|J3C@(pu0%$rf16u=7h$pek(7BO8 z2FPR($t*5N1u=l20g8c+ugC-mFmeD1i^S3jXArNnD9NHr8Q$T(B|jdhYWyj9WO<(R u;YH;`vzabiJUiXQmB6WE`R4NiCfk4|PmWG_e9xkdUCuvei&e{nhYbKV-+n;= literal 0 HcmV?d00001 diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.ts index 816f647ef4bb7..bde5a8bd0bbe5 100644 --- a/tests/library/capabilities.spec.ts +++ b/tests/library/capabilities.spec.ts @@ -401,3 +401,14 @@ it('service worker should register in an iframe', async ({ page, server }) => { }); expect(response).toBe('responseFromServiceWorker'); }); + +it('should be able to render avif images', async ({ page, server, browserName, platform }) => { + it.fixme(browserName === 'webkit' && platform === 'win32'); + await page.goto(server.EMPTY_PAGE); + await page.setContent(``); + await expect.poll(() => page.locator('img').boundingBox()).toEqual(expect.objectContaining({ + width: 128, + height: 128, + })); + expect(await page.evaluate(() => (window as any).error)).toBe(undefined); +});