From 55c01da0056dbae56107c2ae0324cf960e4dd35e Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 16 Apr 2020 13:35:16 -0700 Subject: [PATCH] fix(firefox): fire "requestfailed" event on network errors (#1817) --- package.json | 2 +- test/network.spec.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 7638b83387bb4..b74408427b8b8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "main": "index.js", "playwright": { "chromium_revision": "759546", - "firefox_revision": "1082", + "firefox_revision": "1083", "webkit_revision": "1197" }, "scripts": { diff --git a/test/network.spec.js b/test/network.spec.js index 3526f728878ec..818373a985aed 100644 --- a/test/network.spec.js +++ b/test/network.spec.js @@ -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)); @@ -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.'); @@ -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(); });