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

!2950 新增xts用例

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