Yury Semikhatsky 2023-04-07 17:20:49 -07:00 committed by GitHub
parent 26bbf8ca1b
commit 8d2502ee62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,8 @@ export class ElectronApplication extends SdkObject {
this._nodeSession.on('Runtime.executionContextCreated', async (event: any) => {
if (event.context.auxData && event.context.auxData.isDefault) {
this._nodeExecutionContext = new js.ExecutionContext(this, new CRExecutionContext(this._nodeSession, event.context), 'electron');
f(await js.evaluate(this._nodeExecutionContext, false /* returnByValue */, `process.mainModule.require('electron')`));
const source = `process.mainModule.require('electron')`;
f(await this._nodeExecutionContext.rawEvaluateHandle(source).then(objectId => new js.JSHandle(this._nodeExecutionContext!, 'object', 'ElectronModule', objectId)));
}
});
});

View File

@ -21,7 +21,7 @@ function leakedJSHandles(): string {
const map = new MultiMap();
for (const [h, e] of (globalThis as any).leakedJSHandles) {
const name = `[${h.worldNameForTest()}] ${h.preview()}`;
if (name === '[main] UtilityScript' || name === '[utility] UtilityScript' || name === '[main] InjectedScript' || name === '[utility] InjectedScript')
if (name === '[main] UtilityScript' || name === '[utility] UtilityScript' || name === '[electron] UtilityScript' || name === '[main] InjectedScript' || name === '[utility] InjectedScript' || name === '[electron] ElectronModule')
continue;
map.set(e.stack, name);
}

View File

@ -68,7 +68,6 @@ test('render steps', async ({ runInlineTest }) => {
`,
}, { reporter: 'list' }, { PW_TEST_DEBUG_REPORTERS: '1', PW_TEST_DEBUG_REPORTERS_PRINT_STEPS: '1', PWTEST_TTY_WIDTH: '80' });
const text = result.output;
console.log(result.output)
const lines = text.split('\n').filter(l => l.match(/^\d :/)).map(l => l.replace(/\d+ms/, 'Xms'));
lines.pop(); // Remove last item that contains [v] and time in ms.
expect(lines).toEqual([