mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
Have the lifecycle dependent on the Page since we only support 1 window for now (#264099)
This makes sure that closing the window actually closes everything to workaround the macOS behavior of having all windows closed but it's still running.
This commit is contained in:
committed by
GitHub
parent
8adf7c1c39
commit
3c90d276e0
@@ -323,7 +323,7 @@ export async function getApplication() {
|
||||
extraArgs: (opts.electronArgs || '').split(' ').map(arg => arg.trim()).filter(arg => !!arg),
|
||||
});
|
||||
await application.start();
|
||||
application.code.driver.browserContext.on('close', async () => {
|
||||
application.code.driver.currentPage.on('close', async () => {
|
||||
fs.rmSync(testDataPath, { recursive: true, force: true, maxRetries: 10 });
|
||||
});
|
||||
return application;
|
||||
@@ -355,7 +355,7 @@ export class ApplicationService {
|
||||
}
|
||||
if (!this._application) {
|
||||
this._application = await getApplication();
|
||||
this._application.code.driver.browserContext.on('close', () => {
|
||||
this._application.code.driver.currentPage.on('close', () => {
|
||||
this._closing = (async () => {
|
||||
if (this._application) {
|
||||
this._application.code.driver.browserContext.removeAllListeners();
|
||||
|
||||
Reference in New Issue
Block a user