fix(close): actually mark the page as closing (#2798)
Currently double-closing flakiness is seen on Firefox bots.
This commit is contained in:
parent
5c4751d5dd
commit
ff1fe3ac39
|
|
@ -480,6 +480,7 @@ export class Page extends EventEmitter {
|
||||||
return;
|
return;
|
||||||
const runBeforeUnload = !!options && !!options.runBeforeUnload;
|
const runBeforeUnload = !!options && !!options.runBeforeUnload;
|
||||||
if (this._closedState !== 'closing') {
|
if (this._closedState !== 'closing') {
|
||||||
|
this._closedState = 'closing';
|
||||||
assert(!this._disconnected, 'Protocol error: Connection closed. Most likely the page has been closed.');
|
assert(!this._disconnected, 'Protocol error: Connection closed. Most likely the page has been closed.');
|
||||||
await this._delegate.closePage(runBeforeUnload);
|
await this._delegate.closePage(runBeforeUnload);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue