mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-04 15:25:47 +01:00
offer exit on driver
This commit is contained in:
@@ -89,6 +89,7 @@ export class Application {
|
||||
|
||||
async stop(): Promise<any> {
|
||||
if (this._code) {
|
||||
await this._code.exit();
|
||||
this._code.dispose();
|
||||
this._code = undefined;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ async function connect(child: cp.ChildProcess, outPath: string, handlePath: stri
|
||||
while (true) {
|
||||
try {
|
||||
const { client, driver } = await connectDriver(outPath, handlePath);
|
||||
return new Code(child, client, driver, logger);
|
||||
return new Code(client, driver, logger);
|
||||
} catch (err) {
|
||||
if (++errCount > 50) {
|
||||
child.kill();
|
||||
@@ -188,7 +188,6 @@ export class Code {
|
||||
private driver: IDriver;
|
||||
|
||||
constructor(
|
||||
private process: cp.ChildProcess,
|
||||
private client: IDisposable,
|
||||
driver: IDriver,
|
||||
readonly logger: Logger
|
||||
@@ -230,6 +229,10 @@ export class Code {
|
||||
await this.driver.reloadWindow(windowId);
|
||||
}
|
||||
|
||||
async exit(): Promise<void> {
|
||||
await this.driver.exitApplication();
|
||||
}
|
||||
|
||||
async waitForTextContent(selector: string, textContent?: string, accept?: (result: string) => boolean): Promise<string> {
|
||||
const windowId = await this.getActiveWindowId();
|
||||
accept = accept || (result => textContent !== void 0 ? textContent === result : !!result);
|
||||
@@ -302,7 +305,6 @@ export class Code {
|
||||
|
||||
dispose(): void {
|
||||
this.client.dispose();
|
||||
this.process.kill();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user