提交 174ccdeb 编写于 作者: L lixiaofeng_154b

【xts_acts】【master】XTS测试套件部件化配置,新增UsbPortAndFunctionJsunit.test.js文件

Signed-off-by: Nlixiaofeng_154b <lixiaofeng54@huawei.com>
Change-Id: I051a790c43e7f8f806c4407896d5c1f43a038cf9
上级 5fd1c9d3
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
...@@ -21,6 +21,8 @@ ohos_js_hap_suite("usb_js_test") { ...@@ -21,6 +21,8 @@ ohos_js_hap_suite("usb_js_test") {
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsUsbJSApiTest" hap_name = "ActsUsbJSApiTest"
subsystem_name = "usb"
part_name = "usb_manager"
} }
ohos_js_assets("usb_js_assets") { ohos_js_assets("usb_js_assets") {
js2abc = true js2abc = true
......
...@@ -19,6 +19,7 @@ import UsbPortJsFunctionsTestEx from './UsbPortJsunitEx.test.js' ...@@ -19,6 +19,7 @@ import UsbPortJsFunctionsTestEx from './UsbPortJsunitEx.test.js'
import UsbFunctionsJsFunctionsTestEx from './UsbFunctionsJsunitEx.test.js' import UsbFunctionsJsFunctionsTestEx from './UsbFunctionsJsunitEx.test.js'
import UsbFunctionsJsFunctionsTest from './UsbFunctionsJsunit.test.js' import UsbFunctionsJsFunctionsTest from './UsbFunctionsJsunit.test.js'
import UsbDevicePipeJsFunctionsTest from './UsbDevicePipeJsunit.test.js' import UsbDevicePipeJsFunctionsTest from './UsbDevicePipeJsunit.test.js'
import UsbDevicePipeJsFunctionsTestA from './UsbDevicePipeJsunit_A.test.js'
import UsbDevicePipeJsFunctionsTestEx from './UsbDevicePipeJsunitEx.test.js' import UsbDevicePipeJsFunctionsTestEx from './UsbDevicePipeJsunitEx.test.js'
import UsbCoreJsFunctionsTest from './UsbCoreJsunit.test.js' import UsbCoreJsFunctionsTest from './UsbCoreJsunit.test.js'
import UsbCoreJsFunctionsTestEx from './UsbCoreJsunitEx.test.js' import UsbCoreJsFunctionsTestEx from './UsbCoreJsunitEx.test.js'
...@@ -28,6 +29,7 @@ UsbAutoJsunit() ...@@ -28,6 +29,7 @@ UsbAutoJsunit()
UsbCoreJsFunctionsTest() UsbCoreJsFunctionsTest()
UsbCoreJsFunctionsTestEx() UsbCoreJsFunctionsTestEx()
UsbDevicePipeJsFunctionsTest() UsbDevicePipeJsFunctionsTest()
UsbDevicePipeJsFunctionsTestA()
UsbDevicePipeJsFunctionsTestEx() UsbDevicePipeJsFunctionsTestEx()
UsbFunctionsJsFunctionsTest() UsbFunctionsJsFunctionsTest()
UsbFunctionsJsFunctionsTestEx() UsbFunctionsJsFunctionsTestEx()
......
...@@ -20,14 +20,14 @@ import parameter from '@ohos.systemparameter'; ...@@ -20,14 +20,14 @@ import parameter from '@ohos.systemparameter';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
/* usb device pipe test */ /* usb device pipe test */
export default function UsbDevicePipeJsFunctionsTest() { export default function UsbDevicePipeJsFunctionsTestA() {
describe('UsbDevicePipeJsFunctionsTest', function () { describe('UsbDevicePipeJsFunctionsTestA', function () {
var gDeviceList var gDeviceList
var gPipe var gPipe
var portCurrentMode var portCurrentMode
beforeAll(function () { beforeAll(function () {
console.log('*************Usb Unit UsbDevicePipeJsFunctionsTest Begin*************'); console.log('*************Usb Unit UsbDevicePipeJsFunctionsTestA Begin*************');
var Version = usb.getVersion() var Version = usb.getVersion()
console.info('usb unit begin test getversion :' + Version) console.info('usb unit begin test getversion :' + Version)
// version > 17 host currentMode = 2 device currentMode = 1 // version > 17 host currentMode = 2 device currentMode = 1
...@@ -151,6 +151,12 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -151,6 +151,12 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0630', 0, function () { it('SUB_USB_JS_0630', 0, function () {
console.info('usb SUB_USB_JS_0630 begin'); console.info('usb SUB_USB_JS_0630 begin');
console.info('usb SUB_USB_JS_0630 portcurrentMode ret : ' + portCurrentMode)
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.interface == null || testParam.inEndpoint == null) { if (testParam.interface == null || testParam.inEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -180,6 +186,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -180,6 +186,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0640', 0, function () { it('SUB_USB_JS_0640', 0, function () {
console.info('usb SUB_USB_JS_0640 begin'); console.info('usb SUB_USB_JS_0640 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.interface == null || testParam.outEndpoint == null) { if (testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -217,6 +228,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -217,6 +228,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0420', 0, function () { it('SUB_USB_JS_0420', 0, function () {
console.info('usb SUB_USB_JS_0420 begin'); console.info('usb SUB_USB_JS_0420 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
if (gDeviceList.length == 0) { if (gDeviceList.length == 0) {
console.info('usb 01 case get_device_list is null') console.info('usb 01 case get_device_list is null')
expect(gDeviceList.length).assertEqual(-1); expect(gDeviceList.length).assertEqual(-1);
...@@ -278,6 +294,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -278,6 +294,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0740', 0, function () { it('SUB_USB_JS_0740', 0, function () {
console.info('usb SUB_USB_JS_0740 begin'); console.info('usb SUB_USB_JS_0740 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
if (gDeviceList.length == 0) { if (gDeviceList.length == 0) {
console.info('usb case get_device_list is null') console.info('usb case get_device_list is null')
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -308,6 +329,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -308,6 +329,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0750', 0, function () { it('SUB_USB_JS_0750', 0, function () {
console.info('usb SUB_USB_JS_0750 begin'); console.info('usb SUB_USB_JS_0750 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
if (gDeviceList.length == 0) { if (gDeviceList.length == 0) {
console.info('usb case get_device_list is null') console.info('usb case get_device_list is null')
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -332,6 +358,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -332,6 +358,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0800', 0, function () { it('SUB_USB_JS_0800', 0, function () {
console.info('usb SUB_USB_JS_0800 begin'); console.info('usb SUB_USB_JS_0800 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
if (gDeviceList.length == 0) { if (gDeviceList.length == 0) {
console.info('usb case get_device_list is null') console.info('usb case get_device_list is null')
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -359,6 +390,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -359,6 +390,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0810', 0, function () { it('SUB_USB_JS_0810', 0, function () {
console.info('usb SUB_USB_JS_0810 begin'); console.info('usb SUB_USB_JS_0810 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
if (gDeviceList.length == 0) { if (gDeviceList.length == 0) {
console.info('usb case get_device_list is null') console.info('usb case get_device_list is null')
expect(false).assertTrue() expect(false).assertTrue()
...@@ -401,6 +437,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -401,6 +437,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0540', 0, function () { it('SUB_USB_JS_0540', 0, function () {
console.info('usb SUB_USB_JS_0540 begin'); console.info('usb SUB_USB_JS_0540 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -420,6 +461,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -420,6 +461,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0550', 0, function () { it('SUB_USB_JS_0550', 0, function () {
console.info('usb SUB_USB_JS_0550 begin'); console.info('usb SUB_USB_JS_0550 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -439,6 +485,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -439,6 +485,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0560', 0, function () { it('SUB_USB_JS_0560', 0, function () {
console.info('usb SUB_USB_JS_0560 begin'); console.info('usb SUB_USB_JS_0560 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -458,6 +509,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -458,6 +509,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0570', 0, function () { it('SUB_USB_JS_0570', 0, function () {
console.info('usb SUB_USB_JS_0570 begin'); console.info('usb SUB_USB_JS_0570 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -477,6 +533,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -477,6 +533,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0580', 0, function () { it('SUB_USB_JS_0580', 0, function () {
console.info('usb SUB_USB_JS_0580 begin'); console.info('usb SUB_USB_JS_0580 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -496,6 +557,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -496,6 +557,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0590', 0, function () { it('SUB_USB_JS_0590', 0, function () {
console.info('usb SUB_USB_JS_0590 begin'); console.info('usb SUB_USB_JS_0590 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -515,6 +581,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -515,6 +581,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0600', 0, function () { it('SUB_USB_JS_0600', 0, function () {
console.info('usb SUB_USB_JS_0600 begin'); console.info('usb SUB_USB_JS_0600 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -534,6 +605,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -534,6 +605,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0610', 0, function () { it('SUB_USB_JS_0610', 0, function () {
console.info('usb SUB_USB_JS_0610 begin'); console.info('usb SUB_USB_JS_0610 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -553,6 +629,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () { ...@@ -553,6 +629,11 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
*/ */
it('SUB_USB_JS_0620', 0, function () { it('SUB_USB_JS_0620', 0, function () {
console.info('usb SUB_USB_JS_0620 begin'); console.info('usb SUB_USB_JS_0620 begin');
if (portCurrentMode == 1) {
console.info('usb case get_device port is device')
expect(false).assertFalse();
return
}
var testParam = getTransferTestParam() var testParam = getTransferTestParam()
if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) { if (testParam.inEndpoint == null || testParam.interface == null || testParam.outEndpoint == null) {
expect(false).assertTrue(); expect(false).assertTrue();
......
...@@ -77,11 +77,11 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () { ...@@ -77,11 +77,11 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
callSetCurFunction('SUB_USB_JS_0350 ACM 1', usb.ACM) callSetCurFunction('SUB_USB_JS_0350 ACM 1', usb.ACM)
}) })
// /** /**
// * @tc.number : SUB_USB_JS_0360 * @tc.number : SUB_USB_JS_0360
// * @tc.name : functions_test * @tc.name : functions_test
// * @tc.desc : 在设备模式下设置当前的USB功能列表 Set 2 设置为ECM功能 * @tc.desc : 在设备模式下设置当前的USB功能列表 Set 2 设置为ECM功能
// */ */
it('SUB_USB_JS_0360', 0, function () { it('SUB_USB_JS_0360', 0, function () {
CheckEmptyUtils.sleep(3000) CheckEmptyUtils.sleep(3000)
console.info('usb SUB_USB_JS_0360 set ECM begin'); console.info('usb SUB_USB_JS_0360 set ECM begin');
...@@ -92,11 +92,11 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () { ...@@ -92,11 +92,11 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () {
callSetCurFunction('SUB_USB_JS_0360 ECM 2', usb.ECM) callSetCurFunction('SUB_USB_JS_0360 ECM 2', usb.ECM)
}) })
// /** /**
// * @tc.number : SUB_USB_JS_0370 * @tc.number : SUB_USB_JS_0370
// * @tc.name : functions_test * @tc.name : functions_test
// * @tc.desc : 在设备模式下设置当前的USB功能列表 Set 3 设置为ACM、ECM功能 * @tc.desc : 在设备模式下设置当前的USB功能列表 Set 3 设置为ACM、ECM功能
// */ */
it('SUB_USB_JS_0370', 0, 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'); console.info('usb SUB_USB_JS_0370 set ACM ECM begin');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册