mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 00:59:03 +01:00
debug: adopt external changes (#190602)
For #183449 Also adds the leak detector to debug tests and fixes some usages of it (#190503)
This commit is contained in:
@@ -5,27 +5,28 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService';
|
||||
import { FileService } from 'vs/platform/files/common/fileService';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
|
||||
import { ConfigurationManager } from 'vs/workbench/contrib/debug/browser/debugConfigurationManager';
|
||||
import { DebugConfigurationProviderTriggerKind, IAdapterManager, IConfig, IDebugAdapterExecutable, IDebugSession } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
|
||||
import { TestHistoryService, TestQuickInputService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestContextService, TestExtensionService, TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
suite('debugConfigurationManager', () => {
|
||||
const configurationProviderType = 'custom-type';
|
||||
let _debugConfigurationManager: ConfigurationManager;
|
||||
const disposables = new DisposableStore();
|
||||
let disposables: DisposableStore;
|
||||
|
||||
const adapterManager = <IAdapterManager>{
|
||||
getDebugAdapterDescriptor(session: IDebugSession, config: IConfig): Promise<IDebugAdapterExecutable | undefined> {
|
||||
@@ -47,6 +48,7 @@ suite('debugConfigurationManager', () => {
|
||||
|
||||
const configurationService = new TestConfigurationService();
|
||||
setup(() => {
|
||||
disposables = new DisposableStore();
|
||||
const fileService = disposables.add(new FileService(new NullLogService()));
|
||||
const instantiationService = disposables.add(new TestInstantiationService(new ServiceCollection([IPreferencesService, preferencesService], [IConfigurationService, configurationService])));
|
||||
_debugConfigurationManager = new ConfigurationManager(
|
||||
@@ -62,6 +64,10 @@ suite('debugConfigurationManager', () => {
|
||||
new ContextKeyService(configurationService));
|
||||
});
|
||||
|
||||
teardown(() => disposables.dispose());
|
||||
|
||||
ensureNoDisposablesAreLeakedInTestSuite();
|
||||
|
||||
test('resolves configuration based on type', async () => {
|
||||
disposables.add(_debugConfigurationManager.registerDebugConfigurationProvider({
|
||||
type: configurationProviderType,
|
||||
|
||||
Reference in New Issue
Block a user