Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b5c48ad3
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,发现更多精彩内容 >>
提交
b5c48ad3
编写于
5月 06, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid - tests back to green
上级
0960a617
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
53 addition
and
59 deletion
+53
-59
src/vs/workbench/services/actions/test/common/menuService.test.ts
...orkbench/services/actions/test/common/menuService.test.ts
+2
-57
src/vs/workbench/test/browser/parts/editor2/nextEditorPart.test.ts
...rkbench/test/browser/parts/editor2/nextEditorPart.test.ts
+4
-0
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+47
-2
未找到文件。
src/vs/workbench/services/actions/test/common/menuService.test.ts
浏览文件 @
b5c48ad3
...
...
@@ -10,66 +10,11 @@ import { MenuService } from 'vs/workbench/services/actions/common/menuService';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
NullCommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
MockContextKeyService
}
from
'
vs/platform/keybinding/test/common/mockKeybindingService
'
;
import
{
IExtensionPoint
}
from
'
vs/workbench/services/extensions/common/extensionsRegistry
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ExtensionPointContribution
,
IExtensionDescription
,
IExtensionsStatus
,
IExtensionService
,
ProfileSession
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
TestExtensionService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
// --- service instances
class
MockExtensionService
implements
IExtensionService
{
public
_serviceBrand
:
any
;
private
_onDidRegisterExtensions
=
new
Emitter
<
void
>
();
public
get
onDidRegisterExtensions
():
Event
<
void
>
{
return
this
.
_onDidRegisterExtensions
.
event
;
}
onDidChangeExtensionsStatus
=
null
;
public
activateByEvent
(
activationEvent
:
string
):
TPromise
<
void
>
{
throw
new
Error
(
'
Not implemented
'
);
}
public
whenInstalledExtensionsRegistered
():
TPromise
<
boolean
>
{
return
TPromise
.
as
(
true
);
}
public
getExtensions
():
TPromise
<
IExtensionDescription
[]
>
{
throw
new
Error
(
'
Not implemented
'
);
}
public
readExtensionPointContributions
<
T
>
(
extPoint
:
IExtensionPoint
<
T
>
):
TPromise
<
ExtensionPointContribution
<
T
>
[]
>
{
throw
new
Error
(
'
Not implemented
'
);
}
public
getExtensionsStatus
():
{
[
id
:
string
]:
IExtensionsStatus
;
}
{
throw
new
Error
(
'
Not implemented
'
);
}
public
canProfileExtensionHost
()
{
return
false
;
}
public
startExtensionHostProfile
():
TPromise
<
ProfileSession
>
{
throw
new
Error
(
'
Not implemented
'
);
}
public
restartExtensionHost
():
void
{
throw
new
Error
(
'
Method not implemented.
'
);
}
public
startExtensionHost
():
void
{
throw
new
Error
(
'
Method not implemented.
'
);
}
public
stopExtensionHost
():
void
{
throw
new
Error
(
'
Method not implemented.
'
);
}
}
const
extensionService
=
new
MockExtensionService
();
const
extensionService
=
new
TestExtensionService
();
const
contextKeyService
=
new
class
extends
MockContextKeyService
{
contextMatchesRules
()
{
...
...
src/vs/workbench/test/browser/parts/editor2/nextEditorPart.test.ts
浏览文件 @
b5c48ad3
...
...
@@ -136,6 +136,8 @@ suite('Next editor2 part tests', () => {
activeGroupChangeListener
.
dispose
();
groupAddedListener
.
dispose
();
groupRemovedListener
.
dispose
();
part
.
dispose
();
});
test
(
'
Editor part options
'
,
function
()
{
...
...
@@ -155,5 +157,7 @@ suite('Next editor2 part tests', () => {
assert
.
equal
(
part
.
partOptions
.
showTabs
,
false
);
assert
.
equal
(
newOptions
.
showTabs
,
false
);
assert
.
equal
(
oldOptions
,
currentOptions
);
part
.
dispose
();
});
});
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
b5c48ad3
...
...
@@ -56,15 +56,20 @@ import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderW
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ITextResourceConfigurationService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
import
{
IPosition
,
Position
as
EditorPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ICommandAction
,
IMenuService
,
MenuId
,
IMenu
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
MockContextKeyService
}
from
'
vs/platform/keybinding/test/common/mockKeybindingService
'
;
import
{
MockContextKeyService
,
MockKeybindingService
}
from
'
vs/platform/keybinding/test/common/mockKeybindingService
'
;
import
{
ITextBufferFactory
,
DefaultEndOfLine
,
EndOfLinePreference
}
from
'
vs/editor/common/model
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
IConfirmation
,
IConfirmationResult
,
IDialogService
,
IDialogOptions
}
from
'
vs/platform/dialogs/common/dialogs
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
TestNotificationService
}
from
'
vs/platform/notification/test/common/testNotificationService
'
;
import
{
IExtensionService
,
ProfileSession
,
IExtensionsStatus
,
ExtensionPointContribution
,
IExtensionDescription
}
from
'
../services/extensions/common/extensions
'
;
import
{
IExtensionPoint
}
from
'
vs/workbench/services/extensions/common/extensionsRegistry
'
;
import
{
IKeybindingService
}
from
'
../../platform/keybinding/common/keybinding
'
;
import
{
IDecorationsService
,
IResourceDecorationChangeEvent
,
IDecoration
,
IDecorationData
,
IDecorationsProvider
}
from
'
vs/workbench/services/decorations/browser/decorations
'
;
import
{
IDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
export
function
createFileInput
(
instantiationService
:
IInstantiationService
,
resource
:
URI
):
FileEditorInput
{
return
instantiationService
.
createInstance
(
FileEditorInput
,
resource
,
void
0
);
...
...
@@ -259,6 +264,10 @@ export function workbenchInstantiationService(): IInstantiationService {
instantiationService
.
stub
(
INotificationService
,
new
TestNotificationService
());
instantiationService
.
stub
(
IUntitledEditorService
,
instantiationService
.
createInstance
(
UntitledEditorService
));
instantiationService
.
stub
(
IWindowService
,
new
TestWindowService
());
instantiationService
.
stub
(
IMenuService
,
new
TestMenuService
());
instantiationService
.
stub
(
IKeybindingService
,
new
MockKeybindingService
());
instantiationService
.
stub
(
IDecorationsService
,
new
TestDecorationsService
());
instantiationService
.
stub
(
IExtensionService
,
new
TestExtensionService
());
instantiationService
.
stub
(
IWindowsService
,
new
TestWindowsService
());
instantiationService
.
stub
(
ITextFileService
,
<
ITextFileService
>
instantiationService
.
createInstance
(
TestTextFileService
));
instantiationService
.
stub
(
ITextModelService
,
<
ITextModelService
>
instantiationService
.
createInstance
(
TextModelResolverService
));
...
...
@@ -269,6 +278,42 @@ export function workbenchInstantiationService(): IInstantiationService {
return
instantiationService
;
}
export
class
TestDecorationsService
implements
IDecorationsService
{
_serviceBrand
:
any
;
onDidChangeDecorations
:
Event
<
IResourceDecorationChangeEvent
>
=
Event
.
None
;
registerDecorationsProvider
(
provider
:
IDecorationsProvider
):
IDisposable
{
return
toDisposable
();
}
getDecoration
(
uri
:
URI
,
includeChildren
:
boolean
,
overwrite
?:
IDecorationData
):
IDecoration
{
return
void
0
;
}
}
export
class
TestExtensionService
implements
IExtensionService
{
_serviceBrand
:
any
;
onDidRegisterExtensions
:
Event
<
void
>
=
Event
.
None
;
onDidChangeExtensionsStatus
:
Event
<
string
[]
>
=
Event
.
None
;
activateByEvent
(
activationEvent
:
string
):
Promise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
whenInstalledExtensionsRegistered
():
Promise
<
boolean
>
{
return
TPromise
.
as
(
true
);
}
getExtensions
():
Promise
<
IExtensionDescription
[]
>
{
return
TPromise
.
as
([]);
}
readExtensionPointContributions
<
T
>
(
extPoint
:
IExtensionPoint
<
T
>
):
Promise
<
ExtensionPointContribution
<
T
>
[]
>
{
return
TPromise
.
as
(
Object
.
create
(
null
));
}
getExtensionsStatus
():
{
[
id
:
string
]:
IExtensionsStatus
;
}
{
return
Object
.
create
(
null
);
}
canProfileExtensionHost
():
boolean
{
return
false
;
}
startExtensionHostProfile
():
Promise
<
ProfileSession
>
{
return
TPromise
.
as
(
Object
.
create
(
null
));
}
restartExtensionHost
():
void
{
}
startExtensionHost
():
void
{
}
stopExtensionHost
():
void
{
}
}
export
class
TestMenuService
implements
IMenuService
{
public
_serviceBrand
:
any
;
createMenu
(
id
:
MenuId
,
scopedKeybindingService
:
IContextKeyService
):
IMenu
{
return
{
onDidChange
:
Event
.
None
,
dispose
:
()
=>
void
0
,
getActions
:
()
=>
[]
};
}
}
export
class
TestHistoryService
implements
IHistoryService
{
public
_serviceBrand
:
any
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录