chore(bidi): Do not wait for browsingContext.close if runBeforeUnload is true
This commit is contained in:
Родитель
ac116248f9
Коммит
8778e02217
|
@ -390,10 +390,17 @@ export class BidiPage implements PageDelegate {
|
|||
}
|
||||
|
||||
async closePage(runBeforeUnload: boolean): Promise<void> {
|
||||
await this._session.send('browsingContext.close', {
|
||||
const onClose = this._session.send('browsingContext.close', {
|
||||
context: this._session.sessionId,
|
||||
promptUnload: runBeforeUnload,
|
||||
});
|
||||
|
||||
// Only wait for the browsingContext to close if runBeforeUnload is false.
|
||||
// Otherwise a before unload prompt might be displayed and should be handled
|
||||
// by the caller.
|
||||
// See NOTE on https://playwright.dev/docs/api/class-page#page-close
|
||||
if (!runBeforeUnload)
|
||||
await onClose;
|
||||
}
|
||||
|
||||
async setBackgroundColor(color?: { r: number; g: number; b: number; a: number; }): Promise<void> {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
library/beforeunload.spec.ts › should access page after beforeunload [timeout]
|
||||
library/beforeunload.spec.ts › should run beforeunload if asked for @smoke [timeout]
|
||||
library/browsercontext-events.spec.ts › console event should work in immediately closed popup [timeout]
|
||||
library/browsercontext-events.spec.ts › console event should work in popup 2 [timeout]
|
||||
library/browsercontext-events.spec.ts › dialog event should work in immediately closed popup [timeout]
|
||||
|
|
Загрузка…
Ссылка в новой задаче