Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
862a1bc6
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,发现更多精彩内容 >>
提交
862a1bc6
编写于
6月 27, 2019
作者:
P
Peng Lyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #76245. Initialize test helper inside suite.
上级
1af20e74
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
17 deletion
+16
-17
src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts
...ch/services/keybinding/test/browserKeyboardMapper.test.ts
+16
-17
未找到文件。
src/vs/workbench/services/keybinding/test/browserKeyboardMapper.test.ts
浏览文件 @
862a1bc6
...
...
@@ -10,8 +10,6 @@ import { BrowserKeyboardMapperFactoryBase } from '../browser/keymapService';
import
{
KeymapInfo
,
IKeymapInfo
}
from
'
../common/keymapInfo
'
;
class
TestKeyboardMapperFactory
extends
BrowserKeyboardMapperFactoryBase
{
public
static
readonly
INSTANCE
=
new
TestKeyboardMapperFactory
();
constructor
()
{
super
();
...
...
@@ -25,14 +23,15 @@ class TestKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
suite
(
'
keyboard layout loader
'
,
()
=>
{
const
instance
:
TestKeyboardMapperFactory
=
new
TestKeyboardMapperFactory
();
test
(
'
load default US keyboard layout
'
,
()
=>
{
assert
.
notEqual
(
TestKeyboardMapperFactory
.
INSTANCE
.
activeKeyboardLayout
,
null
);
assert
.
equal
(
TestKeyboardMapperFactory
.
INSTANCE
.
activeKeyboardLayout
!
.
isUSStandard
,
true
);
assert
.
notEqual
(
instance
.
activeKeyboardLayout
,
null
);
assert
.
equal
(
instance
.
activeKeyboardLayout
!
.
isUSStandard
,
true
);
});
test
(
'
isKeyMappingActive
'
,
()
=>
{
assert
.
equal
(
TestKeyboardMapperFactory
.
INSTANCE
.
isKeyMappingActive
({
assert
.
equal
(
instance
.
isKeyMappingActive
({
KeyA
:
{
value
:
'
a
'
,
valueIsDeadKey
:
false
,
...
...
@@ -45,7 +44,7 @@ suite('keyboard layout loader', () => {
}
}),
true
);
assert
.
equal
(
TestKeyboardMapperFactory
.
INSTANCE
.
isKeyMappingActive
({
assert
.
equal
(
instance
.
isKeyMappingActive
({
KeyA
:
{
value
:
'
a
'
,
valueIsDeadKey
:
false
,
...
...
@@ -68,7 +67,7 @@ suite('keyboard layout loader', () => {
}
}),
true
);
assert
.
equal
(
TestKeyboardMapperFactory
.
INSTANCE
.
isKeyMappingActive
({
assert
.
equal
(
instance
.
isKeyMappingActive
({
KeyZ
:
{
value
:
'
y
'
,
valueIsDeadKey
:
false
,
...
...
@@ -84,7 +83,7 @@ suite('keyboard layout loader', () => {
});
test
(
'
Switch keymapping
'
,
()
=>
{
TestKeyboardMapperFactory
.
INSTANCE
.
setActiveKeyMapping
({
instance
.
setActiveKeyMapping
({
KeyZ
:
{
value
:
'
y
'
,
valueIsDeadKey
:
false
,
...
...
@@ -96,8 +95,8 @@ suite('keyboard layout loader', () => {
withShiftAltGrIsDeadKey
:
false
}
});
assert
.
equal
(
!!
TestKeyboardMapperFactory
.
INSTANCE
.
activeKeyboardLayout
!
.
isUSStandard
,
false
);
assert
.
equal
(
TestKeyboardMapperFactory
.
INSTANCE
.
isKeyMappingActive
({
assert
.
equal
(
!!
instance
.
activeKeyboardLayout
!
.
isUSStandard
,
false
);
assert
.
equal
(
instance
.
isKeyMappingActive
({
KeyZ
:
{
value
:
'
y
'
,
valueIsDeadKey
:
false
,
...
...
@@ -110,14 +109,14 @@ suite('keyboard layout loader', () => {
},
}),
true
);
TestKeyboardMapperFactory
.
INSTANCE
.
setUSKeyboardLayout
();
assert
.
equal
(
TestKeyboardMapperFactory
.
INSTANCE
.
activeKeyboardLayout
!
.
isUSStandard
,
true
);
instance
.
setUSKeyboardLayout
();
assert
.
equal
(
instance
.
activeKeyboardLayout
!
.
isUSStandard
,
true
);
});
test
(
'
Switch keyboard layout info
'
,
()
=>
{
TestKeyboardMapperFactory
.
INSTANCE
.
setKeyboardLayout
(
'
com.apple.keylayout.German
'
);
assert
.
equal
(
!!
TestKeyboardMapperFactory
.
INSTANCE
.
activeKeyboardLayout
!
.
isUSStandard
,
false
);
assert
.
equal
(
TestKeyboardMapperFactory
.
INSTANCE
.
isKeyMappingActive
({
instance
.
setKeyboardLayout
(
'
com.apple.keylayout.German
'
);
assert
.
equal
(
!!
instance
.
activeKeyboardLayout
!
.
isUSStandard
,
false
);
assert
.
equal
(
instance
.
isKeyMappingActive
({
KeyZ
:
{
value
:
'
y
'
,
valueIsDeadKey
:
false
,
...
...
@@ -130,7 +129,7 @@ suite('keyboard layout loader', () => {
},
}),
true
);
TestKeyboardMapperFactory
.
INSTANCE
.
setUSKeyboardLayout
();
assert
.
equal
(
TestKeyboardMapperFactory
.
INSTANCE
.
activeKeyboardLayout
!
.
isUSStandard
,
true
);
instance
.
setUSKeyboardLayout
();
assert
.
equal
(
instance
.
activeKeyboardLayout
!
.
isUSStandard
,
true
);
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录