Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6cb1643f
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,发现更多精彩内容 >>
提交
6cb1643f
编写于
9月 08, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests cleanup
上级
73f1b30d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
34 addition
and
24 deletion
+34
-24
src/vs/base/test/browser/builder.test.ts
src/vs/base/test/browser/builder.test.ts
+2
-2
src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts
...kbench/parts/files/test/browser/fileEditorTracker.test.ts
+8
-4
src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts
...vs/workbench/test/browser/parts/editor/baseEditor.test.ts
+5
-5
src/vs/workbench/test/common/editor/editorModel.test.ts
src/vs/workbench/test/common/editor/editorModel.test.ts
+5
-5
src/vs/workbench/test/common/editor/stringEditorInput.test.ts
...vs/workbench/test/common/editor/stringEditorInput.test.ts
+5
-5
src/vs/workbench/test/common/editor/stringEditorModel.test.ts
...vs/workbench/test/common/editor/stringEditorModel.test.ts
+3
-3
src/vs/workbench/test/common/editor/untitledEditor.test.ts
src/vs/workbench/test/common/editor/untitledEditor.test.ts
+6
-0
未找到文件。
src/vs/base/test/browser/builder.test.ts
浏览文件 @
6cb1643f
...
...
@@ -810,7 +810,7 @@ suite('Builder', () => {
b
.
showDelayed
(
20
);
assert
(
b
.
hasClass
(
'
hidden
'
));
TPromise
.
timeout
(
30
).
then
(
function
()
{
TPromise
.
timeout
(
30
).
then
(
()
=>
{
assert
(
!
b
.
hasClass
(
'
hidden
'
));
done
();
});
...
...
@@ -825,7 +825,7 @@ suite('Builder', () => {
b
.
hide
();
// Should cancel the visibility promise
TPromise
.
timeout
(
30
).
then
(
function
()
{
TPromise
.
timeout
(
30
).
then
(
()
=>
{
assert
(
b
.
hasClass
(
'
hidden
'
));
done
();
});
...
...
src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts
浏览文件 @
6cb1643f
...
...
@@ -37,8 +37,8 @@ suite('Files - FileEditorTracker', () => {
const
inputToResolve
=
instantiationService
.
createInstance
(
FileEditorInput
,
toResource
(
'
/fooss5/bar/file2.js
'
),
'
text/javascript
'
,
void
0
);
const
sameOtherInput
=
instantiationService
.
createInstance
(
FileEditorInput
,
toResource
(
'
/fooss5/bar/file2.js
'
),
'
text/javascript
'
,
void
0
);
return
accessor
.
editorService
.
resolveEditorModel
(
inputToResolve
).
then
(
function
(
resolved
)
{
return
accessor
.
editorService
.
resolveEditorModel
(
sameOtherInput
).
then
(
function
(
resolved
)
{
return
accessor
.
editorService
.
resolveEditorModel
(
inputToResolve
).
then
(
(
resolved
)
=>
{
return
accessor
.
editorService
.
resolveEditorModel
(
sameOtherInput
).
then
(
resolved
=>
{
tracker
.
handleDeleteOrMove
(
toResource
(
'
/bar
'
));
assert
(
!
inputToResolve
.
isDisposed
());
assert
(
!
sameOtherInput
.
isDisposed
());
...
...
@@ -48,6 +48,8 @@ suite('Files - FileEditorTracker', () => {
assert
(
inputToResolve
.
isDisposed
());
assert
(
sameOtherInput
.
isDisposed
());
resolved
.
dispose
();
done
();
});
});
...
...
@@ -58,8 +60,8 @@ suite('Files - FileEditorTracker', () => {
const
inputToResolve
=
instantiationService
.
createInstance
(
FileEditorInput
,
toResource
(
'
/foo6/bar/file.js
'
),
'
text/javascript
'
,
void
0
);
const
sameOtherInput
=
instantiationService
.
createInstance
(
FileEditorInput
,
toResource
(
'
/foo6/bar/file.js
'
),
'
text/javascript
'
,
void
0
);
return
accessor
.
editorService
.
resolveEditorModel
(
inputToResolve
,
true
).
then
(
function
(
resolved
)
{
return
accessor
.
editorService
.
resolveEditorModel
(
sameOtherInput
,
true
).
then
(
function
(
resolved
)
{
return
accessor
.
editorService
.
resolveEditorModel
(
inputToResolve
,
true
).
then
(
resolved
=>
{
return
accessor
.
editorService
.
resolveEditorModel
(
sameOtherInput
,
true
).
then
(
resolved
=>
{
tracker
.
handleDeleteOrMove
(
toResource
(
'
/bar
'
));
assert
(
!
inputToResolve
.
isDisposed
());
assert
(
!
sameOtherInput
.
isDisposed
());
...
...
@@ -69,6 +71,8 @@ suite('Files - FileEditorTracker', () => {
assert
(
inputToResolve
.
isDisposed
());
assert
(
sameOtherInput
.
isDisposed
());
resolved
.
dispose
();
done
();
});
});
...
...
src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts
浏览文件 @
6cb1643f
...
...
@@ -134,13 +134,13 @@ suite('Workbench BaseEditor', () => {
assert
(
!
e
.
isVisible
());
assert
(
!
e
.
getInput
());
assert
(
!
e
.
getOptions
());
e
.
setInput
(
input
,
options
).
then
(
function
()
{
e
.
setInput
(
input
,
options
).
then
(
()
=>
{
assert
.
strictEqual
(
input
,
e
.
getInput
());
assert
.
strictEqual
(
options
,
e
.
getOptions
());
e
.
setVisible
(
true
);
assert
(
e
.
isVisible
());
input
.
addListener2
(
'
dispose
'
,
function
()
{
input
.
addListener2
(
'
dispose
'
,
()
=>
{
assert
(
false
);
});
e
.
dispose
();
...
...
@@ -192,10 +192,10 @@ suite('Workbench BaseEditor', () => {
let
inst
=
new
TestInstantiationService
();
inst
.
createInstance
(
EditorRegistry
.
getEditor
(
inst
.
createInstance
(
MyStringInput
,
'
fake
'
,
''
,
''
,
mime
.
MIME_TEXT
,
false
)),
'
id
'
).
then
(
function
(
editor
)
{
inst
.
createInstance
(
EditorRegistry
.
getEditor
(
inst
.
createInstance
(
MyStringInput
,
'
fake
'
,
''
,
''
,
mime
.
MIME_TEXT
,
false
)),
'
id
'
).
then
(
editor
=>
{
assert
.
strictEqual
(
editor
.
getId
(),
'
myEditor
'
);
return
inst
.
createInstance
(
EditorRegistry
.
getEditor
(
inst
.
createInstance
(
StringEditorInput
,
'
fake
'
,
''
,
''
,
mime
.
MIME_TEXT
,
false
)),
'
id
'
).
then
(
function
(
editor
)
{
return
inst
.
createInstance
(
EditorRegistry
.
getEditor
(
inst
.
createInstance
(
StringEditorInput
,
'
fake
'
,
''
,
''
,
mime
.
MIME_TEXT
,
false
)),
'
id
'
).
then
(
editor
=>
{
assert
.
strictEqual
(
editor
.
getId
(),
'
myOtherEditor
'
);
(
<
any
>
EditorRegistry
).
setEditors
(
oldEditors
);
...
...
@@ -213,7 +213,7 @@ suite('Workbench BaseEditor', () => {
let
inst
=
new
TestInstantiationService
();
inst
.
createInstance
(
EditorRegistry
.
getEditor
(
inst
.
createInstance
(
MyStringInput
,
'
fake
'
,
''
,
''
,
mime
.
MIME_TEXT
,
false
)),
'
id
'
).
then
(
function
(
editor
)
{
inst
.
createInstance
(
EditorRegistry
.
getEditor
(
inst
.
createInstance
(
MyStringInput
,
'
fake
'
,
''
,
''
,
mime
.
MIME_TEXT
,
false
)),
'
id
'
).
then
(
editor
=>
{
assert
.
strictEqual
(
'
myOtherEditor
'
,
editor
.
getId
());
(
<
any
>
EditorRegistry
).
setEditors
(
oldEditors
);
...
...
src/vs/workbench/test/common/editor/editorModel.test.ts
浏览文件 @
6cb1643f
...
...
@@ -31,7 +31,7 @@ suite('Workbench - EditorModel', () => {
test
(
'
EditorModel
'
,
function
(
done
)
{
let
m
=
new
MyEditorModel
();
m
.
load
().
then
(
function
(
model
)
{
m
.
load
().
then
(
model
=>
{
assert
(
model
===
m
);
assert
.
strictEqual
(
m
.
isResolved
(),
true
);
}).
done
(()
=>
done
());
...
...
@@ -41,9 +41,9 @@ suite('Workbench - EditorModel', () => {
let
modelService
=
createMockModelService
(
instantiationService
);
let
m
=
new
MyTextEditorModel
(
modelService
,
modeService
);
m
.
load
().
then
(
function
(
model
:
any
)
{
m
.
load
().
then
(
(
model
:
any
)
=>
{
assert
(
model
===
m
);
return
model
.
createTextEditorModel
(
'
foo
'
,
null
,
'
text/plain
'
).
then
(
function
()
{
return
model
.
createTextEditorModel
(
'
foo
'
,
null
,
'
text/plain
'
).
then
(
()
=>
{
assert
.
strictEqual
(
m
.
isResolved
(),
true
);
});
}).
done
(()
=>
{
...
...
@@ -58,7 +58,7 @@ suite('Workbench - EditorModel', () => {
let
otherInput
=
instantiationService
.
createInstance
(
StringEditorInput
,
'
name2
'
,
'
description
'
,
'
value2
'
,
'
text/plain
'
,
false
);
let
diffInput
=
new
DiffEditorInput
(
'
name
'
,
'
description
'
,
input
,
otherInput
);
diffInput
.
resolve
(
true
).
then
(
function
(
model
:
any
)
{
diffInput
.
resolve
(
true
).
then
(
(
model
:
any
)
=>
{
assert
(
model
);
assert
(
model
instanceof
TextDiffEditorModel
);
...
...
@@ -66,7 +66,7 @@ suite('Workbench - EditorModel', () => {
assert
(
diffEditorModel
.
original
);
assert
(
diffEditorModel
.
modified
);
return
diffInput
.
resolve
(
true
).
then
(
function
(
model
:
any
)
{
return
diffInput
.
resolve
(
true
).
then
(
(
model
:
any
)
=>
{
assert
(
model
.
isResolved
());
assert
(
diffEditorModel
!==
model
.
textDiffEditorModel
);
...
...
src/vs/workbench/test/common/editor/stringEditorInput.test.ts
浏览文件 @
6cb1643f
...
...
@@ -51,22 +51,22 @@ suite('Workbench - StringEditorInput', () => {
input
=
instantiationService
.
createInstance
(
StringEditorInput
,
'
name
'
,
'
description
'
,
'
value
'
,
'
mime
'
,
false
);
input
=
instantiationService
.
createInstance
(
StringEditorInput
,
'
name
'
,
'
description
'
,
'
value
'
,
'
mime
'
,
false
);
editorService
.
resolveEditorModel
(
input
,
true
).
then
(
function
(
resolved
)
{
editorService
.
resolveEditorModel
(
input
,
true
).
then
(
resolved
=>
{
let
resolvedModelA
=
resolved
;
return
editorService
.
resolveEditorModel
(
input
,
true
).
then
(
function
(
resolved
)
{
return
editorService
.
resolveEditorModel
(
input
,
true
).
then
(
resolved
=>
{
assert
(
resolvedModelA
===
resolved
);
// assert: Resolved Model cached per instance
let
otherInput
=
instantiationService
.
createInstance
(
StringEditorInput
,
'
name
'
,
'
description
'
,
'
value
'
,
'
mime
'
,
false
);
return
editorService
.
resolveEditorModel
(
otherInput
,
true
).
then
(
function
(
resolved
)
{
return
editorService
.
resolveEditorModel
(
otherInput
,
true
).
then
(
resolved
=>
{
assert
(
resolvedModelA
!==
resolved
);
// NOT assert: Different instance, different model
input
.
dispose
();
return
editorService
.
resolveEditorModel
(
input
,
true
).
then
(
function
(
resolved
)
{
return
editorService
.
resolveEditorModel
(
input
,
true
).
then
(
resolved
=>
{
assert
(
resolvedModelA
!==
resolved
);
// Different instance, because input got disposed
let
model
=
(
<
any
>
resolved
).
textEditorModel
;
return
editorService
.
resolveEditorModel
(
input
,
true
).
then
(
function
(
againResolved
)
{
return
editorService
.
resolveEditorModel
(
input
,
true
).
then
(
againResolved
=>
{
assert
(
model
===
(
<
any
>
againResolved
).
textEditorModel
);
// Models should not differ because string input is constant
input
.
dispose
();
...
...
src/vs/workbench/test/common/editor/stringEditorModel.test.ts
浏览文件 @
6cb1643f
...
...
@@ -24,7 +24,7 @@ suite('Workbench - StringEditorModel', () => {
test
(
'
StringEditorModel
'
,
function
(
done
)
{
instantiationService
.
stub
(
IModelService
,
createMockModelService
(
instantiationService
));
let
m
=
instantiationService
.
createInstance
(
StringEditorModel
,
'
value
'
,
'
mime
'
,
null
);
m
.
load
().
then
(
function
(
model
)
{
m
.
load
().
then
(
model
=>
{
assert
(
model
===
m
);
let
textEditorModel
=
m
.
textEditorModel
;
...
...
@@ -33,7 +33,7 @@ suite('Workbench - StringEditorModel', () => {
assert
.
strictEqual
(
m
.
isResolved
(),
true
);
(
<
any
>
m
).
value
=
'
something
'
;
return
m
.
load
().
then
(
function
(
model
)
{
return
m
.
load
().
then
(
model
=>
{
assert
(
textEditorModel
===
m
.
textEditorModel
);
assert
.
strictEqual
(
m
.
getValue
(),
'
something
'
);
});
...
...
@@ -46,7 +46,7 @@ suite('Workbench - StringEditorModel', () => {
test
(
'
StringEditorModel - setValue, clearValue, append, trim
'
,
function
(
done
)
{
instantiationService
.
stub
(
IModelService
,
createMockModelService
(
instantiationService
));
let
m
=
instantiationService
.
createInstance
(
StringEditorModel
,
'
value
'
,
'
mime
'
,
null
);
m
.
load
().
then
(
function
(
model
)
{
m
.
load
().
then
(
model
=>
{
assert
(
model
===
m
);
let
textEditorModel
=
m
.
textEditorModel
;
...
...
src/vs/workbench/test/common/editor/untitledEditor.test.ts
浏览文件 @
6cb1643f
...
...
@@ -67,6 +67,8 @@ suite('Workbench - Untitled Editor', () => {
assert
.
ok
(
!
input2
.
isDirty
());
assert
.
ok
(
!
model
.
isDirty
());
input2
.
dispose
();
done
();
});
...
...
@@ -96,6 +98,8 @@ suite('Workbench - Untitled Editor', () => {
model
.
textEditorModel
.
setValue
(
''
);
assert
.
ok
(
!
model
.
isDirty
());
input
.
dispose
();
done
();
});
});
...
...
@@ -113,6 +117,8 @@ suite('Workbench - Untitled Editor', () => {
model
.
textEditorModel
.
setValue
(
''
);
assert
.
ok
(
model
.
isDirty
());
input
.
dispose
();
done
();
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录