diff --git a/usb/usb_standard/src/main/js/test/UsbAutoJsunit.test.js b/usb/usb_standard/src/main/js/test/UsbAutoJsunit.test.js index 0543745ef38cea295ef5f9a98bc43646166f816f..fc3dc3b551bc08a614e48472ecf6659dd397249a 100644 --- a/usb/usb_standard/src/main/js/test/UsbAutoJsunit.test.js +++ b/usb/usb_standard/src/main/js/test/UsbAutoJsunit.test.js @@ -132,7 +132,7 @@ describe('UsbAutoJsunit', function () { console.info('usb SUB_USB_JS_0980 begin'); var maskCode = 5 var strMaskCode = usb.usbFunctionsToString(maskCode) - expect(strMaskCode).assertEqual('hdc,acm'); + expect(strMaskCode).assertEqual('acm,hdc'); console.info('usb case maskCode ' + maskCode + ' usbFunctionsToString return int: ' + strMaskCode); console.info('usb SUB_USB_JS_0980 : PASS'); }) @@ -146,7 +146,7 @@ describe('UsbAutoJsunit', function () { console.info('usb SUB_USB_JS_0990 begin'); var maskCode = 6 var strMaskCode = usb.usbFunctionsToString(maskCode) - expect(strMaskCode).assertEqual('hdc,ecm'); + expect(strMaskCode).assertEqual('ecm,hdc'); console.info('usb case maskCode ' + maskCode + ' usbFunctionsToString return int: ' + strMaskCode); console.info('usb SUB_USB_JS_0990 : PASS'); }) diff --git a/usb/usb_standard/src/main/js/test/UsbCoreJsunit.test.js b/usb/usb_standard/src/main/js/test/UsbCoreJsunit.test.js index 708f69cd33b889afcc39e658a8ee0075bb55b40e..9a3b933a29bf3fa3ff817aee6a6512fa3ee87dfa 100644 --- a/usb/usb_standard/src/main/js/test/UsbCoreJsunit.test.js +++ b/usb/usb_standard/src/main/js/test/UsbCoreJsunit.test.js @@ -141,6 +141,7 @@ describe('UsbCoreJsFunctionsTest', function () { console.info('usb case device request right failed : ' + error + ' :' + gDeviceList[i].name); expect(false).assertTrue(); }); + CheckEmptyUtils.sleep(5000); } }) @@ -168,7 +169,7 @@ describe('UsbCoreJsFunctionsTest', function () { }).catch(error => { console.info('usb 01 requestRight error:' + error); }); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } gPipe = usb.connectDevice(gDeviceList[0]) diff --git a/usb/usb_standard/src/main/js/test/UsbCoreJsunitEx.test.js b/usb/usb_standard/src/main/js/test/UsbCoreJsunitEx.test.js index 1685e45617d21c494314d466d448accdaaf619e1..3eeb5f217ce01a8bbaa367e787c8f26e09135604 100644 --- a/usb/usb_standard/src/main/js/test/UsbCoreJsunitEx.test.js +++ b/usb/usb_standard/src/main/js/test/UsbCoreJsunitEx.test.js @@ -41,6 +41,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { }).catch(error => { console.info('usb case setPortRolesEx error : ' + error); }); + CheckEmptyUtils.sleep(8000) console.log('*************Usb Unit Begin switch to host*************'); } } else { @@ -84,7 +85,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb JS_0100 requestRight error:' + error); }); console.info('usb JS_0100 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -126,7 +127,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb JS_0110 requestRight error:' + error); }); console.info('usb JS_0110 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -167,7 +168,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb JS_0120 requestRight error:' + error); }); console.info('usb JS_0120 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -211,7 +212,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb JS_0130 requestRight error:' + error); }); console.info('usb JS_0130 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -223,10 +224,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb connectDevice fail:' + err); } console.info('usb case connectDevice ret: ' + JSON.stringify(usbDevicePipe) + ' name ' + device.name); - expect(CheckEmptyUtils.isEmpty(usbDevicePipe)).assertFalse(); - var isPipClose = usb.closePipe(usbDevicePipe); - console.info('usb case closePipe ret: ' + isPipClose); - expect(isPipClose).assertEqual(0); + expect(CheckEmptyUtils.isEmpty(usbDevicePipe)).assertTrue(); console.info('usb SUB_USB_JS_0130 : PASS'); }) @@ -254,7 +252,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb JS_0140 requestRight error:' + error); }); console.info('usb JS_0140 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -267,10 +265,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { } console.info('usb case connectDevice ret: ' + JSON.stringify(usbDevicePipe) + ' manufacturerName ' + device.manufacturerName); - expect(CheckEmptyUtils.isEmpty(usbDevicePipe)).assertFalse(); - var isPipClose = usb.closePipe(usbDevicePipe); - console.info('usb case closePipe ret: ' + isPipClose); - expect(isPipClose).assertEqual(0); + expect(CheckEmptyUtils.isEmpty(usbDevicePipe)).assertTrue(); console.info('usb SUB_USB_JS_0140 : PASS'); }) @@ -298,7 +293,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb SUB_USB_JS_0150 requestRight error:' + error); }); console.info('usb SUB_USB_JS_0150 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -342,7 +337,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb SUB_USB_JS_0160 requestRight error:' + error); }); console.info('usb SUB_USB_JS_0160 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -386,7 +381,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb SUB_USB_JS_0170 requestRight error:' + error); }); console.info('usb SUB_USB_JS_0170 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -430,7 +425,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb SUB_USB_JS_0180 requestRight error:' + error); }); console.info('usb SUB_USB_JS_0180 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -474,7 +469,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb SUB_USB_JS_0190 requestRight error:' + error); }); console.info('usb SUB_USB_JS_0190 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -517,7 +512,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb SUB_USB_JS_0200 requestRight error:' + error); }); console.info('usb SUB_USB_JS_0200 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -560,7 +555,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { console.info('usb SUB_USB_JS_0210 requestRight error:' + error); }); console.info('usb SUB_USB_JS_0210 requestRight end:'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(5000) } var device = JSON.parse(JSON.stringify(gDeviceList[0])); @@ -668,6 +663,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { expect(error).assertFalse(); console.info('usb SUB_USB_JS_0690 error: ' + error); }); + CheckEmptyUtils.sleep(5000); } }) @@ -700,6 +696,7 @@ describe('UsbCoreJsFunctionsTestEx', function () { expect(error).assertFalse(); console.info('usb SUB_USB_JS_0700 error: ' + error); }); + CheckEmptyUtils.sleep(5000); } }) }) diff --git a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit.test.js b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit.test.js index 3ba4e2305bd035c43b25cc41d6317ff1a18859bd..a2ad02d7d28be59836181f2897241c57ab4bc5d4 100644 --- a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit.test.js +++ b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit.test.js @@ -43,6 +43,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { }).catch(error => { console.info('usb case setPortRoles error : ' + error); }); + CheckEmptyUtils.sleep(8000) console.log('*************Usb Unit switch to host Begin*************'); } } else { @@ -171,6 +172,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { console.info('usb case readData error : ' + JSON.stringify(error)); expect(false).assertTrue(); }); + CheckEmptyUtils.sleep(3000); }) /** @@ -212,7 +214,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { console.info('usb write error : ' + JSON.stringify(error)); expect(false).assertTrue(); }); - + CheckEmptyUtils.sleep(3000); }) /** @@ -413,6 +415,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () { console.info('usb' + caseName + ': PASS'); expect(false).assertTrue(); }); + CheckEmptyUtils.sleep(3000); } /** diff --git a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunitEx.test.js b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunitEx.test.js index 1e963c6d1ca7992977f066862a85d50762a8287b..c46a737ad3ae084a5012bcac08be45d910976767 100644 --- a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunitEx.test.js +++ b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunitEx.test.js @@ -45,7 +45,7 @@ describe('UsbDevicePipeJsFunctionsTestEx', function () { }); console.log('*************Usb Unit switch to host Ex Begin*************'); - CheckEmptyUtils.sleep(3000) + CheckEmptyUtils.sleep(8000) } } else { portCurrentMode = 1 @@ -174,6 +174,7 @@ describe('UsbDevicePipeJsFunctionsTestEx', function () { expect(false).assertFalse(); console.info('usb case SUB_USB_JS_0650 : PASS'); }); + CheckEmptyUtils.sleep(3000); }) /** @@ -210,6 +211,7 @@ describe('UsbDevicePipeJsFunctionsTestEx', function () { expect(false).assertFalse(); console.info('usb case SUB_USB_JS_0660 : PASS'); }); + CheckEmptyUtils.sleep(3000); }) /** @@ -246,6 +248,7 @@ describe('UsbDevicePipeJsFunctionsTestEx', function () { expect(false).assertFalse(); console.info('usb case SUB_USB_JS_0670 : PASS'); }); + CheckEmptyUtils.sleep(3000); }) /** diff --git a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit_A.test.js b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit_A.test.js index c5e9776e87e29e7b7c566bbb623636e616f95076..50394c948031523467fe272f22a12364a703b1da 100644 --- a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit_A.test.js +++ b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit_A.test.js @@ -42,6 +42,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () { }).catch(error => { console.info('usb case setPortRoles error : ' + error); }); + CheckEmptyUtils.sleep(8000) console.log('*************Usb Unit switch to host Begin*************'); } } else { @@ -177,6 +178,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () { console.info('usb case readData error : ' + JSON.stringify(error)); expect(false).assertTrue(); }); + CheckEmptyUtils.sleep(3000); }) /** @@ -218,7 +220,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () { console.info('usb write error : ' + JSON.stringify(error)); expect(false).assertTrue(); }); - + CheckEmptyUtils.sleep(3000); }) /** @@ -428,6 +430,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () { console.info('usb' + caseName + ': PASS'); expect(false).assertTrue(); }); + CheckEmptyUtils.sleep(3000); } /** diff --git a/usb/usb_standard/src/main/js/test/UsbFunctionsJsunit.test.js b/usb/usb_standard/src/main/js/test/UsbFunctionsJsunit.test.js index a436e212c0c5f5f73be77f1d4309af3a222ea923..3a0b8e0905dde90abc5cddfddfb04181270b9dad 100644 --- a/usb/usb_standard/src/main/js/test/UsbFunctionsJsunit.test.js +++ b/usb/usb_standard/src/main/js/test/UsbFunctionsJsunit.test.js @@ -34,6 +34,7 @@ describe('UsbFunctionsJsFunctionsTest', function () { }).catch(error => { console.info('usb case setPortRoles error : ' + error); }); + CheckEmptyUtils.sleep(8000) console.log('*************Usb Unit switch to device Begin*************'); } } diff --git a/usb/usb_standard/src/main/js/test/UsbFunctionsJsunitEx.test.js b/usb/usb_standard/src/main/js/test/UsbFunctionsJsunitEx.test.js index ab794fe7108aa8f54fd739662c6367b22dd3114e..a0e4895bf06624b4b10c15bc9f4ec10541815088 100644 --- a/usb/usb_standard/src/main/js/test/UsbFunctionsJsunitEx.test.js +++ b/usb/usb_standard/src/main/js/test/UsbFunctionsJsunitEx.test.js @@ -33,7 +33,7 @@ describe('UsbFunctionsJsFunctionsTestEx', function () { }).catch(error => { console.info('usb case setPortRoles error : ' + error); }); - + CheckEmptyUtils.sleep(8000) console.log('*************Usb Unit switch to device Begin*************'); } } @@ -135,7 +135,7 @@ describe('UsbFunctionsJsFunctionsTestEx', function () { var maskCode = usb.ACM | usb.HDC console.info('usb case maskCode : ' + maskCode); var strMaskCode = usb.usbFunctionsToString(maskCode) - expect(strMaskCode).assertEqual('hdc,acm'); + expect(strMaskCode).assertEqual('acm,hdc'); console.info('usb case maskCode ' + maskCode + ' usbFunctionsToString return int: ' + strMaskCode); console.info('usb SUB_USB_JS_0980 : PASS'); }) @@ -150,7 +150,7 @@ describe('UsbFunctionsJsFunctionsTestEx', function () { var maskCode = usb.ECM | usb.HDC console.info('usb case maskCode : ' + maskCode); var strMaskCode = usb.usbFunctionsToString(maskCode) - expect(strMaskCode).assertEqual('hdc,ecm'); + expect(strMaskCode).assertEqual('ecm,hdc'); console.info('usb case maskCode ' + maskCode + ' usbFunctionsToString return int: ' + strMaskCode); console.info('usb SUB_USB_JS_0990 : PASS'); }) diff --git a/usb/usb_standard/src/main/js/test/UsbPortAndFunctionJsunit.test.js b/usb/usb_standard/src/main/js/test/UsbPortAndFunctionJsunit.test.js index bf82bcf6639c76d8f2cea61bf839b9eb8473f491..6272a1b0f9b2cbdea93ad25ee7e290506094acc4 100644 --- a/usb/usb_standard/src/main/js/test/UsbPortAndFunctionJsunit.test.js +++ b/usb/usb_standard/src/main/js/test/UsbPortAndFunctionJsunit.test.js @@ -34,6 +34,7 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () { }).catch(error => { console.info('usb case setPortRoles error : ' + error); }); + CheckEmptyUtils.sleep(8000) console.log('*************Usb Unit switch to device Begin*************'); } } @@ -49,7 +50,6 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () { }) function callSetCurFunction(caseName, iValue) { - CheckEmptyUtils.sleep(3000) console.info('usb case param case name:' + caseName); console.info('usb case param iValue:' + iValue); usb.setCurrentFunctions(iValue).then(data => { @@ -60,6 +60,7 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () { console.info('usb case ' + caseName + ' error : ' + error); expect(false).assertTrue(); }); + CheckEmptyUtils.sleep(6000) } /** @@ -175,6 +176,7 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () { console.info('usb case setPortRoles error : ' + error); expect(false).assertTrue(); }); + CheckEmptyUtils.sleep(8000) } console.info('usb SUB_USB_JS_0010 device 2 2: PASS'); @@ -197,7 +199,6 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () { for (var i = 0; i < usbPortList.length; i++) { console.info('usb case set data role 1, data role 1'); - CheckEmptyUtils.sleep(5000) usb.setPortRoles(usbPortList[i].id, usb.SOURCE, usb.HOST).then(data => { expect(data).assertTrue(); console.info('usb case setPortRoles return: ' + data); @@ -205,6 +206,7 @@ describe('UsbPortAndFunctionsJsFunctionsTest', function () { console.info('usb case setPortRoles error : ' + error); expect(false).assertTrue(); }); + CheckEmptyUtils.sleep(8000) } console.info('usb SUB_USB_JS_0020 host 1 1: PASS'); diff --git a/usb/usb_standard/src/main/js/test/UsbPortJsunitEx.test.js b/usb/usb_standard/src/main/js/test/UsbPortJsunitEx.test.js index 7afbf9d16cd57454f19b9c6a75c616f9c7d01868..38d1c473f009fb81c38432a2df61857129b36cee 100644 --- a/usb/usb_standard/src/main/js/test/UsbPortJsunitEx.test.js +++ b/usb/usb_standard/src/main/js/test/UsbPortJsunitEx.test.js @@ -72,7 +72,6 @@ describe('UsbPortJsFunctionsTestEx', function () { var portId = gPort.id; var powerRole = usb.SINK; var dataRole = usb.NONE - 1; - CheckEmptyUtils.sleep(2000) usb.setPortRoles(portId, powerRole, dataRole).then(data => { console.info('usb case setPortRoles return: ' + data); expect(data).assertTrue(); @@ -81,6 +80,7 @@ describe('UsbPortJsFunctionsTestEx', function () { expect(error).assertFalse(); console.info('usb SUB_USB_JS_0030: PASS'); }) + CheckEmptyUtils.sleep(8000) console.info('usb SUB_USB_JS_0030: PASS'); expect(true).assertTrue(); @@ -95,7 +95,6 @@ describe('UsbPortJsFunctionsTestEx', function () { var portId = gPort.id; var powerRole = usb.NONE - 1; var dataRole = usb.DEVICE; - CheckEmptyUtils.sleep(2000) usb.setPortRoles(portId, powerRole, dataRole).then(data => { console.info('usb case setPortRoles return: ' + data); expect(data).assertTrue(); @@ -104,7 +103,7 @@ describe('UsbPortJsFunctionsTestEx', function () { expect(error).assertFalse(); console.info('usb SUB_USB_JS_0040: PASS'); }) - + CheckEmptyUtils.sleep(8000) console.info('usb SUB_USB_JS_0040: PASS'); expect(true).assertTrue(); }) @@ -118,7 +117,6 @@ describe('UsbPortJsFunctionsTestEx', function () { var portId = gPort.id - 3; var powerRole = usb.SINK; var dataRole = usb.NONE - 1; - CheckEmptyUtils.sleep(2000) usb.setPortRoles(portId, powerRole, dataRole).then(data => { console.info('usb case setPortRoles return: ' + data); expect(data).assertTrue(); @@ -127,7 +125,7 @@ describe('UsbPortJsFunctionsTestEx', function () { expect(error).assertFalse(); console.info('usb SUB_USB_JS_0050: PASS'); }) - + CheckEmptyUtils.sleep(8000) console.info('usb SUB_USB_JS_0050: PASS'); expect(true).assertTrue(); }) @@ -141,7 +139,6 @@ describe('UsbPortJsFunctionsTestEx', function () { var portId = gPort.id; var powerRole = usb.NONE - 1; var dataRole = usb.NONE - 1; - CheckEmptyUtils.sleep(2000) usb.setPortRoles(portId, powerRole, dataRole).then(data => { console.info('usb case setPortRoles return: ' + data); expect(data).assertTrue(); @@ -150,7 +147,7 @@ describe('UsbPortJsFunctionsTestEx', function () { expect(error).assertFalse(); console.info('usb SUB_USB_JS_0060: PASS'); }) - + CheckEmptyUtils.sleep(8000) console.info('usb SUB_USB_JS_0060: PASS'); expect(true).assertTrue(); }) @@ -164,8 +161,6 @@ describe('UsbPortJsFunctionsTestEx', function () { var portId = gPort.id - 1; var dataRole = usb.NONE - 1; var powerRole = usb.NONE - 1; - - CheckEmptyUtils.sleep(2000) usb.setPortRoles(portId, powerRole, dataRole).then(data => { console.info('usb case setPortRoles return: ' + data); expect(data).assertTrue(); @@ -174,7 +169,7 @@ describe('UsbPortJsFunctionsTestEx', function () { expect(error).assertFalse(); console.info('usb SUB_USB_JS_0070: PASS'); }) - + CheckEmptyUtils.sleep(8000) console.info('usb SUB_USB_JS_0070: PASS'); expect(true).assertTrue(); }) @@ -188,7 +183,6 @@ describe('UsbPortJsFunctionsTestEx', function () { var portId = gPort.id - 1; var powerRole = 1; var dataRole = 1; - CheckEmptyUtils.sleep(2000) usb.setPortRoles(portId, powerRole, dataRole).then(data => { console.info('usb case setPortRoles return: ' + data); expect(data).assertTrue(); @@ -197,7 +191,7 @@ describe('UsbPortJsFunctionsTestEx', function () { expect(error).assertFalse(); console.info('usb SUB_USB_JS_0080: PASS'); }) - + CheckEmptyUtils.sleep(8000) console.info('usb SUB_USB_JS_0080: PASS'); expect(true).assertTrue(); })