Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
eec2a015
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,发现更多精彩内容 >>
提交
eec2a015
编写于
5月 22, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix commented tests
上级
96903e33
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
44 deletion
+38
-44
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
...ration/test/electron-browser/configurationService.test.ts
+38
-44
未找到文件。
src/vs/workbench/services/configuration/test/electron-browser/configurationService.test.ts
浏览文件 @
eec2a015
...
...
@@ -1443,17 +1443,17 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
'
id
'
:
'
_test
'
,
'
type
'
:
'
object
'
,
'
properties
'
:
{
'
configurationService.
folder
.applicationSetting
'
:
{
'
configurationService.
remote
.applicationSetting
'
:
{
'
type
'
:
'
string
'
,
'
default
'
:
'
isSet
'
,
scope
:
ConfigurationScope
.
APPLICATION
},
'
configurationService.
folder
.machineSetting
'
:
{
'
configurationService.
remote
.machineSetting
'
:
{
'
type
'
:
'
string
'
,
'
default
'
:
'
isSet
'
,
scope
:
ConfigurationScope
.
MACHINE
},
'
configurationService.
folder
.testSetting
'
:
{
'
configurationService.
remote
.testSetting
'
:
{
'
type
'
:
'
string
'
,
'
default
'
:
'
isSet
'
,
scope
:
ConfigurationScope
.
RESOURCE
...
...
@@ -1495,10 +1495,19 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
testObject
.
acquireInstantiationService
(
instantiationService
);
}
function
registerRem
to
eFileSystemProvider
():
void
{
function
registerRem
ot
eFileSystemProvider
():
void
{
instantiationService
.
get
(
IFileService
).
registerProvider
(
Schemas
.
vscodeRemote
,
new
RemoteFileSystemProvider
(
diskFileSystemProvider
,
remoteAuthority
));
}
function
registerRemoteFileSystemProviderOnActivation
():
void
{
const
disposable
=
instantiationService
.
get
(
IFileService
).
onWillActivateFileSystemProvider
(
e
=>
{
if
(
e
.
scheme
===
Schemas
.
vscodeRemote
)
{
disposable
.
dispose
();
e
.
join
(
Promise
.
resolve
().
then
(()
=>
registerRemoteFileSystemProvider
()));
}
});
}
teardown
(()
=>
{
if
(
testObject
)
{
(
<
WorkspaceService
>
testObject
).
dispose
();
...
...
@@ -1510,23 +1519,31 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
});
test
(
'
remote settings override globals
'
,
async
()
=>
{
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.folder.machineSetting": "remoteValue" }
'
);
registerRemtoeFileSystemProvider
();
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.remote.machineSetting": "remoteValue" }
'
);
registerRemoteFileSystemProvider
();
resolveRemoteEnvironment
();
await
initialize
();
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.remote.machineSetting
'
),
'
remoteValue
'
);
});
test
(
'
remote settings override globals after remote provider is registered on activation
'
,
async
()
=>
{
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.remote.machineSetting": "remoteValue" }
'
);
resolveRemoteEnvironment
();
registerRemoteFileSystemProviderOnActivation
();
await
initialize
();
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
folder
.machineSetting
'
),
'
remoteValue
'
);
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
remote
.machineSetting
'
),
'
remoteValue
'
);
});
test
(
'
remote settings override globals after remote environment is resolved
'
,
async
()
=>
{
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.
folder
.machineSetting": "remoteValue" }
'
);
registerRem
to
eFileSystemProvider
();
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.
remote
.machineSetting": "remoteValue" }
'
);
registerRem
ot
eFileSystemProvider
();
await
initialize
();
const
promise
=
new
Promise
((
c
,
e
)
=>
{
testObject
.
onDidChangeConfiguration
(
event
=>
{
try
{
assert
.
equal
(
event
.
source
,
ConfigurationTarget
.
USER
);
assert
.
deepEqual
(
event
.
affectedKeys
,
[
'
configurationService.
folder
.machineSetting
'
]);
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
folder
.machineSetting
'
),
'
remoteValue
'
);
assert
.
deepEqual
(
event
.
affectedKeys
,
[
'
configurationService.
remote
.machineSetting
'
]);
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
remote
.machineSetting
'
),
'
remoteValue
'
);
c
();
}
catch
(
error
)
{
e
(
error
);
...
...
@@ -1537,38 +1554,16 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
return
promise
;
});
/*
// comment this test as it is failing
test('remote settings override globals after remote provider is registered', async () => {
fs.writeFileSync(remoteSettingsFile, '{ "configurationService.folder.machineSetting": "remoteValue" }');
resolveRemoteEnvironment();
await initialize();
const promise = new Promise((c, e) => {
testObject.onDidChangeConfiguration(event => {
try {
assert.equal(event.source, ConfigurationTarget.USER);
assert.deepEqual(event.affectedKeys, ['configurationService.folder.machineSetting']);
assert.equal(testObject.getValue('configurationService.folder.machineSetting'), 'remoteValue');
c();
} catch (error) {
e(error);
}
});
});
registerRemtoeFileSystemProvider();
return promise;
});
*/
test
(
'
remote settings override globals after remote provider is registered and remote environment is resolved
'
,
async
()
=>
{
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.folder.machineSetting": "remoteValue" }
'
);
test
(
'
remote settings override globals after remote provider is registered on activation and remote environment is resolved
'
,
async
()
=>
{
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.remote.machineSetting": "remoteValue" }
'
);
registerRemoteFileSystemProviderOnActivation
();
await
initialize
();
const
promise
=
new
Promise
((
c
,
e
)
=>
{
testObject
.
onDidChangeConfiguration
(
event
=>
{
try
{
assert
.
equal
(
event
.
source
,
ConfigurationTarget
.
USER
);
assert
.
deepEqual
(
event
.
affectedKeys
,
[
'
configurationService.
folder
.machineSetting
'
]);
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
folder
.machineSetting
'
),
'
remoteValue
'
);
assert
.
deepEqual
(
event
.
affectedKeys
,
[
'
configurationService.
remote
.machineSetting
'
]);
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
remote
.machineSetting
'
),
'
remoteValue
'
);
c
();
}
catch
(
error
)
{
e
(
error
);
...
...
@@ -1576,28 +1571,27 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
});
});
resolveRemoteEnvironment
();
registerRemtoeFileSystemProvider
();
return
promise
;
});
test
(
'
update remote settings
'
,
async
()
=>
{
registerRem
to
eFileSystemProvider
();
registerRem
ot
eFileSystemProvider
();
resolveRemoteEnvironment
();
await
initialize
();
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
folder
.machineSetting
'
),
'
isSet
'
);
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
remote
.machineSetting
'
),
'
isSet
'
);
const
promise
=
new
Promise
((
c
,
e
)
=>
{
testObject
.
onDidChangeConfiguration
(
event
=>
{
try
{
assert
.
equal
(
event
.
source
,
ConfigurationTarget
.
USER
);
assert
.
deepEqual
(
event
.
affectedKeys
,
[
'
configurationService.
folder
.machineSetting
'
]);
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
folder
.machineSetting
'
),
'
remoteValue
'
);
assert
.
deepEqual
(
event
.
affectedKeys
,
[
'
configurationService.
remote
.machineSetting
'
]);
assert
.
equal
(
testObject
.
getValue
(
'
configurationService.
remote
.machineSetting
'
),
'
remoteValue
'
);
c
();
}
catch
(
error
)
{
e
(
error
);
}
});
});
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.
folder
.machineSetting": "remoteValue" }
'
);
fs
.
writeFileSync
(
remoteSettingsFile
,
'
{ "configurationService.
remote
.machineSetting": "remoteValue" }
'
);
return
promise
;
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录