未验证 提交 6a1cf8dd 编写于 作者: O openharmony_ci 提交者: Gitee

!7920 【xts_acts】【master】适配用例

Merge pull request !7920 from 李晓枫/usbJs_0311
......@@ -32,6 +32,10 @@ describe('UsbCoreJsFunctionsTest', function () {
console.info('begin test getversion :' + Version)
// version > 17 host currentMode = 2 device currentMode = 1
var usbPortList = usb.getPorts()
if (usbPortList == undefined) {
portCurrentMode = 1;
return
}
gDeviceList = usb.getDevices();
if (usbPortList.length > 0) {
console.info('usb case gDeviceList.length return: ' + gDeviceList.length);
......
......@@ -32,6 +32,10 @@ describe('UsbCoreJsFunctionsTestEx', function () {
console.info('begin test getversion :' + Version)
// version > 17 host currentMode = 2 device currentMode = 1
var usbPortList = usb.getPorts()
if (usbPortList == undefined) {
portCurrentMode = 1;
return
}
gDeviceList = usb.getDevices();
if (usbPortList.length > 0) {
if (gDeviceList.length > 0) {
......
......@@ -33,6 +33,10 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
console.info('usb unit begin test getversion :' + Version)
// version > 17 host currentMode = 2 device currentMode = 1
var usbPortList = usb.getPorts()
if (usbPortList == undefined) {
portCurrentMode = 1;
return
}
gDeviceList = usb.getDevices();
if (usbPortList.length > 0) {
if (gDeviceList.length > 0) {
......
......@@ -33,6 +33,10 @@ describe('UsbDevicePipeJsFunctionsTestEx', function () {
// version > 17 host currentMode = 2 device currentMode = 1
var usbPortList = usb.getPorts()
if (usbPortList == undefined) {
portCurrentMode = 1;
return
}
gDeviceList = usb.getDevices();
if (usbPortList.length > 0) {
if (gDeviceList.length > 0) {
......
/*
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册