提交 d6b99429 编写于 作者: C Christof Marti

Ensure telemetry service is available in affected tests (#15321)

上级 cf5c0115
......@@ -354,6 +354,7 @@ export class TestEditorGroupService implements IEditorGroupService {
services.set(IWorkspaceContextService, new TestContextService());
const lifecycle = new TestLifecycleService();
services.set(ILifecycleService, lifecycle);
services.set(ITelemetryService, NullTelemetryService);
let inst = new InstantiationService(services);
......
......@@ -1122,9 +1122,7 @@ export class EditorStacksModel implements IEditorStacksModel {
}
private handleOnEditorOpened(editor: EditorInput): void {
if (this.telemetryService) {
this.telemetryService.publicLog('editorOpened', editor.getTelemetryDescriptor());
}
this.telemetryService.publicLog('editorOpened', editor.getTelemetryDescriptor());
}
private handleOnEditorClosed(event: GroupEvent): void {
......@@ -1144,9 +1142,7 @@ export class EditorStacksModel implements IEditorStacksModel {
}
}
if (this.telemetryService) {
this.telemetryService.publicLog('editorClosed', editor.getTelemetryDescriptor());
}
this.telemetryService.publicLog('editorClosed', editor.getTelemetryDescriptor());
}
public isOpen(resource: URI): boolean;
......
......@@ -19,6 +19,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace
import { Registry } from 'vs/platform/platform';
import { Position, Direction } from 'vs/platform/editor/common/editor';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITelemetryService, NullTelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
import 'vs/workbench/browser/parts/editor/baseEditor';
......@@ -27,6 +28,7 @@ function create(): EditorStacksModel {
inst.stub(IStorageService, new TestStorageService());
inst.stub(ILifecycleService, new TestLifecycleService());
inst.stub(IWorkspaceContextService, new TestContextService());
inst.stub(ITelemetryService, NullTelemetryService);
const config = new TestConfigurationService();
config.setUserConfiguration('workbench', { editor: { openPositioning: 'right' } });
......@@ -641,6 +643,7 @@ suite('Editor Stacks Model', () => {
inst.stub(IStorageService, new TestStorageService());
inst.stub(ILifecycleService, new TestLifecycleService());
inst.stub(IWorkspaceContextService, new TestContextService());
inst.stub(ITelemetryService, NullTelemetryService);
const config = new TestConfigurationService();
inst.stub(IConfigurationService, config);
......@@ -1175,6 +1178,8 @@ suite('Editor Stacks Model', () => {
inst.stub(IWorkspaceContextService, new TestContextService());
const lifecycle = new TestLifecycleService();
inst.stub(ILifecycleService, lifecycle);
inst.stub(ITelemetryService, NullTelemetryService);
const config = new TestConfigurationService();
config.setUserConfiguration('workbench', { editor: { openPositioning: 'right' } });
inst.stub(IConfigurationService, config);
......@@ -1217,6 +1222,8 @@ suite('Editor Stacks Model', () => {
inst.stub(IWorkspaceContextService, new TestContextService());
const lifecycle = new TestLifecycleService();
inst.stub(ILifecycleService, lifecycle);
inst.stub(ITelemetryService, NullTelemetryService);
const config = new TestConfigurationService();
config.setUserConfiguration('workbench', { editor: { openPositioning: 'right' } });
inst.stub(IConfigurationService, config);
......@@ -1298,6 +1305,8 @@ suite('Editor Stacks Model', () => {
inst.stub(IWorkspaceContextService, new TestContextService());
const lifecycle = new TestLifecycleService();
inst.stub(ILifecycleService, lifecycle);
inst.stub(ITelemetryService, NullTelemetryService);
const config = new TestConfigurationService();
config.setUserConfiguration('workbench', { editor: { openPositioning: 'right' } });
inst.stub(IConfigurationService, config);
......@@ -1347,6 +1356,8 @@ suite('Editor Stacks Model', () => {
inst.stub(IWorkspaceContextService, new TestContextService());
const lifecycle = new TestLifecycleService();
inst.stub(ILifecycleService, lifecycle);
inst.stub(ITelemetryService, NullTelemetryService);
const config = new TestConfigurationService();
config.setUserConfiguration('workbench', { editor: { openPositioning: 'right' } });
inst.stub(IConfigurationService, config);
......@@ -1387,6 +1398,8 @@ suite('Editor Stacks Model', () => {
inst.stub(IStorageService, new TestStorageService());
const lifecycle = new TestLifecycleService();
inst.stub(ILifecycleService, lifecycle);
inst.stub(ITelemetryService, NullTelemetryService);
const config = new TestConfigurationService();
config.setUserConfiguration('workbench', { editor: { openPositioning: 'right' } });
inst.stub(IConfigurationService, config);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册