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.saveAs(this._options.recordHar.path);
|
||||||
await artifact.delete();
|
await artifact.delete();
|
||||||
}
|
}
|
||||||
await this._channel.close();
|
}, true);
|
||||||
await this._closedPromise;
|
await this._channel.close();
|
||||||
});
|
await this._closedPromise;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (isSafeCloseError(e))
|
if (isSafeCloseError(e))
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export class RecorderApp extends EventEmitter {
|
||||||
await mainFrame.goto(internalCallMetadata(), 'https://playwright/index.html');
|
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 recorderPlaywright = (require('../../playwright').createPlaywright as typeof import('../../playwright').createPlaywright)('javascript', true);
|
||||||
const args = [
|
const args = [
|
||||||
'--app=data:text/html,',
|
'--app=data:text/html,',
|
||||||
|
|
@ -98,7 +98,7 @@ export class RecorderApp extends EventEmitter {
|
||||||
channel: findChromiumChannel(sdkLanguage),
|
channel: findChromiumChannel(sdkLanguage),
|
||||||
args,
|
args,
|
||||||
noDefaultViewport: true,
|
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
|
useWebSocket: !!process.env.PWTEST_RECORDER_PORT
|
||||||
});
|
});
|
||||||
const controller = new ProgressController(internalCallMetadata(), context._browser);
|
const controller = new ProgressController(internalCallMetadata(), context._browser);
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ export class RecorderSupplement implements InstrumentationListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
async install() {
|
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;
|
this._recorderApp = recorderApp;
|
||||||
recorderApp.once('close', () => {
|
recorderApp.once('close', () => {
|
||||||
this._debugger.resume(false);
|
this._debugger.resume(false);
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,6 @@ test('should open simple trace viewer', async ({ showTraceViewer }) => {
|
||||||
/page.gotohttp:\/\/localhost:\d+\/frames\/frame.html/,
|
/page.gotohttp:\/\/localhost:\d+\/frames\/frame.html/,
|
||||||
/route.continue/,
|
/route.continue/,
|
||||||
/page.setViewportSize/,
|
/page.setViewportSize/,
|
||||||
/browserContext.close/,
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue