fix(tracing): fix tracing + debugger test (#10619)
This commit is contained in:
parent
1bfc473bc8
commit
11cbdcf58a
|
|
@ -318,9 +318,9 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
|
|||
await artifact.saveAs(this._options.recordHar.path);
|
||||
await artifact.delete();
|
||||
}
|
||||
await this._channel.close();
|
||||
await this._closedPromise;
|
||||
});
|
||||
}, true);
|
||||
await this._channel.close();
|
||||
await this._closedPromise;
|
||||
} catch (e) {
|
||||
if (isSafeCloseError(e))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ export class RecorderApp extends EventEmitter {
|
|||
await mainFrame.goto(internalCallMetadata(), 'https://playwright/index.html');
|
||||
}
|
||||
|
||||
static async open(sdkLanguage: string): Promise<RecorderApp> {
|
||||
static async open(sdkLanguage: string, headed: boolean): Promise<RecorderApp> {
|
||||
const recorderPlaywright = (require('../../playwright').createPlaywright as typeof import('../../playwright').createPlaywright)('javascript', true);
|
||||
const args = [
|
||||
'--app=data:text/html,',
|
||||
|
|
@ -98,7 +98,7 @@ export class RecorderApp extends EventEmitter {
|
|||
channel: findChromiumChannel(sdkLanguage),
|
||||
args,
|
||||
noDefaultViewport: true,
|
||||
headless: !!process.env.PWTEST_CLI_HEADLESS || (isUnderTest() && !process.env.HEADFUL),
|
||||
headless: !!process.env.PWTEST_CLI_HEADLESS || (isUnderTest() && !headed),
|
||||
useWebSocket: !!process.env.PWTEST_RECORDER_PORT
|
||||
});
|
||||
const controller = new ProgressController(internalCallMetadata(), context._browser);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export class RecorderSupplement implements InstrumentationListener {
|
|||
}
|
||||
|
||||
async install() {
|
||||
const recorderApp = await RecorderApp.open(this._context._browser.options.sdkLanguage);
|
||||
const recorderApp = await RecorderApp.open(this._context._browser.options.sdkLanguage, !!this._context._browser.options.headful);
|
||||
this._recorderApp = recorderApp;
|
||||
recorderApp.once('close', () => {
|
||||
this._debugger.resume(false);
|
||||
|
|
|
|||
|
|
@ -194,7 +194,6 @@ test('should open simple trace viewer', async ({ showTraceViewer }) => {
|
|||
/page.gotohttp:\/\/localhost:\d+\/frames\/frame.html/,
|
||||
/route.continue/,
|
||||
/page.setViewportSize/,
|
||||
/browserContext.close/,
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue