Skip to content

Commit

Permalink
test: add test for avif image format (#32815)
Browse files Browse the repository at this point in the history
Fixes #32673
  • Loading branch information
mxschmitt committed Sep 27, 2024
1 parent 5947c21 commit ded567d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Binary file added tests/assets/rgb.avif
Binary file not shown.
11 changes: 11 additions & 0 deletions tests/library/capabilities.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

0 comments on commit ded567d

Please sign in to comment.