Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
01a4bfae
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看板
未验证
提交
01a4bfae
编写于
2月 02, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 02, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7369 多模子系统用例整改
Merge pull request !7369 from 岳鑫瑶/master
上级
a405c116
29c9f2bf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
65 addition
and
65 deletion
+65
-65
multimodalinput/input_js_standard/src/main/js/MainAbility/app.js
...dalinput/input_js_standard/src/main/js/MainAbility/app.js
+1
-1
multimodalinput/input_js_standard/src/main/js/test/InputDevice.test.js
...ut/input_js_standard/src/main/js/test/InputDevice.test.js
+57
-57
multimodalinput/input_js_standard/src/main/js/test/List.test.js
...odalinput/input_js_standard/src/main/js/test/List.test.js
+4
-4
multimodalinput/input_js_standard/src/main/js/test/Pointer.test.js
...linput/input_js_standard/src/main/js/test/Pointer.test.js
+2
-2
multimodalinput/multimodalinput_ets_standard/entry/src/main/ets/test/MultimodalInputEventType.test.ets
...entry/src/main/ets/test/MultimodalInputEventType.test.ets
+1
-1
未找到文件。
multimodalinput/input_js_standard/src/main/js/MainAbility/app.js
浏览文件 @
01a4bfae
...
...
@@ -15,7 +15,7 @@
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List
Multimodalinput
.test
'
import
testsuite
from
'
../test/List.test
'
export
default
{
onCreate
()
{
...
...
multimodalinput/input_js_standard/src/main/js/test/InputDevice.test.js
浏览文件 @
01a4bfae
...
...
@@ -15,8 +15,8 @@
import
inputDevice
from
'
@ohos.multimodalInput.inputDevice
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
,
TestType
,
Size
,
Level
}
from
'
@ohos/hypium
'
export
default
function
MultimodalInput_
Device_test
()
{
describe
(
'
MultimodalInput_
Device_test
'
,
function
()
{
export
default
function
Input
Device_test
()
{
describe
(
'
Input
Device_test
'
,
function
()
{
const
errCode
=
{
COMMON_PARAMETER_CODE
:
401
...
...
@@ -30,8 +30,8 @@ export default function MultimodalInput_Device_test() {
}
// 参数正确,返回一个数组
it
(
"
InputDevice_getDeviceIds_test
-
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
-
01 enter`
);
it
(
"
InputDevice_getDeviceIds_test
_
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
_
01 enter`
);
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -39,53 +39,53 @@ export default function MultimodalInput_Device_test() {
}
else
{
expect
(
data
).
assertInstanceOf
(
'
Array
'
);
}
console
.
info
(
`InputDevice_getDeviceIds_test
-
01 exit`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
01 exit`
);
done
();
})
}
catch
(
error
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
-
01 error`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
01 error`
);
expect
(
false
).
assertTrue
();
done
();
}
})
// 参数正确,判断一种或多种设备
it
(
"
InputDevice_getDeviceIds_test
-
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
-
02 enter`
);
it
(
"
InputDevice_getDeviceIds_test
_
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
_
02 enter`
);
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
console
.
info
(
`InputDevice_getDeviceIds_test
-
02 err:
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`InputDevice_getDeviceIds_test
-
02 data:
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
02 err:
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
02 data:
${
JSON
.
stringify
(
data
)}
`
);
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
expect
(
data
.
length
>
0
).
assertTrue
();
}
console
.
info
(
`InputDevice_getDeviceIds_test
-
02 exit`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
02 exit`
);
done
();
})
}
catch
(
error
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
-
02 error`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
02 error`
);
expect
(
false
).
assertTrue
();
done
();
}
})
// 参数类型错误
it
(
"
InputDevice_getDeviceIds_test
-
03
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
-
03 enter`
);
it
(
"
InputDevice_getDeviceIds_test
_
03
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
_
03 enter`
);
try
{
inputDevice
.
getDeviceIds
(
-
1
);
}
catch
(
error
)
{
expect
(
error
.
message
).
assertEqual
(
"
GetDeviceIds:
\"
The first parameter type is wrong
\"
"
);
}
console
.
info
(
`InputDevice_getDeviceIds_test
-
03 exit`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
03 exit`
);
done
();
})
// 参数数量错误
it
(
"
InputDevice_getDeviceIds_test
-
04
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
-
04 enter`
);
it
(
"
InputDevice_getDeviceIds_test
_
04
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceIds_test
_
04 enter`
);
try
{
inputDevice
.
getDeviceIds
(
-
1
,
(
err
,
data
)
=>
{
console
.
info
(
data
);
...
...
@@ -93,25 +93,25 @@ export default function MultimodalInput_Device_test() {
}
catch
(
error
)
{
expect
(
error
.
message
).
assertEqual
(
"
GetDeviceIds:
\"
too many parameters
\"
"
);
}
console
.
info
(
`InputDevice_getDeviceIds_test
-
04 exit`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
04 exit`
);
done
();
})
// 无效的设备id
it
(
"
InputDevice_getDevice_test
-
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDevice_test
-
01 enter`
);
it
(
"
InputDevice_getDevice_test
_
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDevice_test
_
01 enter`
);
try
{
inputDevice
.
getDevice
(
-
1
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
`InputDevice_getDevice_test
-
01
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`InputDevice_getDevice_test
_
01
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
expect
(
JSON
.
stringify
(
data
)
!==
"
{}
"
).
assertTrue
();
}
console
.
info
(
`InputDevice_getDevice_test
-
01 exit`
);
console
.
info
(
`InputDevice_getDevice_test
_
01 exit`
);
})
}
catch
(
error
)
{
console
.
info
(
`InputDevice_getDevice_test
-
01 error`
);
console
.
info
(
`InputDevice_getDevice_test
_
01 error`
);
expect
(
false
).
assertTrue
();
}
finally
{
done
();
...
...
@@ -119,21 +119,21 @@ export default function MultimodalInput_Device_test() {
})
// 参数正常,返回值正常
it
(
"
InputDevice_getDevice_test
-
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDevice_test
-
02 enter`
);
it
(
"
InputDevice_getDevice_test
_
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDevice_test
_
02 enter`
);
try
{
inputDevice
.
getDeviceIds
(
async
(
err
,
data
)
=>
{
console
.
info
(
`InputDevice_getDeviceIds_test
-
02 err:
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`InputDevice_getDeviceIds_test
-
02 data:
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
02 err:
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`InputDevice_getDeviceIds_test
_
02 data:
${
JSON
.
stringify
(
data
)}
`
);
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
`InputDevice_getDevice_test
-
02 for`
);
console
.
info
(
`InputDevice_getDevice_test
_
02 for`
);
await
getDevicePromise
(
data
[
i
])
}
function
getDevicePromise
(
data
)
{
console
.
info
(
`InputDevice_getDevice_test
-
02 getDevicePromise`
)
console
.
info
(
`InputDevice_getDevice_test
_
02 getDevicePromise`
)
return
new
Promise
((
resolve
,
reject
)
=>
{
inputDevice
.
getDevice
(
data
,
(
err
,
res
)
=>
{
console
.
info
(
`getDevice:data =
${
JSON
.
stringify
(
data
)}
`
);
...
...
@@ -150,7 +150,7 @@ export default function MultimodalInput_Device_test() {
expect
(
res
.
phys
).
assertInstanceOf
(
'
String
'
);
expect
(
res
.
uniq
).
assertInstanceOf
(
'
String
'
);
expect
(
res
).
assertInstanceOf
(
'
Object
'
);
console
.
info
(
`InputDevice_getDevice_test
-
02 getDevice expect res`
);
console
.
info
(
`InputDevice_getDevice_test
_
02 getDevice expect res`
);
for
(
let
j
=
0
;
j
<
res
.
axisRanges
.
length
;
j
++
)
{
expect
(
res
.
axisRanges
[
j
].
source
==
'
keyboard
'
||
res
.
axisRanges
[
j
].
source
==
'
mouse
'
||
res
.
axisRanges
[
j
].
source
==
'
touchpad
'
||
res
.
axisRanges
[
j
].
source
==
'
touchscreen
'
...
...
@@ -172,19 +172,19 @@ export default function MultimodalInput_Device_test() {
})
}
}
console
.
info
(
`InputDevice_getDevice_test
-
02 exit`
);
console
.
info
(
`InputDevice_getDevice_test
_
02 exit`
);
done
();
});
}
catch
(
error
)
{
console
.
info
(
`InputDevice_getDevice_test
-
02 error`
);
console
.
info
(
`InputDevice_getDevice_test
_
02 error`
);
expect
(
false
).
assertTrue
();
done
();
}
})
// 参数正常,返回值正常
it
(
"
InputDevice_supportKeys_test
-
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_supportKeys_test
-
01 enter`
);
it
(
"
InputDevice_supportKeys_test
_
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_supportKeys_test
_
01 enter`
);
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -196,19 +196,19 @@ export default function MultimodalInput_Device_test() {
});
}
}
console
.
info
(
`InputDevice_supportKeys_test
-
01 exit`
);
console
.
info
(
`InputDevice_supportKeys_test
_
01 exit`
);
done
();
});
}
catch
(
error
)
{
console
.
info
(
`InputDevice_supportKeys_test
-
01 error`
);
console
.
info
(
`InputDevice_supportKeys_test
_
01 error`
);
expect
(
false
).
assertTrue
();
done
();
}
})
// 第二个参数异常
it
(
"
InputDevice_supportKeys_test
-
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_supportKeys_test
-
02 enter`
);
it
(
"
InputDevice_supportKeys_test
_
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_supportKeys_test
_
02 enter`
);
try
{
inputDevice
.
supportKeys
(
0
,
2022
,
(
err
,
res
)
=>
{
console
.
info
(
res
);
...
...
@@ -216,13 +216,13 @@ export default function MultimodalInput_Device_test() {
}
catch
(
error
)
{
expect
(
error
.
message
).
assertEqual
(
"
Parameter error. The type of keys must be array.
"
);
}
console
.
info
(
`InputDevice_supportKeys_test
-
02 exit`
);
console
.
info
(
`InputDevice_supportKeys_test
_
02 exit`
);
done
();
})
// 参数正常
it
(
"
InputDevice_getKeyboardType_test
-
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getKeyboardType_test
-
01 enter`
);
it
(
"
InputDevice_getKeyboardType_test
_
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getKeyboardType_test
_
01 enter`
);
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -234,31 +234,31 @@ export default function MultimodalInput_Device_test() {
});
}
}
console
.
info
(
`InputDevice_getKeyboardType_test
-
01 exit`
);
console
.
info
(
`InputDevice_getKeyboardType_test
_
01 exit`
);
done
();
});
}
catch
(
error
)
{
console
.
info
(
`InputDevice_getKeyboardType_test
-
01 error`
);
console
.
info
(
`InputDevice_getKeyboardType_test
_
01 error`
);
expect
(
false
).
assertTrue
();
done
();
}
})
//参数异常
it
(
"
InputDevice_getKeyboardType_test
-
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getKeyboardType_test
-
02 enter`
);
it
(
"
InputDevice_getKeyboardType_test
_
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getKeyboardType_test
_
02 enter`
);
try
{
inputDevice
.
getKeyboardType
(
-
1
);
}
catch
(
error
)
{
expect
(
error
.
message
).
assertEqual
(
"
Invalid input device id
"
);
}
console
.
info
(
`InputDevice_getKeyboardType_test
-
02 exit`
);
console
.
info
(
`InputDevice_getKeyboardType_test
_
02 exit`
);
done
();
});
// 参数正常
it
(
"
InputDevice_getKeyboardType_test
-
03
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getKeyboardType_test
-
03 enter`
);
it
(
"
InputDevice_getKeyboardType_test
_
03
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getKeyboardType_test
_
03 enter`
);
try
{
inputDevice
.
getDeviceIds
((
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -268,16 +268,16 @@ export default function MultimodalInput_Device_test() {
inputDevice
.
getKeyboardType
(
data
[
i
]).
then
((
res
)
=>
{
expect
(
res
).
assertInstanceOf
(
'
Number
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
`InputDevice_getKeyboardType_test
-
03 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`InputDevice_getKeyboardType_test
_
03 failed, err=
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
});
}
}
console
.
info
(
`InputDevice_getKeyboardType_test
-
03 exit`
);
console
.
info
(
`InputDevice_getKeyboardType_test
_
03 exit`
);
done
();
});
}
catch
(
error
)
{
console
.
info
(
`InputDevice_getKeyboardType_test
-
03 error`
);
console
.
info
(
`InputDevice_getKeyboardType_test
_
03 error`
);
expect
(
false
).
assertTrue
();
done
();
}
...
...
@@ -461,7 +461,7 @@ export default function MultimodalInput_Device_test() {
* @tc.name MultimodalInputDevice_GetDeviceList_test
* @tc.desc inputdevice interface getDeviceList test
*/
it
(
"
InputDevice_getDeviceList_test
-
01
"
,
0
,
async
function
(
done
)
{
it
(
"
InputDevice_getDeviceList_test
_
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceList_async_test enter`
);
try
{
inputDevice
.
getDeviceList
((
err
,
data
)
=>
{
...
...
@@ -485,7 +485,7 @@ export default function MultimodalInput_Device_test() {
* @tc.name MultimodalInputDevice_GetDeviceList_test
* @tc.desc inputdevice interface getDeviceList test
*/
it
(
"
InputDevice_getDeviceList_test
-
02
"
,
0
,
async
function
(
done
)
{
it
(
"
InputDevice_getDeviceList_test
_
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceList_promise_test enter`
);
try
{
inputDevice
.
getDeviceList
().
then
(
data
=>
{
...
...
@@ -505,7 +505,7 @@ export default function MultimodalInput_Device_test() {
* @tc.name MultimodalInputDevice_GetDeviceInfo_test
* @tc.desc inputdevice interface getDeviceInfo test
*/
it
(
"
InputDevice_getDeviceInfo_test
-
01
"
,
0
,
async
function
(
done
)
{
it
(
"
InputDevice_getDeviceInfo_test
_
01
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceInfo_async_test enter`
);
try
{
await
inputDevice
.
getDeviceList
().
then
((
data
)
=>
{
...
...
@@ -557,12 +557,12 @@ export default function MultimodalInput_Device_test() {
done
()
})
}
catch
(
err
)
{
console
.
info
(
`InputDevice_getDeviceInfo_test
-
01 inputDevice.getDeviceInfo
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`InputDevice_getDeviceInfo_test
_
01 inputDevice.getDeviceInfo
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
})
}
catch
(
err
)
{
console
.
info
(
`InputDevice_getDeviceInfo_test
-
01 inputDevice.getDeviceList
${
JSON
.
stringify
(
err
)}
`
);
console
.
info
(
`InputDevice_getDeviceInfo_test
_
01 inputDevice.getDeviceList
${
JSON
.
stringify
(
err
)}
`
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
`InputDevice_getDeviceInfo_async_test exit`
);
...
...
@@ -573,7 +573,7 @@ export default function MultimodalInput_Device_test() {
* @tc.name MultimodalInputDevice_GetDeviceInfo_test
* @tc.desc inputdevice interface getDeviceInfo test
*/
it
(
"
InputDevice_getDeviceInfo_test
-
02
"
,
0
,
async
function
(
done
)
{
it
(
"
InputDevice_getDeviceInfo_test
_
02
"
,
0
,
async
function
(
done
)
{
console
.
info
(
`InputDevice_getDeviceInfo_promise_test enter`
);
try
{
inputDevice
.
getDeviceList
().
then
((
data
)
=>
{
...
...
multimodalinput/input_js_standard/src/main/js/test/List
Multimodalinput
.test.js
→
multimodalinput/input_js_standard/src/main/js/test/List.test.js
浏览文件 @
01a4bfae
...
...
@@ -13,11 +13,11 @@
* limitations under the License.
*/
import
MultimodalInput_
Device_test
from
'
./InputDevice.test.js
'
import
Input
Device_test
from
'
./InputDevice.test.js
'
import
MultimodalInput_KeyCode_test
from
'
./MultimodalInput_KeyCode.test.js
'
import
MultimodalInput_
Pointer_test
from
'
./Pointer.test.js
'
import
Pointer_test
from
'
./Pointer.test.js
'
export
default
function
testsuite
()
{
MultimodalInput_
Device_test
()
Input
Device_test
()
MultimodalInput_KeyCode_test
()
MultimodalInput_
Pointer_test
()
Pointer_test
()
}
\ No newline at end of file
multimodalinput/input_js_standard/src/main/js/test/Pointer.test.js
浏览文件 @
01a4bfae
...
...
@@ -16,8 +16,8 @@
import
pointer
from
'
@ohos.multimodalInput.pointer
'
import
window
from
'
@ohos.window
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
,
TestType
,
Size
,
Level
}
from
'
@ohos/hypium
'
export
default
function
MultimodalInput_
Pointer_test
()
{
describe
(
'
MultimodalInput_
Pointer_test
'
,
function
()
{
export
default
function
Pointer_test
()
{
describe
(
'
Pointer_test
'
,
function
()
{
const
errCode
=
{
COMMON_PARAMETER_CODE
:
401
...
...
multimodalinput/multimodalinput_ets_standard/entry/src/main/ets/test/MultimodalInputEventType.test.ets
浏览文件 @
01a4bfae
...
...
@@ -24,7 +24,7 @@ import { Touch, TouchEvent } from '@ohos.multimodalInput.touchEvent'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestType, Size, Level } from '@ohos/hypium'
export default function MultimodalInputEventTypeTest() {
describe('MultimodalInput
_t
est', function () {
describe('MultimodalInput
EventTypeT
est', function () {
it('MultimodalInput_KeyEventTypeTest_0010', 0, function () {
console.info(`MultimodalInput_KeyEventTypeTest_0010 enter`);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录