From db9b8a003ff9fd8fee00e1c8a019bbc1ce90d2e2 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Mon, 31 Aug 2020 17:43:23 -0700 Subject: [PATCH] fix(screencast): dont throw from frameAck if target is closed (#3702) --- src/server/chromium/crPage.ts | 3 ++- test/screencast.spec.ts | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/chromium/crPage.ts b/src/server/chromium/crPage.ts index 6573d0e61181e..cb130c4419974 100644 --- a/src/server/chromium/crPage.ts +++ b/src/server/chromium/crPage.ts @@ -743,7 +743,8 @@ class FrameSession { return; const buffer = Buffer.from(payload.data, 'base64'); this._videoRecorder.writeFrame(buffer, payload.metadata.timestamp!); - this._client.send('Page.screencastFrameAck', {sessionId: payload.sessionId}); + // The target may be closed before receiving the ack. + this._client.send('Page.screencastFrameAck', {sessionId: payload.sessionId}).catch(() => {}); } async _startScreencast(screencastId: string, options: types.PageScreencastOptions): Promise { diff --git a/test/screencast.spec.ts b/test/screencast.spec.ts index b9a095d0ce798..dfe4da55016d3 100644 --- a/test/screencast.spec.ts +++ b/test/screencast.spec.ts @@ -193,8 +193,7 @@ describe('screencast', suite => { it('should capture navigation', test => { test.flaky(options.CHROMIUM && MAC); - test.flaky(options.FIREFOX && LINUX && !options.HEADLESS); - test.flaky(options.FIREFOX && WIN); + test.flaky(options.FIREFOX); test.flaky(options.WEBKIT); }, async ({page, tmpDir, server, videoPlayer, toImpl}) => { const videoFile = path.join(tmpDir, 'v.webm');