mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
fix(webkit): fail the 204 navigations (#1260)
This commit is contained in:
parent
3dc48f96c0
commit
2fa2421894
@ -764,6 +764,14 @@ export class WKPage implements PageDelegate {
|
|||||||
return;
|
return;
|
||||||
const response = request.createResponse(event.response);
|
const response = request.createResponse(event.response);
|
||||||
this._page._frameManager.requestReceivedResponse(response);
|
this._page._frameManager.requestReceivedResponse(response);
|
||||||
|
|
||||||
|
if (response.status() === 204) {
|
||||||
|
this._onLoadingFailed({
|
||||||
|
requestId: event.requestId,
|
||||||
|
errorText: 'Aborted: 204 No Content',
|
||||||
|
timestamp: event.timestamp
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onLoadingFinished(event: Protocol.Network.loadingFinishedPayload) {
|
_onLoadingFinished(event: Protocol.Network.loadingFinishedPayload) {
|
||||||
|
@ -121,7 +121,7 @@ module.exports.describe = function({testRunner, expect, playwright, MAC, WIN, FF
|
|||||||
});
|
});
|
||||||
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
||||||
});
|
});
|
||||||
it.fail(WEBKIT)('should fail when server returns 204', async({page, server}) => {
|
it('should fail when server returns 204', async({page, server}) => {
|
||||||
// Webkit just loads an empty page.
|
// Webkit just loads an empty page.
|
||||||
server.setRoute('/empty.html', (req, res) => {
|
server.setRoute('/empty.html', (req, res) => {
|
||||||
res.statusCode = 204;
|
res.statusCode = 204;
|
||||||
@ -132,6 +132,8 @@ module.exports.describe = function({testRunner, expect, playwright, MAC, WIN, FF
|
|||||||
expect(error).not.toBe(null);
|
expect(error).not.toBe(null);
|
||||||
if (CHROMIUM)
|
if (CHROMIUM)
|
||||||
expect(error.message).toContain('net::ERR_ABORTED');
|
expect(error.message).toContain('net::ERR_ABORTED');
|
||||||
|
else if (WEBKIT)
|
||||||
|
expect(error.message).toContain('Aborted: 204 No Content');
|
||||||
else
|
else
|
||||||
expect(error.message).toContain('NS_BINDING_ABORTED');
|
expect(error.message).toContain('NS_BINDING_ABORTED');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user