Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d1840549
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d1840549
编写于
7月 03, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 03, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9059 【多模输入】增加键盘重复按键XTS
Merge pull request !9059 from wangli/master
上级
94dc1120
cca26ade
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
167 addition
and
1 deletion
+167
-1
multimodalinput/input_js_standard/src/main/js/test/InputDevice.test.js
...ut/input_js_standard/src/main/js/test/InputDevice.test.js
+167
-1
未找到文件。
multimodalinput/input_js_standard/src/main/js/test/InputDevice.test.js
浏览文件 @
d1840549
...
...
@@ -26,7 +26,9 @@ export default function InputDevice_test() {
PARAMETER_TYPE_MSG
:
`Parameter error. The type of type must be string.`
,
PARAMETER_DEVICEID_TYPE_MSG
:
`Parameter error. The type of deviceId must be number.`
,
PARAMETER_LISTENER_TYPE_MSG
:
`Parameter error. The type of listener must be function.`
,
PARAMETER_CALLBACK_TYPE_MSG
:
`Parameter error. The type of callback must be function.`
PARAMETER_CALLBACK_TYPE_MSG
:
`Parameter error. The type of callback must be function.`
,
PARAMETER_DELAY_TYPE_MSG
:
`Parameter error. The type of delay must be number.`
,
PARAMETER_RATE_TYPE_MSG
:
`Parameter error. The type of rate must be number.`
}
// 参数正确,返回一个数组
...
...
@@ -287,6 +289,82 @@ it("InputDevice_getDevice_test_02", 0, async function (done) {
}
})
it
(
'
InputDevice_setKeyboardRepeatDelay_test_01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_01 enter`
);
try
{
inputDevice
.
setKeyboardRepeatDelay
(
500
,
(
error
)
=>
{
if
(
error
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_01 failed, error=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_01 success`
);
expect
(
true
).
assertTrue
();
}
});
}
catch
(
error
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_01 error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_01 exit`
);
done
();
})
it
(
'
InputDevice_setKeyboardRepeatDelay_test_02
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_02 enter`
);
try
{
inputDevice
.
setKeyboardRepeatDelay
(
500
).
then
(()
=>
{
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_02 success`
);
expect
(
true
).
assertTrue
();
}).
catch
((
error
)
=>
{
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_02 failed, error=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_02 error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`InputDevice_setKeyboardRepeatDelay_test_02 exit`
);
done
();
})
it
(
'
InputDevice_setKeyboardRepeatRate_test_01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_01 enter`
);
try
{
inputDevice
.
setKeyboardRepeatRate
(
60
,
(
error
)
=>
{
if
(
error
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_01 failed, error=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_01 success`
);
expect
(
true
).
assertTrue
();
}
});
}
catch
(
error
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_01 error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_01 exit`
);
done
();
})
it
(
'
InputDevice_setKeyboardRepeatRate_test_02
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_02 enter`
);
try
{
inputDevice
.
setKeyboardRepeatRate
(
60
).
then
(()
=>
{
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_02 success`
);
expect
(
true
).
assertTrue
();
}).
catch
((
error
)
=>
{
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_02 failed, error=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_02 error`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`InputDevice_setKeyboardRepeatRate_test_02 exit`
);
done
();
})
/**
* @tc.number MultimodalInputDevice_js_0010
* @tc.name MultimodalInputDevice_KeyboardType_NONE_test
...
...
@@ -849,5 +927,93 @@ it("InputDevice_getDevice_test_02", 0, async function (done) {
console
.
info
(
`InputDevice_Off_Exception_test exit`
);
done
();
})
/**
* @tc.number MultimodalInputDevice_js_0240
* @tc.name MultimodalInputDevice_SetKeyboardRepeatDelay_Exception_test_01
* @tc.desc inputdevice interface setKeyboardRepeatDelay exception test
*/
it
(
'
InputDevice_SetKeyboardRepeatDelay_Exception_test_01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_SetKeyboardRepeatDelay_Exception_test_01 enter`
);
try
{
inputDevice
.
setKeyboardRepeatDelay
();
}
catch
(
error
)
{
console
.
info
(
`SetKeyboardRepeatDelay_Exception_Test_001:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_COUNT_MSG
);
}
console
.
info
(
`InputDevice_SetKeyboardRepeatDelay_Exception_test_01 exit`
);
done
();
})
/**
* @tc.number MultimodalInputDevice_js_0250
* @tc.name MultimodalInputDevice_SetKeyboardRepeatDelay_Exception_test_02
* @tc.desc inputdevice interface setKeyboardRepeatDelay exception test
*/
it
(
'
InputDevice_SetKeyboardRepeatDelay_Exception_test_02
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_SetKeyboardRepeatDelay_Exception_test_02 enter`
);
try
{
inputDevice
.
setKeyboardRepeatDelay
(
`delay`
,
(
error
)
=>
{
if
(
error
)
{
console
.
info
(
`SetKeyboardRepeatDelay_Exception_Test_002 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`SetKeyboardRepeatDelay_Exception_Test_002 success`
);
expect
(
true
).
assertTrue
();
}
});
}
catch
(
error
)
{
console
.
info
(
`SetKeyboardRepeatDelay_Exception_Test_002:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_DELAY_TYPE_MSG
);
}
console
.
info
(
`InputDevice_SetKeyboardRepeatDelay_Exception_test_02 exit`
);
done
();
})
/**
* @tc.number MultimodalInputDevice_js_0260
* @tc.name MultimodalInputDevice_SetKeyboardRepeatRate_Exception_test_01
* @tc.desc inputdevice interface setKeyboardRepeatRate exception test
*/
it
(
'
InputDevice_SetKeyboardRepeatRate_Exception_test_01
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_SetKeyboardRepeatRate_Exception_test_01 enter`
);
try
{
inputDevice
.
setKeyboardRepeatRate
();
}
catch
(
error
)
{
console
.
info
(
`SetKeyboardRepeatRate_Exception_Test_001:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_COUNT_MSG
);
}
console
.
info
(
`InputDevice_SetKeyboardRepeatRate_Exception_test_01 exit`
);
done
();
})
/**
* @tc.number MultimodalInputDevice_js_0270
* @tc.name MultimodalInputDevice_SetKeyboardRepeatRate_Exception_test_02
* @tc.desc inputdevice interface setKeyboardRepeatRate exception test
*/
it
(
'
InputDevice_SetKeyboardRepeatRate_Exception_test_02
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_SetKeyboardRepeatRate_Exception_test_02 enter`
);
try
{
inputDevice
.
setKeyboardRepeatRate
(
`rate`
,
(
error
)
=>
{
if
(
error
)
{
console
.
info
(
`SetKeyboardRepeatRate_Exception_Test_002 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`SetKeyboardRepeatRate_Exception_Test_002 success`
);
expect
(
true
).
assertTrue
();
}
});
}
catch
(
error
)
{
console
.
info
(
`SetKeyboardRepeatRate_Exception_Test_002:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_RATE_TYPE_MSG
);
}
console
.
info
(
`InputDevice_SetKeyboardRepeatRate_Exception_test_02 exit`
);
done
();
})
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录