fix missing IThemeService in tests

This commit is contained in:
Martin Aeschlimann
2020-03-15 23:21:21 +01:00
parent 556eb1ee3d
commit 4b800f014d
8 changed files with 23 additions and 2 deletions
@@ -18,6 +18,8 @@ import { IFileMatch } from 'vs/workbench/services/search/common/search';
import { ReplaceAction } from 'vs/workbench/contrib/search/browser/searchActions';
import { FileMatch, FileMatchOrMatch, Match } from 'vs/workbench/contrib/search/common/searchModel';
import { MockObjectTree } from 'vs/workbench/contrib/search/test/browser/mockSearchTree';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
suite('Search Actions', () => {
@@ -153,6 +155,7 @@ suite('Search Actions', () => {
function stubModelService(instantiationService: TestInstantiationService): IModelService {
instantiationService.stub(IConfigurationService, new TestConfigurationService());
instantiationService.stub(IThemeService, new TestThemeService());
return instantiationService.createInstance(ModelServiceImpl);
}
});
@@ -15,6 +15,8 @@ import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
import { FileMatch, Match, searchMatchComparer, SearchResult } from 'vs/workbench/contrib/search/common/searchModel';
import { isWindows } from 'vs/base/common/platform';
import { TestContextService } from 'vs/workbench/test/common/workbenchTestServices';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
suite('Search - Viewlet', () => {
let instantiation: TestInstantiationService;
@@ -105,6 +107,7 @@ suite('Search - Viewlet', () => {
function stubModelService(instantiationService: TestInstantiationService): IModelService {
instantiationService.stub(IConfigurationService, new TestConfigurationService());
instantiationService.stub(IThemeService, new TestThemeService());
return instantiationService.createInstance(ModelServiceImpl);
}
});
@@ -19,6 +19,8 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
import { SearchModel } from 'vs/workbench/contrib/search/common/searchModel';
import * as process from 'vs/base/common/process';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
const nullEvent = new class {
id: number = -1;
@@ -328,6 +330,7 @@ suite('SearchModel', () => {
function stubModelService(instantiationService: TestInstantiationService): IModelService {
instantiationService.stub(IConfigurationService, new TestConfigurationService());
instantiationService.stub(IThemeService, new TestThemeService());
return instantiationService.createInstance(ModelServiceImpl);
}
@@ -16,6 +16,8 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IReplaceService } from 'vs/workbench/contrib/search/common/replace';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
const lineOneRange = new OneLineRange(1, 0, 1);
@@ -352,6 +354,7 @@ suite('SearchResult', () => {
function stubModelService(instantiationService: TestInstantiationService): IModelService {
instantiationService.stub(IConfigurationService, new TestConfigurationService());
instantiationService.stub(IThemeService, new TestThemeService());
return instantiationService.createInstance(ModelServiceImpl);
}
});
@@ -55,6 +55,8 @@ import { WorkingCopyFileService, IWorkingCopyFileService } from 'vs/workbench/se
import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
import { UndoRedoService } from 'vs/platform/undoRedo/common/undoRedoService';
import { TestTextResourcePropertiesService, TestContextService, TestWorkingCopyService } from 'vs/workbench/test/common/workbenchTestServices';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
class TestEnvironmentService extends NativeWorkbenchEnvironmentService {
@@ -107,6 +109,7 @@ suite('KeybindingsEditing', () => {
instantiationService.stub(IFilesConfigurationService, instantiationService.createInstance(FilesConfigurationService));
instantiationService.stub(ITextResourcePropertiesService, new TestTextResourcePropertiesService(instantiationService.get(IConfigurationService)));
instantiationService.stub(IUndoRedoService, instantiationService.createInstance(UndoRedoService));
instantiationService.stub(IThemeService, new TestThemeService());
instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl));
const fileService = new FileService(new NullLogService());
const diskFileSystemProvider = new DiskFileSystemProvider(new NullLogService());
@@ -24,6 +24,8 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { TestTextResourcePropertiesService } from 'vs/workbench/test/common/workbenchTestServices';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
class MyEditorModel extends EditorModel { }
class MyTextEditorModel extends BaseTextEditorModel {
@@ -84,6 +86,7 @@ suite('Workbench editor model', () => {
instantiationService.stub(IDialogService, dialogService);
instantiationService.stub(INotificationService, notificationService);
instantiationService.stub(IUndoRedoService, undoRedoService);
instantiationService.stub(IThemeService, new TestThemeService());
return instantiationService.createInstance(ModelServiceImpl);
}
});
@@ -22,6 +22,8 @@ import { CoreNavigationCommands } from 'vs/editor/browser/controller/coreCommand
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { createTextModel } from 'vs/editor/test/common/editorTestUtils';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
suite('Editor - Range decorations', () => {
@@ -157,6 +159,7 @@ suite('Editor - Range decorations', () => {
function stubModelService(instantiationService: TestInstantiationService): IModelService {
instantiationService.stub(IConfigurationService, new TestConfigurationService());
instantiationService.stub(IThemeService, new TestThemeService());
return instantiationService.createInstance(ModelServiceImpl);
}
});
@@ -141,6 +141,8 @@ export function workbenchInstantiationService(overrides?: { textFileService?: (i
instantiationService.stub(IHistoryService, new TestHistoryService());
instantiationService.stub(ITextResourcePropertiesService, new TestTextResourcePropertiesService(configService));
instantiationService.stub(IUndoRedoService, instantiationService.createInstance(UndoRedoService));
const themeService = new TestThemeService();
instantiationService.stub(IThemeService, themeService);
instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl));
instantiationService.stub(IFileService, new TestFileService());
instantiationService.stub(IBackupFileService, new TestBackupFileService());
@@ -156,8 +158,6 @@ export function workbenchInstantiationService(overrides?: { textFileService?: (i
instantiationService.stub(ITextFileService, overrides?.textFileService ? overrides.textFileService(instantiationService) : <ITextFileService>instantiationService.createInstance(TestTextFileService));
instantiationService.stub(IHostService, <IHostService>instantiationService.createInstance(TestHostService));
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
const themeService = new TestThemeService();
instantiationService.stub(IThemeService, themeService);
instantiationService.stub(ILogService, new NullLogService());
const editorGroupService = new TestEditorGroupsService([new TestEditorGroupView(0)]);
instantiationService.stub(IEditorGroupsService, editorGroupService);