mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-12 11:50:22 +03:00
chore: make trace viewer self-desctruct on input disconnect (#23291)
This commit is contained in:
parent
962c32ae10
commit
ec972fb7c1
@ -18,7 +18,7 @@ import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { HttpServer } from '../../../utils/httpServer';
|
||||
import { findChromiumChannel } from '../../registry';
|
||||
import { isUnderTest } from '../../../utils';
|
||||
import { gracefullyCloseAll, isUnderTest } from '../../../utils';
|
||||
import { installAppIcon, syncLocalStorageWithSettings } from '../../chromium/crApp';
|
||||
import { serverSideCallMetadata } from '../../instrumentation';
|
||||
import { createPlaywright } from '../../playwright';
|
||||
@ -143,6 +143,16 @@ function runServer(page: Page) {
|
||||
else
|
||||
loadTrace(url);
|
||||
});
|
||||
process.stdin.on('close', () => selfDestruct());
|
||||
}
|
||||
|
||||
function selfDestruct() {
|
||||
// Force exit after 30 seconds.
|
||||
setTimeout(() => process.exit(0), 30000);
|
||||
// Meanwhile, try to gracefully close all browsers.
|
||||
gracefullyCloseAll().then(() => {
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
function traceDescriptor(traceName: string) {
|
||||
|
Loading…
Reference in New Issue
Block a user