test: request.sizes() sometimes hangs in CR (#9349)

This commit is contained in:
Ross Wollman 2021-10-07 14:26:54 -07:00 committed by GitHub
parent b10140d9c2
commit a892fe6db0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,3 +195,29 @@ it('should have correct responseBodySize for 404 with content', async ({ page, s
const { responseBodySize } = await req.sizes();
expect(responseBodySize).toBeGreaterThanOrEqual(0);
});
it('should return sizes without hanging', async ({ page, server, browserName }) => {
it.fixme(browserName === 'chromium');
server.setRoute('/has-abandoned-fetch', (req, resp) => {
resp.end(`
<!DOCTYPE html>
<html>
<head><title>t</title></head>
<body>
<script>
fetch("./404");
</script>
</body>
</html>
`);
});
const [req] = await Promise.all([
page.waitForRequest(/404$/),
page.goto(server.PREFIX + '/has-abandoned-fetch')
]);
await req.sizes();
});