Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a2efefd3
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a2efefd3
编写于
1月 11, 2021
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use in-mem fsp - workspace tests
上级
e3b18fa3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
30 deletion
+29
-30
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
...ration/test/electron-browser/configurationService.test.ts
+29
-30
未找到文件。
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
浏览文件 @
a2efefd3
...
...
@@ -161,43 +161,42 @@ suite('WorkspaceContextService - Folder', () => {
suite
(
'
WorkspaceContextService - Workspace
'
,
()
=>
{
let
parentResource
:
string
,
testObject
:
WorkspaceService
,
instantiationService
:
TestInstantiation
Service
;
let
testObject
:
Workspace
Service
;
const
disposables
=
new
DisposableStore
();
setup
(()
=>
{
return
setUpWorkspace
([
'
a
'
,
'
b
'
])
.
then
(({
parentDir
,
configPath
})
=>
{
parentResource
=
parentDir
;
setup
(
async
()
=>
{
const
logService
=
new
NullLogService
();
const
fileService
=
disposables
.
add
(
new
FileService
(
logService
));
const
fileSystemProvider
=
disposables
.
add
(
new
InMemoryFileSystemProvider
());
fileService
.
registerProvider
(
Schemas
.
file
,
fileSystemProvider
)
;
instantiationService
=
<
TestInstantiationService
>
workbenchInstantiationService
();
const
environmentService
=
new
TestWorkbenchEnvironmentService
(
URI
.
file
(
parentDir
));
const
remoteAgentService
=
instantiationService
.
createInstance
(
RemoteAgentService
);
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
const
fileService
=
disposables
.
add
(
new
FileService
(
new
NullLogService
()));
const
diskFileSystemProvider
=
disposables
.
add
(
new
DiskFileSystemProvider
(
new
NullLogService
()));
fileService
.
registerProvider
(
Schemas
.
file
,
diskFileSystemProvider
);
fileService
.
registerProvider
(
Schemas
.
userData
,
disposables
.
add
(
new
FileUserDataProvider
(
Schemas
.
file
,
diskFileSystemProvider
,
Schemas
.
userData
,
new
NullLogService
())));
const
workspaceService
=
disposables
.
add
(
new
WorkspaceService
({
configurationCache
:
new
ConfigurationCache
(
environmentService
,
fileService
)
},
environmentService
,
fileService
,
remoteAgentService
,
new
UriIdentityService
(
fileService
),
new
NullLogService
()));
const
appSettingsHome
=
URI
.
file
(
'
user
'
);
const
folderA
=
URI
.
file
(
'
a
'
);
const
folderB
=
URI
.
file
(
'
b
'
);
const
configResource
=
URI
.
file
(
'
vsctests.code-workspace
'
);
const
workspace
=
{
folders
:
[{
path
:
folderA
.
path
},
{
path
:
folderB
.
path
}]
};
await
fileService
.
createFolder
(
appSettingsHome
);
await
fileService
.
createFolder
(
folderA
);
await
fileService
.
createFolder
(
folderB
);
await
fileService
.
writeFile
(
configResource
,
VSBuffer
.
fromString
(
JSON
.
stringify
(
workspace
,
null
,
'
\t
'
)));
const
instantiationService
=
<
TestInstantiationService
>
workbenchInstantiationService
();
const
environmentService
=
new
TestWorkbenchEnvironmentService
(
appSettingsHome
);
const
remoteAgentService
=
disposables
.
add
(
instantiationService
.
createInstance
(
RemoteAgentService
));
instantiationService
.
stub
(
IRemoteAgentService
,
remoteAgentService
);
fileService
.
registerProvider
(
Schemas
.
userData
,
disposables
.
add
(
new
FileUserDataProvider
(
Schemas
.
file
,
fileSystemProvider
,
Schemas
.
userData
,
new
NullLogService
())));
testObject
=
disposables
.
add
(
new
WorkspaceService
({
configurationCache
:
new
ConfigurationCache
(
environmentService
,
fileService
)
},
environmentService
,
fileService
,
remoteAgentService
,
new
UriIdentityService
(
fileService
),
new
NullLogService
()));
instantiationService
.
stub
(
IWorkspaceContextService
,
workspaceService
);
instantiationService
.
stub
(
IConfigurationService
,
workspaceService
);
instantiationService
.
stub
(
IEnvironmentService
,
environmentService
);
instantiationService
.
stub
(
IWorkspaceContextService
,
testObject
);
instantiationService
.
stub
(
IConfigurationService
,
testObject
);
instantiationService
.
stub
(
IEnvironmentService
,
environmentService
);
return
workspaceService
.
initialize
(
getWorkspaceIdentifier
(
configPath
)).
then
(()
=>
{
workspaceService
.
acquireInstantiationService
(
instantiationService
);
testObject
=
workspaceService
;
});
});
await
testObject
.
initialize
(
getWorkspaceIdentifier
(
configResource
));
testObject
.
acquireInstantiationService
(
instantiationService
);
});
teardown
(()
=>
{
disposables
.
clear
();
if
(
parentResource
)
{
return
pfs
.
rimraf
(
parentResource
);
}
return
undefined
;
});
teardown
(()
=>
disposables
.
clear
());
test
(
'
workspace folders
'
,
()
=>
{
const
actual
=
testObject
.
getWorkspace
().
folders
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录