4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
6
import { deepStrictEqual , strictEqual } from 'assert' ;
7
+ import { Event } from 'vs/base/common/event' ;
8
+ import { Disposable } from 'vs/base/common/lifecycle' ;
7
9
import { Schemas } from 'vs/base/common/network' ;
8
10
import { isWindows } from 'vs/base/common/platform' ;
9
11
import { URI } from 'vs/base/common/uri' ;
@@ -13,40 +15,18 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/
13
15
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock' ;
14
16
import { TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities' ;
15
17
import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore' ;
16
- import { IWorkspaceFolder , IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
18
+ import { ITerminalChildProcess , ITerminalProfile } from 'vs/platform/terminal/common/terminal' ;
19
+ import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace' ;
20
+ import { IViewDescriptorService } from 'vs/workbench/common/views' ;
17
21
import { ITerminalConfigurationService , ITerminalInstance , ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal' ;
18
22
import { TerminalConfigurationService } from 'vs/workbench/contrib/terminal/browser/terminalConfigurationService' ;
19
- import { TerminalLabelComputer , parseExitResult , TerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminalInstance' ;
20
- import { ProcessState , ITerminalProfileResolverService } from 'vs/workbench/contrib/terminal/common/terminal' ;
21
- import { fixPath } from 'vs/workbench/services/search/test/browser/queryBuilder.test' ;
22
- import { workbenchInstantiationService , TestEnvironmentService , TestLayoutService , TestLifecycleService , TestPathService , TestTerminalProfileResolverService } from 'vs/workbench/test/browser/workbenchTestServices' ;
23
- import { TestContextService , TestExtensionService , TestHistoryService , TestStorageService } from 'vs/workbench/test/common/workbenchTestServices' ;
24
- import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility' ;
25
- import { TestAccessibilityService } from 'vs/platform/accessibility/test/common/testAccessibilityService' ;
26
- import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService' ;
27
- import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
28
- import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService' ;
29
- import { IContextMenuService } from 'vs/platform/contextview/browser/contextView' ;
30
- import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
31
- import { MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService' ;
32
- import { ILayoutService } from 'vs/platform/layout/browser/layoutService' ;
33
- import { NullLogService } from 'vs/platform/log/common/log' ;
34
- import { IProductService } from 'vs/platform/product/common/productService' ;
35
- import { IStorageService } from 'vs/platform/storage/common/storage' ;
36
- import { ITerminalChildProcess , ITerminalLogService , ITerminalProfile } from 'vs/platform/terminal/common/terminal' ;
37
- import { IThemeService } from 'vs/platform/theme/common/themeService' ;
38
- import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService' ;
39
- import { IViewDescriptorService } from 'vs/workbench/common/views' ;
23
+ import { parseExitResult , TerminalInstance , TerminalLabelComputer } from 'vs/workbench/contrib/terminal/browser/terminalInstance' ;
40
24
import { IEnvironmentVariableService } from 'vs/workbench/contrib/terminal/common/environmentVariable' ;
41
25
import { EnvironmentVariableService } from 'vs/workbench/contrib/terminal/common/environmentVariableService' ;
42
- import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService' ;
43
- import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions' ;
44
- import { IHistoryService } from 'vs/workbench/services/history/common/history' ;
45
- import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle' ;
46
- import { IPathService } from 'vs/workbench/services/path/common/pathService' ;
47
- import { Event } from 'vs/base/common/event' ;
48
- import { Disposable } from 'vs/base/common/lifecycle' ;
26
+ import { ITerminalProfileResolverService , ProcessState } from 'vs/workbench/contrib/terminal/common/terminal' ;
49
27
import { TestViewDescriptorService } from 'vs/workbench/contrib/terminal/test/browser/xterm/xtermTerminal.test' ;
28
+ import { fixPath } from 'vs/workbench/services/search/test/browser/queryBuilder.test' ;
29
+ import { TestTerminalProfileResolverService , workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices' ;
50
30
51
31
const root1 = '/foo/root1' ;
52
32
const ROOT_1 = fixPath ( root1 ) ;
@@ -149,40 +129,25 @@ suite('Workbench - TerminalInstance', () => {
149
129
suite ( 'TerminalInstance' , ( ) => {
150
130
let terminalInstance : ITerminalInstance ;
151
131
test ( 'should create an instance of TerminalInstance with env from default profile' , async ( ) => {
152
- const instantiationService = workbenchInstantiationService ( undefined , store ) ;
153
- instantiationService . stub ( IConfigurationService , new TestConfigurationService ( {
154
- terminal : {
155
- integrated : {
156
- fontFamily : 'monospace' ,
157
- scrollback : 1000 ,
158
- fastScrollSensitivity : 2 ,
159
- mouseWheelScrollSensitivity : 1 ,
160
- unicodeVersion : '6' ,
161
- shellIntegration : {
162
- enabled : true
163
- } ,
164
- }
165
- } ,
166
- } ) ) ;
167
- instantiationService . stub ( IContextKeyService , store . add ( instantiationService . createInstance ( ContextKeyService ) ) ) ;
168
- instantiationService . stub ( IWorkbenchEnvironmentService , TestEnvironmentService ) ;
169
- const mockTerminalProfileResolverService = new MockTerminalProfileResolverService ( ) ;
170
- instantiationService . set ( ITerminalProfileResolverService , mockTerminalProfileResolverService ) ;
171
- instantiationService . stub ( IWorkspaceContextService , new TestContextService ( ) ) ;
172
- instantiationService . stub ( IHistoryService , new TestHistoryService ( ) ) ;
173
- instantiationService . stub ( ITerminalLogService , store . add ( new NullLogService ( ) ) ) ;
174
- instantiationService . stub ( IKeybindingService , new MockKeybindingService ( ) ) ;
175
- instantiationService . stub ( ITerminalConfigurationService , store . add ( instantiationService . createInstance ( TerminalConfigurationService ) ) ) ;
176
- instantiationService . stub ( ILayoutService , new TestLayoutService ( ) ) ;
177
- instantiationService . stub ( IThemeService , new TestThemeService ( ) ) ;
132
+ const instantiationService = workbenchInstantiationService ( {
133
+ configurationService : ( ) => new TestConfigurationService ( {
134
+ files : { } ,
135
+ terminal : {
136
+ integrated : {
137
+ fontFamily : 'monospace' ,
138
+ scrollback : 1000 ,
139
+ fastScrollSensitivity : 2 ,
140
+ mouseWheelScrollSensitivity : 1 ,
141
+ unicodeVersion : '6' ,
142
+ shellIntegration : {
143
+ enabled : true
144
+ } ,
145
+ }
146
+ } ,
147
+ } )
148
+ } , store ) ;
149
+ instantiationService . set ( ITerminalProfileResolverService , new MockTerminalProfileResolverService ( ) ) ;
178
150
instantiationService . stub ( IViewDescriptorService , new TestViewDescriptorService ( ) ) ;
179
- instantiationService . stub ( ILifecycleService , store . add ( new TestLifecycleService ( ) ) ) ;
180
- instantiationService . stub ( IContextMenuService , store . add ( instantiationService . createInstance ( ContextMenuService ) ) ) ;
181
- instantiationService . stub ( IAccessibilityService , new TestAccessibilityService ( ) ) ;
182
- instantiationService . stub ( IPathService , new TestPathService ( ) ) ;
183
- instantiationService . stub ( IProductService , { } ) ;
184
- instantiationService . stub ( IExtensionService , new TestExtensionService ( ) ) ;
185
- instantiationService . stub ( IStorageService , store . add ( new TestStorageService ( ) ) ) ;
186
151
instantiationService . stub ( IEnvironmentVariableService , store . add ( instantiationService . createInstance ( EnvironmentVariableService ) ) ) ;
187
152
instantiationService . stub ( ITerminalInstanceService , store . add ( new TestTerminalInstanceService ( ) ) ) ;
188
153
terminalInstance = store . add ( instantiationService . createInstance ( TerminalInstance , terminalShellTypeContextKey , terminalInRunCommandPicker , { } ) ) ;
0 commit comments