fix(screencast): dont throw from frameAck if target is closed (#3702)

This commit is contained in:
Yury Semikhatsky 2020-08-31 17:43:23 -07:00 committed by GitHub
parent 1877c29834
commit db9b8a003f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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<void> {

View File

@ -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');