Skip to content

Commit

Permalink
fix(firefox): fire "requestfailed" event on network errors (#1817)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s committed Apr 16, 2020
1 parent f594229 commit 55c01da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"main": "index.js",
"playwright": {
"chromium_revision": "759546",
"firefox_revision": "1082",
"firefox_revision": "1083",
"webkit_revision": "1197"
},
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions test/network.spec.js
Expand Up @@ -241,10 +241,10 @@ describe('Network Events', function() {
expect(responses[0].request()).toBeTruthy();
});

it.fail(FFOX)('Page.Events.RequestFailed', async({page, server}) => {
it('Page.Events.RequestFailed', async({page, server}) => {
server.setRoute('/one-style.css', (req, res) => {
req.socket.write('deadbeef');
req.socket.end();
res.setHeader('Content-Type', 'text/css');
res.socket.destroy();
});
const failedRequests = [];
page.on('requestfailed', request => failedRequests.push(request));
Expand All @@ -254,7 +254,7 @@ describe('Network Events', function() {
expect(await failedRequests[0].response()).toBe(null);
expect(failedRequests[0].resourceType()).toBe('stylesheet');
if (CHROMIUM) {
expect(failedRequests[0].failure().errorText).toBe('net::ERR_INVALID_HTTP_RESPONSE');
expect(failedRequests[0].failure().errorText).toBe('net::ERR_EMPTY_RESPONSE');
} else if (WEBKIT) {
if (MAC)
expect(failedRequests[0].failure().errorText).toBe('The network connection was lost.');
Expand All @@ -263,7 +263,7 @@ describe('Network Events', function() {
else
expect(failedRequests[0].failure().errorText).toBe('Message Corrupt');
} else {
expect(failedRequests[0].failure().errorText).toBe('NS_ERROR_FAILURE');
expect(failedRequests[0].failure().errorText).toBe('NS_ERROR_NET_RESET');
}
expect(failedRequests[0].frame()).toBeTruthy();
});
Expand Down

0 comments on commit 55c01da

Please sign in to comment.