mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: remove graceful browser.close cleanup (#27916)
This commit is contained in:
parent
817a130cdc
commit
0f2de59b7c
@ -240,13 +240,7 @@ export abstract class BrowserContext extends SdkObject {
|
||||
// at the same time.
|
||||
return;
|
||||
}
|
||||
const gotClosedGracefully = this._closedStatus === 'closing';
|
||||
this._closedStatus = 'closed';
|
||||
if (!gotClosedGracefully) {
|
||||
this._deleteAllDownloads();
|
||||
this._downloads.clear();
|
||||
}
|
||||
this.tracing.dispose().catch(() => {});
|
||||
this.tracing.abort();
|
||||
if (this._isPersistentContext)
|
||||
this.onClosePersistent();
|
||||
this._closePromiseFulfill!(new Error('Context closed'));
|
||||
@ -422,7 +416,7 @@ export abstract class BrowserContext extends SdkObject {
|
||||
|
||||
for (const harRecorder of this._harRecorders.values())
|
||||
await harRecorder.flush();
|
||||
await this.tracing.dispose();
|
||||
await this.tracing.flush();
|
||||
|
||||
// Cleanup.
|
||||
const promises: Promise<void>[] = [];
|
||||
|
||||
@ -551,7 +551,7 @@ export class GlobalAPIRequestContext extends APIRequestContext {
|
||||
}
|
||||
|
||||
override async dispose() {
|
||||
await this._tracing.dispose();
|
||||
await this._tracing.flush();
|
||||
await this._tracing.deleteTmpTracesDir();
|
||||
this._disposeImpl();
|
||||
}
|
||||
|
||||
@ -249,9 +249,13 @@ export class Tracing extends SdkObject implements InstrumentationListener, Snaps
|
||||
return this._tracesTmpDir;
|
||||
}
|
||||
|
||||
async dispose() {
|
||||
abort() {
|
||||
this._snapshotter?.dispose();
|
||||
this._harTracer.stop();
|
||||
}
|
||||
|
||||
async flush() {
|
||||
this.abort();
|
||||
await this._fs.syncAndGetError();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user