mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-28 08:04:00 +01:00
smoke - fix electron window timeout (#176012)
This commit is contained in:
@@ -17,12 +17,12 @@ export async function launch(options: LaunchOptions): Promise<{ electronProcess:
|
||||
args.push('--enable-smoke-test-driver');
|
||||
|
||||
// Launch electron via playwright
|
||||
const { electron, context, page, windowLoadedPromise } = await launchElectron({ electronPath, args, env }, options);
|
||||
const { electron, context, page } = await launchElectron({ electronPath, args, env }, options);
|
||||
const electronProcess = electron.process();
|
||||
|
||||
return {
|
||||
electronProcess,
|
||||
driver: new PlaywrightDriver(electron, context, page, undefined /* no server process */, windowLoadedPromise, options)
|
||||
driver: new PlaywrightDriver(electron, context, page, undefined /* no server process */, Promise.resolve() /* Window is open already */, options)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,8 +35,6 @@ async function launchElectron(configuration: IElectronConfiguration, options: La
|
||||
env: configuration.env as { [key: string]: string }
|
||||
}), 'playwright-electron#launch', logger);
|
||||
|
||||
const windowLoadedPromise = electron.waitForEvent('window');
|
||||
|
||||
const window = await measureAndLog(() => electron.firstWindow(), 'playwright-electron#firstWindow', logger);
|
||||
|
||||
const context = window.context();
|
||||
@@ -74,5 +72,5 @@ async function launchElectron(configuration: IElectronConfiguration, options: La
|
||||
}
|
||||
});
|
||||
|
||||
return { electron, context, page: window, windowLoadedPromise };
|
||||
return { electron, context, page: window };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user