Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d0b59186
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看板
未验证
提交
d0b59186
编写于
2月 16, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 16, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7597 新增function功能用例
Merge pull request !7597 from 李晓枫/Function0215
上级
8d708a18
d4914976
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
134 addition
and
14 deletion
+134
-14
usb/usb_standard/src/main/js/test/UsbPortAndFunctionJsunit.test.js
...tandard/src/main/js/test/UsbPortAndFunctionJsunit.test.js
+134
-14
未找到文件。
usb/usb_standard/src/main/js/test/UsbPortAndFunctionJsunit.test.js
浏览文件 @
d0b59186
/*
* Copyright (c) 2021-202
2
Huawei Device Co., Ltd.
* Copyright (c) 2021-202
3
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -60,7 +60,7 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
console
.
info
(
'
usb case
'
+
caseName
+
'
error :
'
+
error
);
expect
(
false
).
assertTrue
();
});
CheckEmptyUtils
.
sleep
(
6000
)
CheckEmptyUtils
.
sleep
(
6000
)
;
}
/**
...
...
@@ -69,13 +69,13 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 1, Set as ACM function
*/
it
(
'
SUB_USB_JS_0350
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
)
CheckEmptyUtils
.
sleep
(
3000
)
;
console
.
info
(
'
usb SUB_USB_JS_0350 set ACM begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_0350 ACM 1
'
,
usb
.
ACM
)
callSetCurFunction
(
'
SUB_USB_JS_0350 ACM 1
'
,
usb
.
ACM
)
;
})
/**
...
...
@@ -84,13 +84,13 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 2, Set as ECM function
*/
it
(
'
SUB_USB_JS_0360
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
)
CheckEmptyUtils
.
sleep
(
3000
)
;
console
.
info
(
'
usb SUB_USB_JS_0360 set ECM begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_0360 ECM 2
'
,
usb
.
ECM
)
callSetCurFunction
(
'
SUB_USB_JS_0360 ECM 2
'
,
usb
.
ECM
)
;
})
/**
...
...
@@ -99,13 +99,13 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 3, Set as ACM、ECM function
*/
it
(
'
SUB_USB_JS_0370
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
)
CheckEmptyUtils
.
sleep
(
3000
)
;
console
.
info
(
'
usb SUB_USB_JS_0370 set ACM ECM begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_0370 ACM ECM 3
'
,
(
usb
.
ACM
|
usb
.
ECM
))
callSetCurFunction
(
'
SUB_USB_JS_0370 ACM ECM 3
'
,
(
usb
.
ACM
|
usb
.
ECM
))
;
})
/**
...
...
@@ -114,13 +114,13 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 4, Set as HDC function
*/
it
(
'
SUB_USB_JS_0380
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
)
CheckEmptyUtils
.
sleep
(
3000
)
;
console
.
info
(
'
usb SUB_USB_JS_0380 set HDC begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_0380 HDC 4
'
,
usb
.
HDC
)
callSetCurFunction
(
'
SUB_USB_JS_0380 HDC 4
'
,
usb
.
HDC
)
;
})
/**
...
...
@@ -129,13 +129,13 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 5, Set as ACM、HDC function
*/
it
(
'
SUB_USB_JS_0390
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
)
CheckEmptyUtils
.
sleep
(
3000
)
;
console
.
info
(
'
usb SUB_USB_JS_0390 set ACM HDC begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_0390 ACM HDC 5
'
,
(
usb
.
HDC
|
usb
.
ACM
))
callSetCurFunction
(
'
SUB_USB_JS_0390 ACM HDC 5
'
,
(
usb
.
HDC
|
usb
.
ACM
))
;
})
/**
...
...
@@ -144,13 +144,133 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 6, Set as ECM、HDC function
*/
it
(
'
SUB_USB_JS_0400
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
)
CheckEmptyUtils
.
sleep
(
3000
)
;
console
.
info
(
'
usb SUB_USB_JS_0400 set ECM HDC begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_0400 ECM HDC 6
'
,
(
usb
.
HDC
|
usb
.
ECM
))
callSetCurFunction
(
'
SUB_USB_JS_0400 ECM HDC 6
'
,
(
usb
.
HDC
|
usb
.
ECM
));
})
/**
* @tc.number: SUB_USB_JS_1620
* @tc.name: functions_test
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 8, Set as MTP function
*/
it
(
'
SUB_USB_JS_1620
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
);
console
.
info
(
'
usb SUB_USB_JS_1620 set MTP begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_1620 MTP 8
'
,
(
usb
.
MTP
));
})
/**
* @tc.number: SUB_USB_JS_1630
* @tc.name: functions_test
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 12, Set as MTP、HDC function
*/
it
(
'
SUB_USB_JS_1630
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
);
console
.
info
(
'
usb SUB_USB_JS_1630 set MTP HDC begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_1630 MTP HDC 12
'
,
(
usb
.
MTP
|
usb
.
HDC
));
})
/**
* @tc.number: SUB_USB_JS_1640
* @tc.name: functions_test
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 16, Set as PTP function
*/
it
(
'
SUB_USB_JS_1640
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
);
console
.
info
(
'
usb SUB_USB_JS_1640 set PTP begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_1640 PTP 16
'
,
(
usb
.
PTP
));
})
/**
* @tc.number: SUB_USB_JS_1650
* @tc.name: functions_test
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 20, Set as PTP、HDC function
*/
it
(
'
SUB_USB_JS_1650
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
);
console
.
info
(
'
usb SUB_USB_JS_1650 set PTP HDC begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_1650 PTP HDC 20
'
,
(
usb
.
PTP
|
usb
.
HDC
));
})
/**
* @tc.number: SUB_USB_JS_1660
* @tc.name: functions_test
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 32, Set as RNDIS function
*/
it
(
'
SUB_USB_JS_1660
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
);
console
.
info
(
'
usb SUB_USB_JS_1660 set RNDIS begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_1660 RNDIS 32
'
,
(
usb
.
RNDIS
));
})
/**
* @tc.number: SUB_USB_JS_1670
* @tc.name: functions_test
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 36, Set as RNDIS、HDC function
*/
it
(
'
SUB_USB_JS_1670
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
);
console
.
info
(
'
usb SUB_USB_JS_1670 set RNDIS HDC begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_1670 RNDIS HDC 36
'
,
(
usb
.
RNDIS
|
usb
.
HDC
));
})
/**
* @tc.number: SUB_USB_JS_1680
* @tc.name: functions_test
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 512, Set as STORAGE function
*/
it
(
'
SUB_USB_JS_1680
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
);
console
.
info
(
'
usb SUB_USB_JS_1680 set STORAGE begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_1680 STORAGE 512
'
,
(
usb
.
STORAGE
));
})
/**
* @tc.number: SUB_USB_JS_1690
* @tc.name: functions_test
* @tc.desc: Positive test: Set the current USB function list in device mode, Set 516, Set as STORAGE、HDC function
*/
it
(
'
SUB_USB_JS_1690
'
,
0
,
function
()
{
CheckEmptyUtils
.
sleep
(
3000
);
console
.
info
(
'
usb SUB_USB_JS_1690 set STORAGE HDC begin
'
);
var
maskCode
=
usb
.
getCurrentFunctions
();
console
.
info
(
'
usb case getCurrentFunctions return:
'
+
maskCode
);
var
funcString
=
usb
.
usbFunctionsToString
(
maskCode
);
console
.
info
(
'
usb case funcString:
'
+
funcString
);
callSetCurFunction
(
'
SUB_USB_JS_1690 STORAGE HDC 516
'
,
(
usb
.
STORAGE
|
usb
.
HDC
));
})
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录