Fix unit tests

This commit is contained in:
Daniel Imms
2021-03-04 10:38:54 -08:00
parent 8fd1b97716
commit 8465489bbd
@@ -63,7 +63,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { ViewletDescriptor, Viewlet } from 'vs/workbench/browser/viewlet';
import { IViewlet } from 'vs/workbench/common/viewlet';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { IProcessEnvironment, isLinux, isWindows, Platform } from 'vs/base/common/platform';
import { IProcessEnvironment, isLinux, isWindows } from 'vs/base/common/platform';
import { LabelService } from 'vs/workbench/services/label/common/labelService';
import { Part } from 'vs/workbench/browser/part';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
@@ -126,9 +126,9 @@ import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEd
import { IEnterWorkspaceResult, IRecent, IRecentlyOpened, IWorkspaceFolderCreationData, IWorkspaceIdentifier, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
import { IWorkspaceTrustService } from 'vs/platform/workspace/common/workspaceTrust';
import { TestWorkspaceTrustService } from 'vs/workbench/services/workspaces/test/common/testWorkspaceTrustService';
import { ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal';
import { IShellLaunchConfig, ITerminalChildProcess, ITerminalsLayoutInfo, ITerminalsLayoutInfoById } from 'vs/platform/terminal/common/terminal';
import { ILocalTerminalService, IShellLaunchConfig, ITerminalChildProcess, ITerminalsLayoutInfo, ITerminalsLayoutInfoById } from 'vs/platform/terminal/common/terminal';
import { ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';
import { ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal';
export function createFileEditorInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
return instantiationService.createInstance(FileEditorInput, resource, undefined, undefined, undefined, undefined, undefined);
@@ -231,6 +231,7 @@ export function workbenchInstantiationService(
instantiationService.stub(IWorkspacesService, new TestWorkspacesService());
instantiationService.stub(IWorkspaceTrustService, new TestWorkspaceTrustService());
instantiationService.stub(ITerminalInstanceService, new TestTerminalInstanceService());
instantiationService.stub(ILocalTerminalService, new TestLocalTerminalService());
return instantiationService;
}
@@ -1459,15 +1460,7 @@ export class TestWorkspacesService implements IWorkspacesService {
export class TestTerminalInstanceService implements ITerminalInstanceService {
declare readonly _serviceBrand: undefined;
onPtyHostExit = Event.None;
onPtyHostUnresponsive = Event.None;
onPtyHostResponsive = Event.None;
onPtyHostRestart = Event.None;
async createTerminalProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, env: IProcessEnvironment, windowsEnableConpty: boolean, shouldPersist: boolean): Promise<ITerminalChildProcess> {
return new TestTerminalChildProcess(shouldPersist);
}
async getDefaultShellAndArgs(useAutomationShell: boolean, platformOverride?: Platform): Promise<{ shell: string, args: string[] | string | undefined }> {
async getDefaultShellAndArgs(): Promise<{ shell: string, args: string[] | string | undefined }> {
return {
shell: 'bash',
args: undefined
@@ -1482,6 +1475,21 @@ export class TestTerminalInstanceService implements ITerminalInstanceService {
async getXtermUnicode11Constructor(): Promise<any> { throw new Error('Method not implemented.'); }
async getXtermWebglConstructor(): Promise<any> { throw new Error('Method not implemented.'); }
createWindowsShellHelper(shellProcessId: number, xterm: any): any { throw new Error('Method not implemented.'); }
}
export class TestLocalTerminalService implements ILocalTerminalService {
declare readonly _serviceBrand: undefined;
onPtyHostExit = Event.None;
onPtyHostUnresponsive = Event.None;
onPtyHostResponsive = Event.None;
onPtyHostRestart = Event.None;
async createTerminalProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, env: IProcessEnvironment, windowsEnableConpty: boolean, shouldPersist: boolean): Promise<ITerminalChildProcess> {
return new TestTerminalChildProcess(shouldPersist);
}
async attachToProcess(id: number): Promise<ITerminalChildProcess | undefined> { throw new Error('Method not implemented.'); }
setTerminalLayoutInfo(argsOrLayout?: ISetTerminalLayoutInfoArgs | ITerminalsLayoutInfoById): void { throw new Error('Method not implemented.'); }
async getTerminalLayoutInfo(): Promise<ITerminalsLayoutInfo | undefined> { throw new Error('Method not implemented.'); }