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

!2950 新增xts用例

Merge pull request !2950 from zhxiaop/master
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
onInit() { onInit() {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow() { onActive() {
console.info('onShow finish') console.info('onShow finish')
const core = Core.getInstance() const core = Core.getInstance()
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
......
...@@ -53,21 +53,21 @@ describe('MultimodalInput_test', function () { ...@@ -53,21 +53,21 @@ describe('MultimodalInput_test', function () {
}) })
it("inputDevice::getDevice_test-01", 0, function () { it("inputDevice::getDevice_test-01", 0, function () {
console.log(`inputDevice::getDevice_test-03 enter`); console.log(`inputDevice::getDevice_test-01 enter`);
inputDevice.getDevice(-1, (data, err) => { inputDevice.getDevice(-1, (data, err) => {
if (err) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
console.log(`inputDevice::getDevice_test-03 ${JSON.stringify(err)}`); console.log(`inputDevice::getDevice_test-01 ${JSON.stringify(err)}`);
} else { } else {
expect(JSON.stringify(data) !== "{}").assertTrue(); expect(JSON.stringify(data) !== "{}").assertTrue();
} }
console.log(`inputDevice::getDevice_test-03 exit`); console.log(`inputDevice::getDevice_test-01 exit`);
}) })
}) })
// 参数正常,返回值正常 // 参数正常,返回值正常
it("inputDevice::getDevice_test-02", 0, function () { it("inputDevice::getDevice_test-02", 0, function () {
console.log(`inputDevice::getDevice_test-04 enter`); console.log(`inputDevice::getDevice_test-02 enter`);
inputDevice.getDeviceIds((data, err) => { inputDevice.getDeviceIds((data, err) => {
if (err) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -75,20 +75,18 @@ describe('MultimodalInput_test', function () { ...@@ -75,20 +75,18 @@ describe('MultimodalInput_test', function () {
let arr = []; let arr = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
inputDevice.getDevice(data[i], (res, err) => { 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:data ${JSON.stringify(data)}`)
console.log(`getDevice:err ${JSON.stringify(err)}`)
arr = Object.keys(res); arr = Object.keys(res);
}) })
expect(arr.length > 0).assertTrue(); expect(arr.length > 0).assertTrue();
} }
} }
console.log(`inputDevice::getDevice_test-04 exit`); console.log(`inputDevice::getDevice_test-02 exit`);
}); });
}) })
it("inputDevice::getDevice_test03", 0, function () { it("inputDevice::getDevice_test-03", 0, function () {
console.log(`inputDevice::getDevice_test-04 enter`); console.log(`inputDevice::getDevice_test-03 enter`);
inputDevice.getDeviceIds((data, err) => { inputDevice.getDeviceIds((data, err) => {
if (err) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -96,9 +94,7 @@ describe('MultimodalInput_test', function () { ...@@ -96,9 +94,7 @@ describe('MultimodalInput_test', function () {
let arr = []; let arr = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
inputDevice.getDevice(data[i], (res, err) => { 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:data ${JSON.stringify(data)}`)
console.log(`getDevice:err ${JSON.stringify(err)}`)
arr = Object.keys(res); arr = Object.keys(res);
expect(data[i].id).assertInstanceOf('number'); expect(data[i].id).assertInstanceOf('number');
expect(data[i].sources).assertInstanceOf('string'); expect(data[i].sources).assertInstanceOf('string');
...@@ -108,7 +104,7 @@ describe('MultimodalInput_test', function () { ...@@ -108,7 +104,7 @@ describe('MultimodalInput_test', function () {
expect(arr.length > 0).assertTrue(); expect(arr.length > 0).assertTrue();
} }
} }
console.log(`inputDevice::getDevice_test-04 exit`); console.log(`inputDevice::getDevice_test-03 exit`);
}); });
}) })
}) })
...@@ -15,3 +15,4 @@ ...@@ -15,3 +15,4 @@
require('./InputDevice.test.js') require('./InputDevice.test.js')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册