mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
testing: allow canceling test refresh
This commit is contained in:
@@ -55,7 +55,7 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
/**
|
||||
* Implements vscode.test.registerTestProvider
|
||||
*/
|
||||
public createTestController(controllerId: string, label: string, refreshHandler?: () => Thenable<void> | void): vscode.TestController {
|
||||
public createTestController(controllerId: string, label: string, refreshHandler?: (token: CancellationToken) => Thenable<void> | void): vscode.TestController {
|
||||
if (this.controllers.has(controllerId)) {
|
||||
throw new Error(`Attempt to insert a duplicate controller with ID "${controllerId}"`);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
get refreshHandler() {
|
||||
return refreshHandler;
|
||||
},
|
||||
set refreshHandler(value: (() => Thenable<void> | void) | undefined) {
|
||||
set refreshHandler(value: ((token: CancellationToken) => Thenable<void> | void) | undefined) {
|
||||
refreshHandler = value;
|
||||
proxy.$updateController(controllerId, { canRefresh: !!value });
|
||||
},
|
||||
@@ -183,8 +183,8 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
async $refreshTests(controllerId: string) {
|
||||
await this.controllers.get(controllerId)?.controller.refreshHandler?.();
|
||||
async $refreshTests(controllerId: string, token: CancellationToken) {
|
||||
await this.controllers.get(controllerId)?.controller.refreshHandler?.(token);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user