mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
Fix notebook tests
This commit is contained in:
@@ -40,6 +40,8 @@ import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl';
|
||||
import { ILogService, NullLogService } from 'vs/platform/log/common/log';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
import { IWorkspaceTrustRequestService } from 'vs/platform/workspace/common/workspaceTrust';
|
||||
import { TestWorkspaceTrustRequestService } from 'vs/workbench/services/workspaces/test/common/testWorkspaceTrustService';
|
||||
|
||||
export class TestCell extends NotebookCellTextModel {
|
||||
constructor(
|
||||
@@ -143,6 +145,7 @@ export function setupInstantiationService() {
|
||||
instantiationService.stub(IClipboardService, new BrowserClipboardService());
|
||||
instantiationService.stub(ILogService, new NullLogService());
|
||||
instantiationService.stub(IStorageService, new TestStorageService());
|
||||
instantiationService.stub(IWorkspaceTrustRequestService, new TestWorkspaceTrustRequestService(true));
|
||||
|
||||
return instantiationService;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IWorkspaceTrustManagementService, IWorkspaceTrustUriInfo } from 'vs/platform/workspace/common/workspaceTrust';
|
||||
import { IWorkspaceTrustManagementService, IWorkspaceTrustRequestService, IWorkspaceTrustUriInfo, WorkspaceTrustRequestOptions } from 'vs/platform/workspace/common/workspaceTrust';
|
||||
|
||||
|
||||
export class TestWorkspaceTrustManagementService implements IWorkspaceTrustManagementService {
|
||||
@@ -62,3 +62,27 @@ export class TestWorkspaceTrustManagementService implements IWorkspaceTrustManag
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class TestWorkspaceTrustRequestService implements IWorkspaceTrustRequestService {
|
||||
_serviceBrand: any;
|
||||
|
||||
private readonly _onDidInitiateWorkspaceTrustRequest = new Emitter<WorkspaceTrustRequestOptions>();
|
||||
readonly onDidInitiateWorkspaceTrustRequest = this._onDidInitiateWorkspaceTrustRequest.event;
|
||||
|
||||
private readonly _onDidCompleteWorkspaceTrustRequest = new Emitter<boolean>();
|
||||
readonly onDidCompleteWorkspaceTrustRequest = this._onDidCompleteWorkspaceTrustRequest.event;
|
||||
|
||||
constructor(private readonly _trusted: boolean) { }
|
||||
|
||||
cancelRequest(): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
completeRequest(trusted?: boolean): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise<boolean> {
|
||||
return this._trusted;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user