test: add test for avif image format (#32815)

Fixes https://github.com/microsoft/playwright/issues/32673
This commit is contained in:
Max Schmitt 2024-09-27 19:02:54 +02:00 committed by GitHub
parent 5947c21dc7
commit ded567d8f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

BIN
tests/assets/rgb.avif Normal file

Binary file not shown.

View File

@ -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(`<img src="${server.PREFIX}/rgb.avif" onerror="window.error = true">`);
await expect.poll(() => page.locator('img').boundingBox()).toEqual(expect.objectContaining({
width: 128,
height: 128,
}));
expect(await page.evaluate(() => (window as any).error)).toBe(undefined);
});