Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
260bcf16
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看板
未验证
提交
260bcf16
编写于
10月 27, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6138 Add multimodal input xts cases
Merge pull request !6138 from mayunteng/master
上级
74342a9d
d7d899b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
471 addition
and
1 deletion
+471
-1
multimodalinput/input_js_standard/src/main/js/test/InputDevice.test.js
...ut/input_js_standard/src/main/js/test/InputDevice.test.js
+227
-1
multimodalinput/input_js_standard/src/main/js/test/Pointer.test.js
...linput/input_js_standard/src/main/js/test/Pointer.test.js
+244
-0
未找到文件。
multimodalinput/input_js_standard/src/main/js/test/InputDevice.test.js
浏览文件 @
260bcf16
...
@@ -18,6 +18,17 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
...
@@ -18,6 +18,17 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
export
default
function
MultimodalInput_Device_test
()
{
export
default
function
MultimodalInput_Device_test
()
{
describe
(
'
MultimodalInput_Device_test
'
,
function
()
{
describe
(
'
MultimodalInput_Device_test
'
,
function
()
{
const
errCode
=
{
COMMON_PARAMETER_CODE
:
401
}
const
errMsg
=
{
PARAMETER_COUNT_MSG
:
`Parameter count error`
,
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.`
}
// 参数正确,返回一个数组
// 参数正确,返回一个数组
it
(
'
inputDevice::getDeviceIds_test-01
'
,
0
,
function
()
{
it
(
'
inputDevice::getDeviceIds_test-01
'
,
0
,
function
()
{
console
.
info
(
`inputDevice::getDeviceIds_test-01 enter`
);
console
.
info
(
`inputDevice::getDeviceIds_test-01 enter`
);
...
@@ -211,7 +222,7 @@ export default function MultimodalInput_Device_test() {
...
@@ -211,7 +222,7 @@ export default function MultimodalInput_Device_test() {
try
{
try
{
inputDevice
.
getKeyboardType
(
-
1
);
inputDevice
.
getKeyboardType
(
-
1
);
}
catch
(
error
)
{
}
catch
(
error
)
{
expect
(
error
.
message
).
assertEqual
(
"
getKeyboardType:
\"
The second parameter type is wrong
\"
"
);
expect
(
error
.
message
).
assertEqual
(
"
Invalid input device id
"
);
}
}
console
.
info
(
`inputDevice::getKeyboardType_test-02 exit`
);
console
.
info
(
`inputDevice::getKeyboardType_test-02 exit`
);
});
});
...
@@ -569,5 +580,220 @@ export default function MultimodalInput_Device_test() {
...
@@ -569,5 +580,220 @@ export default function MultimodalInput_Device_test() {
}
}
console
.
info
(
`inputDevice::getDeviceInfo_promise_test exit`
);
console
.
info
(
`inputDevice::getDeviceInfo_promise_test exit`
);
})
})
/**
* @tc.number MultimodalInputDevice_js_0150
* @tc.name MultimodalInputDevice_GetkeyboardType_Exception_test_01
* @tc.desc inputdevice interface getKeyboardType exception test
*/
it
(
"
MultimodalInputDevice_GetkeyboardType_Exception_test_01
"
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_GetkeyboardType_Exception_test_01 enter`
);
try
{
inputDevice
.
getKeyboardType
();
}
catch
(
error
)
{
console
.
info
(
`GetkeyboardType_Exception_test_01:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_COUNT_MSG
);
}
console
.
info
(
"
MultimodalInputDevice_GetkeyboardType_Exception_test_01 exit
"
);
})
/**
* @tc.number MultimodalInputDevice_js_0160
* @tc.name MultimodalInputDevice_GetkeyboardType_Exception_test_02
* @tc.desc inputdevice interface getKeyboardType exception test
*/
it
(
"
MultimodalInputDevice_GetkeyboardType_Exception_test_02
"
,
0
,
function
()
{
console
.
info
(
"
MultimodalInputDevice_GetkeyboardType_Exception_test_02 enter
"
);
try
{
inputDevice
.
getKeyboardType
(
`id`
).
then
((
data
)
=>
{
console
.
info
(
`GetkeyboardType_Exception_test_02 success`
);
expect
(
true
).
assertTrue
();
},
(
error
)
=>
{
console
.
info
(
`GetkeyboardType_Exception_test_02 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`GetkeyboardType_Exception_test_02:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_DEVICEID_TYPE_MSG
);
}
console
.
info
(
"
MultimodalInputDevice_GetkeyboardType_Exception_test_02 exit
"
);
})
/**
* @tc.number MultimodalInputDevice_js_0170
* @tc.name MultimodalInputDevice_SupportKeys_Exception_test_01
* @tc.desc inputdevice interface supportKeys exception test
*/
it
(
"
MultimodalInputDevice_SupportKeys_Exception_test_01
"
,
0
,
function
()
{
console
.
info
(
"
MultimodalInputDevice_SupportKeys_Exception_test_01 enter
"
);
try
{
inputDevice
.
supportKeys
((
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
`SupportKeys_Exception_test_01 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`SupportKeys_Exception_test_01 success`
);
expect
(
true
).
assertTrue
();
}
})
}
catch
(
error
)
{
console
.
info
(
`SupportKeys_Exception_test_01:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_COUNT_MSG
);
}
console
.
info
(
"
MultimodalInputDevice_SupportKeys_Exception_test_01 exit
"
);
})
/**
* @tc.number MultimodalInputDevice_js_0180
* @tc.name MultimodalInputDevice_SupportKeys_Exception_test_02
* @tc.desc inputdevice interface supportKeys exception test
*/
it
(
"
MultimodalInputDevice_SupportKeys_Exception_test_02
"
,
0
,
function
()
{
console
.
info
(
"
MultimodalInputDevice_SupportKeys_Exception_test_02 enter
"
);
try
{
inputDevice
.
supportKeys
(
`id`
,
[
17
,
22
,
2055
],
(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
`SupportKeys_Exception_test_02 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`SupportKeys_Exception_test_02 success`
);
expect
(
true
).
assertTrue
();
}
})
}
catch
(
error
)
{
console
.
info
(
`SupportKeys_Exception_test_02:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_DEVICEID_TYPE_MSG
);
}
console
.
info
(
"
MultimodalInputDevice_SupportKeys_Exception_test_02 exit
"
);
})
/**
* @tc.number MultimodalInputDevice_js_0190
* @tc.name MultimodalInputDevice_GetDeviceInfo_Exception_test_01
* @tc.desc inputdevice interface getDeviceInfo exception test
*/
it
(
"
MultimodalInputDevice_GetDeviceInfo_Exception_test_01
"
,
0
,
function
()
{
console
.
info
(
"
MultimodalInputDevice_GetDeviceInfo_Exception_test_01 enter
"
);
try
{
inputDevice
.
getDeviceInfo
();
}
catch
(
error
)
{
console
.
info
(
`GetDeviceInfo_Exception_test_01:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_COUNT_MSG
);
}
console
.
info
(
"
MultimodalInputDevice_GetDeviceInfo_Exception_test_01 exit
"
);
})
/**
* @tc.number MultimodalInputDevice_js_0200
* @tc.name MultimodalInputDevice_GetDeviceInfo_Exception_test_02
* @tc.desc inputdevice interface getDeviceInfo exception test
*/
it
(
"
MultimodalInputDevice_GetDeviceInfo_Exception_test_02
"
,
0
,
function
()
{
console
.
info
(
"
MultimodalInputDevice_GetDeviceInfo_Exception_test_02 enter
"
);
try
{
inputDevice
.
getDeviceList
().
then
((
data
)
=>
{
expect
(
data
).
assertInstanceOf
(
'
Array
'
);
if
(
data
.
length
<=
0
)
{
return
;
}
try
{
inputDevice
.
getDeviceInfo
(
`data[0]`
).
then
((
res
)
=>
{
console
.
info
(
`GetDeviceInfo_Exception_test_02 success`
);
expect
(
true
).
assertTrue
();
}).
catch
(
error
=>
{
console
.
info
(
`GetDeviceInfo_Exception_test_02 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`GetDeviceInfo_Exception_test_02:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_DEVICEID_TYPE_MSG
);
}
})
}
catch
(
error
)
{
expect
(
false
).
assertTrue
();
}
console
.
info
(
"
MultimodalInputDevice_GetDeviceInfo_Exception_test_02 exit
"
);
})
/**
* @tc.number MultimodalInputDevice_js_0210
* @tc.name MultimodalInputDevice_GetDeviceList_Exception_test
* @tc.desc inputdevice interface getDeviceList exception test
*/
it
(
"
MultimodalInputDevice_GetDeviceList_Exception_test
"
,
0
,
function
()
{
console
.
info
(
"
MultimodalInputDevice_GetDeviceList_Exception_test enter
"
);
try
{
inputDevice
.
getDeviceList
(
null
);
}
catch
(
error
)
{
console
.
info
(
`GetDeviceList_Exception_test_01:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_CALLBACK_TYPE_MSG
);
}
console
.
info
(
`MultimodalInputDevice_GetDeviceList_Exception_test exit`
);
})
/**
* @tc.number MultimodalInputDevice_js_0220
* @tc.name MultimodalInputDevice_On_Exception_test
* @tc.desc inputdevice interface on test
*/
it
(
"
MultimodalInputDevice_On_Exception_test
"
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_On_Exception_test enter`
);
try
{
inputDevice
.
on
();
}
catch
(
error
)
{
console
.
info
(
`On_Exception_test:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_COUNT_MSG
);
}
try
{
inputDevice
.
on
(
-
1
,
(
data
)
=>
{
if
(
error
)
{
console
.
info
(
`On_Exception_test failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`On_Exception_test success`
);
expect
(
true
).
assertTrue
();
}
});
}
catch
(
error
)
{
console
.
info
(
`On_Exception_test:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_TYPE_MSG
);
}
console
.
info
(
`MultimodalInputDevice_On_Exception_test exit`
);
})
/**
* @tc.number MultimodalInputDevice_js_0230
* @tc.name MultimodalInputDevice_Off_Exception_test
* @tc.desc inputdevice interface off test
*/
it
(
"
MultimodalInputDevice_Off_Exception_test
"
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_Off_Exception_test enter`
);
try
{
inputDevice
.
off
();
}
catch
(
error
)
{
console
.
info
(
`Off_Exception_test:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_COUNT_MSG
);
}
try
{
inputDevice
.
off
(
'
change
'
,
null
);
}
catch
(
error
)
{
console
.
info
(
`Off_Exception_test:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_LISTENER_TYPE_MSG
);
}
console
.
info
(
`MultimodalInputDevice_Off_Exception_test exit`
);
})
})
})
}
}
multimodalinput/input_js_standard/src/main/js/test/Pointer.test.js
浏览文件 @
260bcf16
...
@@ -19,6 +19,18 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
...
@@ -19,6 +19,18 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestT
export
default
function
MultimodalInput_Pointer_test
()
{
export
default
function
MultimodalInput_Pointer_test
()
{
describe
(
'
MultimodalInput_Pointer_test
'
,
function
()
{
describe
(
'
MultimodalInput_Pointer_test
'
,
function
()
{
const
errCode
=
{
COMMON_PARAMETER_CODE
:
401
}
const
errMsg
=
{
PARAMETER_COUNT_MSG
:
`Parameter count error`
,
PARAMETER_TYPE_MSG
:
`Parameter error. The type of type must be string.`
,
PARAMETER_VISIBLE_TYPE_MSG
:
`Parameter error. The type of visible must be boolean.`
,
PARAMETER_SPEED_TYPE_MSG
:
`Parameter error. The type of speed must be number.`
,
PARAMETER_WINDOWID_TYPE_MSG
:
`Parameter error. The type of windowId must be number.`
,
PARAMETER_CALLBACK_TYPE_MSG
:
`Parameter error. The type of callback must be function.`
}
it
(
'
MultimodalInput_Pointer_test::PointerVisibleTest_001
'
,
0
,
function
()
{
it
(
'
MultimodalInput_Pointer_test::PointerVisibleTest_001
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 enter`
);
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerVisibleTest_001 enter`
);
try
{
try
{
...
@@ -81,6 +93,52 @@ export default function MultimodalInput_Pointer_test() {
...
@@ -81,6 +93,52 @@ export default function MultimodalInput_Pointer_test() {
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 exit`
);
console
.
info
(
`MultimodalInput_Pointer_test::PointerVisibleTest_002 exit`
);
})
})
it
(
'
MultimodalInput_Pointer_test::PointerSpeedTest_001
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerSpeedTest_001 enter`
);
var
callback
=
function
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerSpeedTest_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerSpeedTest_001 success`
);
expect
(
true
).
assertTrue
();
}
};
pointer
.
setPointerSpeed
(
10
,
callback
);
pointer
.
getPointerSpeed
().
then
((
data
)
=>
{
console
.
info
(
`MultimodalInput_Pointer_test::GetPointerSpeedTest_001 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
==
10
).
assertTrue
();
},
(
err
)
=>
{
console
.
info
(
`MultimodalInput_Pointer_test::GetPointerSpeedTest_001 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
});
console
.
info
(
`MultimodalInput_Pointer_test::PointerSpeedTest_001 exit`
);
})
it
(
'
MultimodalInput_Pointer_test::PointerSpeedTest_002
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInput_Pointer_test::PointerSpeedTest_002 enter`
);
pointer
.
setPointerSpeed
(
10
).
then
(
data
=>
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerSpeedTest_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
true
).
assertTrue
();
},
(
err
)
=>
{
console
.
info
(
`MultimodalInput_Pointer_test::SetPointerSpeedTest_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
});
var
callback
=
function
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
`MultimodalInput_Pointer_test::GetPointerSpeedTest_002 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`MultimodalInput_Pointer_test::GetPointerSpeedTest_002 success, data=
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
==
10
).
assertTrue
();
}
};
pointer
.
getPointerSpeed
(
callback
);
console
.
info
(
`MultimodalInput_Pointer_test::PointerSpeedTest_002 exit`
);
})
it
(
'
MultimodalInput_Pointer_test::SetPointerStyle_001
'
,
0
,
function
()
{
it
(
'
MultimodalInput_Pointer_test::SetPointerStyle_001
'
,
0
,
function
()
{
console
.
info
(
`SetPointerStyle_001 enter`
);
console
.
info
(
`SetPointerStyle_001 enter`
);
window
.
getTopWindow
((
err
,
data
)
=>
{
window
.
getTopWindow
((
err
,
data
)
=>
{
...
@@ -323,5 +381,191 @@ export default function MultimodalInput_Pointer_test() {
...
@@ -323,5 +381,191 @@ export default function MultimodalInput_Pointer_test() {
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_SOUTH_WEST_EAST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_SOUTH_WEST_EAST
);
console
.
info
(
'
MultimodalInput_Pointer_test::Pointer_MIDDLE_BTN_NORTH_SOUTH_WEST_EAST_test =
'
+
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_SOUTH_WEST_EAST
);
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_SOUTH_WEST_EAST
==
38
).
assertTrue
();
expect
(
pointer
.
PointerStyle
.
MIDDLE_BTN_NORTH_SOUTH_WEST_EAST
==
38
).
assertTrue
();
})
})
/**
* @tc.number MultimodalInputPointer_Test_001
* @tc.name MultimodalInputDevice_PointerVisibleTest_Exception_Test_001
* @tc.desc Pointer interface PointerVisible exception test
*/
it
(
'
MultimodalInputDevice_PointerVisibleTest_Exception_Test_001
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_PointerVisibleTest_Exception_Test_001 enter`
);
try
{
pointer
.
setPointerVisible
();
}
catch
(
error
)
{
console
.
info
(
`PointerVisibleTest_Exception_Test_001:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_VISIBLE_TYPE_MSG
);
}
try
{
pointer
.
isPointerVisible
((
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
`PointerVisibleTest_Exception_Test_001 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`PointerVisibleTest_Exception_Test_001 success`
);
expect
(
data
).
assertInstanceOf
(
'
Bool
'
);
}
});
}
catch
(
error
)
{
console
.
info
(
`PointerVisibleTest_Exception_Test_001:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
}
console
.
info
(
`MultimodalInputDevice_PointerVisibleTest_Exception_Test_001 exit`
);
})
/**
* @tc.number MultimodalInputPointer_Test_002
* @tc.name MultimodalInputDevice_PointerVisibleTest_Exception_Test_002
* @tc.desc Pointer interface PointerVisible exception test
*/
it
(
'
MultimodalInputDevice_PointerVisibleTest_Exception_Test_002
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_PointerVisibleTest_Exception_Test_002 enter`
);
try
{
pointer
.
setPointerVisible
(
`state`
,
(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
`PointerVisibleTest_Exception_Test_002 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`PointerVisibleTest_Exception_Test_002 success`
);
expect
(
true
).
assertTrue
();
}
});
}
catch
(
error
)
{
console
.
info
(
`PointerVisibleTest_Exception_Test_002:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_VISIBLE_TYPE_MSG
);
}
try
{
pointer
.
isPointerVisible
(
null
);
}
catch
(
error
)
{
console
.
info
(
`PointerVisibleTest_Exception_Test_002:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_CALLBACK_TYPE_MSG
);
}
console
.
info
(
`MultimodalInputDevice_PointerVisibleTest_Exception_Test_002 exit`
);
})
/**
* @tc.number MultimodalInputPointer_Test_003
* @tc.name MultimodalInputDevice_PointerSpeedTest_Exception_Test_001
* @tc.desc Pointer interface PointerSpeed exception test
*/
it
(
'
MultimodalInputDevice_PointerSpeedTest_Exception_Test_001
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_PointerSpeedTest_Exception_Test_001 enter`
);
try
{
pointer
.
setPointerSpeed
(
10
,
null
);
}
catch
(
error
)
{
console
.
info
(
`PointerSpeedTest_Exception_Test_001:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_CALLBACK_TYPE_MSG
);
}
try
{
pointer
.
getPointerSpeed
().
then
((
error
,
data
)
=>
{
console
.
info
(
`PointerSpeedTest_Exception_Test_001 success`
);
expect
(
data
).
assertInstanceOf
(
'
Number
'
);
},
(
error
)
=>
{
console
.
info
(
`PointerSpeedTest_Exception_Test_001 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`PointerSpeedTest_Exception_Test_001:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
}
console
.
info
(
`MultimodalInputDevice_PointerSpeedTest_Exception_Test_001 exit`
);
})
/**
* @tc.number MultimodalInputPointer_Test_004
* @tc.name MultimodalInputDevice_PointerSpeedTest_Exception_Test_002
* @tc.desc Pointer interface PointerSpeed exception test
*/
it
(
'
MultimodalInputDevice_PointerSpeedTest_Exception_Test_002
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_PointerSpeedTest_Exception_Test_002 enter`
);
try
{
pointer
.
setPointerSpeed
().
then
((
data
)
=>
{
console
.
info
(
`PointerSpeedTest_Exception_Test_002 success`
);
expect
(
true
).
assertTrue
();
},
(
error
)
=>
{
console
.
info
(
`PointerSpeedTest_Exception_Test_002 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`PointerSpeedTest_Exception_Test_002:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_SPEED_TYPE_MSG
);
}
try
{
pointer
.
getPointerSpeed
(
null
);
}
catch
(
error
)
{
console
.
info
(
`PointerSpeedTest_Exception_Test_002:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_CALLBACK_TYPE_MSG
);
}
console
.
info
(
`MultimodalInputDevice_PointerSpeedTest_Exception_Test_002 exit`
);
})
/**
* @tc.number MultimodalInputPointer_Test_005
* @tc.name MultimodalInputDevice_PointerStyleTest_Exception_Test_001
* @tc.desc Pointer interface PointerStyle exception test
*/
it
(
'
MultimodalInputDevice_PointerStyleTest_Exception_Test_001
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_PointerStyleTest_Exception_Test_001 enter`
);
try
{
pointer
.
setPointerStyle
(
10
,
10
,
null
);
}
catch
(
error
)
{
console
.
info
(
`PointerStyleTest_Exception_Test_001:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_CALLBACK_TYPE_MSG
);
}
try
{
pointer
.
getPointerStyle
(
10
,
null
).
then
((
data
)
=>
{
console
.
info
(
`PointerStyleTest_Exception_Test_001 success`
);
expect
(
true
).
assertTrue
();
},
(
error
)
=>
{
console
.
info
(
`PointerStyleTest_Exception_Test_001 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`PointerStyleTest_Exception_Test_001:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_CALLBACK_TYPE_MSG
);
}
console
.
info
(
`MultimodalInputDevice_PointerStyleTest_Exception_Test_001 exit`
);
})
/**
* @tc.number MultimodalInputPointer_Test_006
* @tc.name MultimodalInputDevice_PointerStyleTest_Exception_Test_002
* @tc.desc Pointer interface PointerStyle exception test
*/
it
(
'
MultimodalInputDevice_PointerStyleTest_Exception_Test_002
'
,
0
,
function
()
{
console
.
info
(
`MultimodalInputDevice_PointerStyleTest_Exception_Test_002 enter`
);
try
{
pointer
.
setPointerStyle
().
then
((
data
)
=>
{
console
.
info
(
`PointerStyleTest_Exception_Test_002 success`
);
expect
(
true
).
assertTrue
();
},
(
error
)
=>
{
console
.
info
(
`PointerStyleTest_Exception_Test_002 failed, err=
${
JSON
.
stringify
(
error
)}
`
);
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
console
.
info
(
`PointerStyleTest_Exception_Test_002 success`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_WINDOWID_TYPE_MSG
);
}
try
{
pointer
.
getPointerStyle
();
}
catch
(
error
)
{
console
.
info
(
`PointerStyleTest_Exception_Test_002:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
expect
(
error
.
code
).
assertEqual
(
errCode
.
COMMON_PARAMETER_CODE
);
expect
(
error
.
message
).
assertEqual
(
errMsg
.
PARAMETER_WINDOWID_TYPE_MSG
);
}
console
.
info
(
`MultimodalInputDevice_PointerStyleTest_Exception_Test_002 exit`
);
})
})
})
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录