From c6e434640d64299cf642325018347cff084ef741 Mon Sep 17 00:00:00 2001 From: wangdi119 Date: Fri, 28 Jan 2022 18:11:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E6=A8=A1=20xts=20js=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8F=90=E4=BA=A4=E5=90=88=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangdi119 --- .../main/js/default/test/InputDevice.test.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/multimodalinput/input_js_standard/src/main/js/default/test/InputDevice.test.js b/multimodalinput/input_js_standard/src/main/js/default/test/InputDevice.test.js index a8fcb99a1..d7a5d93e7 100644 --- a/multimodalinput/input_js_standard/src/main/js/default/test/InputDevice.test.js +++ b/multimodalinput/input_js_standard/src/main/js/default/test/InputDevice.test.js @@ -51,4 +51,39 @@ describe('MultimodalInput_test', function () { console.log(`inputDevice::getDeviceIds_test-02 exit`); }) }) + + it("inputDevice::getDevice_test-01", 0, function () { + console.log(`inputDevice::getDevice_test-03 enter`); + inputDevice.getDevice(-1, (data, err) => { + if (err) { + expect(false).assertTrue(); + console.log(`inputDevice::getDevice_test-03 ${JSON.stringify(err)}`); + } else { + expect(JSON.stringify(data) !== "{}").assertTrue(); + } + console.log(`inputDevice::getDevice_test-03 exit`); + }) + }) + + // 参数正常,返回值正常 + it("inputDevice::getDevice_test-02", 0, function () { + console.log(`inputDevice::getDevice_test-04 enter`); + inputDevice.getDeviceIds((data, err) => { + if (err) { + expect(false).assertTrue(); + } else { + let arr = []; + for (var i = 0; i < data.length; i++) { + inputDevice.getDevice(data[i], (res, err) => { + console.log(`getDevice:data_i ${JSON.stringify(data[i])}`) + console.log(`getDevice:data ${JSON.stringify(data)}`) + console.log(`getDevice:err ${JSON.stringify(err)}`) + arr = Object.keys(res); + }) + expect(arr.length > 0).assertTrue(); + } + } + console.log(`inputDevice::getDevice_test-04 exit`); + }); + }) }) \ No newline at end of file -- GitLab