Path: blob/main/src/vs/workbench/contrib/debug/test/browser/mockDebugModel.ts
5228 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { DisposableStore } from '../../../../../base/common/lifecycle.js';6import { upcastPartial } from '../../../../../base/test/common/mock.js';7import { NullLogService } from '../../../../../platform/log/common/log.js';8import { UriIdentityService } from '../../../../../platform/uriIdentity/common/uriIdentityService.js';9import { ITextFileService } from '../../../../services/textfile/common/textfiles.js';10import { TestFileService, TestStorageService } from '../../../../test/common/workbenchTestServices.js';11import { DebugModel } from '../../common/debugModel.js';12import { MockDebugStorage } from '../common/mockDebug.js';1314const fileService = new TestFileService();15export const mockUriIdentityService = new UriIdentityService(fileService);1617export function createMockDebugModel(disposable: Pick<DisposableStore, 'add'>): DebugModel {18const storage = disposable.add(new TestStorageService());19const debugStorage = disposable.add(new MockDebugStorage(storage));20return disposable.add(new DebugModel(debugStorage, upcastPartial<ITextFileService>({ isDirty: (e: unknown) => false }), mockUriIdentityService, new NullLogService()));21}222324