fix(ff): resource type for image sets should be `image` (#33195)

This commit is contained in:
Simon Knott 2024-10-21 11:14:48 +02:00 committed by GitHub
parent 4b187107ee
commit 40d5a1cb4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View File

@ -183,7 +183,7 @@ const causeToResourceType: {[key: string]: string} = {
TYPE_XSLT: 'other', TYPE_XSLT: 'other',
TYPE_BEACON: 'other', TYPE_BEACON: 'other',
TYPE_FETCH: 'fetch', TYPE_FETCH: 'fetch',
TYPE_IMAGESET: 'images', TYPE_IMAGESET: 'image',
TYPE_WEB_MANIFEST: 'manifest', TYPE_WEB_MANIFEST: 'manifest',
}; };

View File

@ -258,3 +258,18 @@ it('should finish 204 request', {
page.evaluate(async url => { await fetch(url); }, server.PREFIX + '/204').catch(() => {}); page.evaluate(async url => { await fetch(url); }, server.PREFIX + '/204').catch(() => {});
expect(await reqPromise).toBe('requestfinished'); expect(await reqPromise).toBe('requestfinished');
}); });
it('<picture> resource should have type image', async ({ page }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/33148' });
const [request] = await Promise.all([
page.waitForEvent('request'),
page.setContent(`
<picture>
<source>
<img src="https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2@2x.png">
</source>
</picture>
`)
]);
expect(request.resourceType()).toBe('image');
});