From 368f3a206b3412c636e4d33cb31461e46a57ef09 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 1 Aug 2024 16:13:03 +0200 Subject: [PATCH] plumb reason upon pipe closing --- packages/playwright-core/src/client/browserType.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/playwright-core/src/client/browserType.ts b/packages/playwright-core/src/client/browserType.ts index 06672cc64e..ebc9a214de 100644 --- a/packages/playwright-core/src/client/browserType.ts +++ b/packages/playwright-core/src/client/browserType.ts @@ -148,8 +148,8 @@ export class BrowserType extends ChannelOwner imple // Emulate all pages, contexts and the browser closing upon disconnect. for (const context of browser?.contexts() || []) { for (const page of context.pages()) - page._onClose(); - context._onClose(); + page._onClose(reason); + context._onClose(reason); } connection.close(reason || closeError); // Give a chance to any API call promises to reject upon page/context closure.