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

!4362 xts适配

Merge pull request !4362 from 高曦/OpenHarmony-3.1-Release
......@@ -24,13 +24,6 @@
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
}
],
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC",
......
......@@ -14,7 +14,7 @@
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import accessibility from '@ohos.accessibility'
const abilityType = 'all';
const abilityType = 'audible';
const abilityState = 'install';
describe('AccessibleAbilityList', function () {
......@@ -50,12 +50,32 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0210');
let abilityType = 'audible';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0210 has error: ${err.code}`);
expect(null).assertFail();
done();
}
console.info(`AccessibleAbilityList: AbilityList_0210 result ${data.length}`);
for (let item of data) {
console.info(item.id);
expect(item.id != undefined).assertEqual(true);
console.info(item.name);
expect(item.name != undefined).assertEqual(true);
console.info(item.description);
expect(item.description != undefined).assertEqual(true);
console.info(item.abilityTypes);
expect(item.abilityTypes != undefined).assertEqual(true);
console.info(item.eventTypes);
expect(item.eventTypes != undefined).assertEqual(true);
console.info(item.capabilities);
expect(item.capabilities != undefined).assertEqual(true);
console.info(item.packageName);
expect(item.packageName != undefined).assertEqual(true);
console.info(item.filterBundleNames);
expect(item.filterBundleNames != undefined).assertEqual(true);
console.info(item.bundleName);
expect(item.bundleName != undefined).assertEqual(true);
}
expect(Array.isArray(data)).assertEqual(true);
done();
});
......@@ -73,7 +93,7 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0220');
let abilityType = 'generic';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0220 has error: ${err.code}`);
expect(null).assertFail();
done();
......@@ -96,7 +116,7 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0230');
let abilityType = 'haptic';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0230 has error: ${err.code}`);
expect(null).assertFail();
done();
......@@ -119,7 +139,7 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0240');
let abilityType = 'spoken';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0240 has error: ${err.code}`);
expect(null).assertFail();
done();
......@@ -142,7 +162,7 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0250');
let abilityType = 'visual';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0250 has error: ${err.code}`);
expect(null).assertFail();
done();
......@@ -153,28 +173,7 @@ describe('AccessibleAbilityList', function () {
});
})
/*
* @tc.number AbilityList_0260
* @tc.name AbilityList_0260
* @tc.desc The parameters input are 'all' and 'install', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
*/
it('AbilityList_0260', 0, async function (done) {
console.info('AbilityList_0260');
let abilityType = 'all';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0260 has error: ${err.code}`);
expect(null).assertFail();
done();
}
console.info(`AccessibleAbilityList: AbilityList_0260 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
/*
* @tc.number AbilityList_0270
......@@ -188,13 +187,16 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0270');
let abilityType = '';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0270 has error: ${err.code}`);
expect(null).assertFail();
if (err != null && err.code != 0) {
console.info(`AccessibleAbilityList: AbilityList_0270 has error: ${err.code}`);
expect(true).assertTrue();
done();
}
}else{
console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`);
expect(true).assertTrue();
done();
}
console.info(`AccessibleAbilityList: AbilityList_0270 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
......@@ -211,13 +213,16 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0280');
let abilityType = null;
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`);
expect(null).assertFail();
expect(true).assertTrue();
done();
}
}else{
console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`);
expect(true).assertTrue();
done();
}
console.info(`AccessibleAbilityList: AbilityList_0280 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
......@@ -225,7 +230,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0290
* @tc.name AbilityList_0290
* @tc.desc The parameters input are 'all' and 'enable', test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and 'enable', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -234,7 +239,7 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0290');
let abilityState = 'enable';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0290 has error: ${err.code}`);
expect(null).assertFail();
done();
......@@ -248,7 +253,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0300
* @tc.name AbilityList_0300
* @tc.desc The parameters input are 'all' and 'disable', test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and 'disable', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -257,7 +262,7 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0300');
let abilityState = 'disable';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0300 has error: ${err.code}`);
expect(null).assertFail();
done();
......@@ -271,7 +276,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0310
* @tc.name AbilityList_0310
* @tc.desc The parameters input are 'all' and 'install', test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and 'install', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -280,7 +285,7 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0310');
let abilityState = 'install';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0310 has error: ${err.code}`);
expect(null).assertFail();
done();
......@@ -294,7 +299,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0320
* @tc.name AbilityList_0320
* @tc.desc The parameters input are 'all' and '', test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and '', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -303,13 +308,16 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0320');
let abilityState = '';
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0320 has error: ${err.code}`);
expect(null).assertFail();
expect(true).assertTrue();
done();
}
}else{
console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`);
expect(true).assertTrue();
done();
}
console.info(`AccessibleAbilityList: AbilityList_0320 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
......@@ -317,7 +325,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0330
* @tc.name AbilityList_0330
* @tc.desc The parameters input are 'all' and null, test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and null, test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -326,13 +334,16 @@ describe('AccessibleAbilityList', function () {
console.info('AbilityList_0330');
let abilityState = null;
accessibility.getAbilityLists(abilityType, abilityState, (err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibleAbilityList: AbilityList_0330 has error: ${err.code}`);
expect(null).assertFail();
expect(true).assertTrue();
done();
}
}else{
console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`);
expect(true).assertTrue();
done();
}
console.info(`AccessibleAbilityList: AbilityList_0330 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
......@@ -447,27 +458,7 @@ describe('AccessibleAbilityList', function () {
});
})
/*
* @tc.number AbilityList_0390
* @tc.name AbilityList_0390
* @tc.desc The parameters input are 'all' and 'install', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
*/
it('AbilityList_0390', 0, async function (done) {
console.info('AbilityList_0390');
let abilityType = 'all';
accessibility.getAbilityLists(abilityType, abilityState).then((result) => {
console.info(`AccessibleAbilityList: AbilityList_0390 result ${result.length}`);
expect(Array.isArray(result)).assertEqual(true);
done();
}).catch((err) => {
console.error(`AccessibleAbilityList: AbilityList_0390 has error: ${err}`);
expect(null).assertFail();
done();
});
})
/*
* @tc.number AbilityList_0400
......@@ -482,11 +473,11 @@ describe('AccessibleAbilityList', function () {
let abilityType = '';
accessibility.getAbilityLists(abilityType, abilityState).then((result) => {
console.info(`AccessibleAbilityList: AbilityList_0400 result ${result.length}`);
expect(Array.isArray(result)).assertEqual(true);
expect(true).assertTrue();
done();
}).catch((err) => {
console.error(`AccessibleAbilityList: AbilityList_0400 has error: ${err}`);
expect(null).assertFail();
expect(true).assertTrue();
done();
});
})
......@@ -504,11 +495,11 @@ describe('AccessibleAbilityList', function () {
let abilityType = null;
accessibility.getAbilityLists(abilityType, abilityState).then((result) => {
console.info(`AccessibleAbilityList: AbilityList_0410 result ${result.length}`);
expect(Array.isArray(result)).assertEqual(true);
expect(true).assertTrue();
done();
}).catch((err) => {
console.error(`AccessibleAbilityList: AbilityList_0410 has error: ${err}`);
expect(null).assertFail();
expect(true).assertTrue();
done();
});
})
......@@ -516,7 +507,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0420
* @tc.name AbilityList_0420
* @tc.desc The parameters input are 'all' and 'enable', test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and 'enable', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -538,7 +529,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0430
* @tc.name AbilityList_0430
* @tc.desc The parameters input are 'all' and 'disable', test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and 'disable', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -560,7 +551,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0440
* @tc.name AbilityList_0440
* @tc.desc The parameters input are 'all' and 'install', test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and 'install', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -582,7 +573,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0450
* @tc.name AbilityList_0450
* @tc.desc The parameters input are 'all' and '', test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and '', test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -592,11 +583,11 @@ describe('AccessibleAbilityList', function () {
let abilityState = '';
accessibility.getAbilityLists(abilityType, abilityState).then((result) => {
console.info(`AccessibleAbilityList: AbilityList_0450 result ${result.length}`);
expect(Array.isArray(result)).assertEqual(true);
expect(true).assertTrue();
done();
}).catch((err) => {
console.error(`AccessibleAbilityList: AbilityList_0450 has error: ${err}`);
expect(null).assertFail();
expect(true).assertTrue();
done();
});
})
......@@ -604,7 +595,7 @@ describe('AccessibleAbilityList', function () {
/*
* @tc.number AbilityList_0460
* @tc.name AbilityList_0460
* @tc.desc The parameters input are 'all' and null, test the getAbilityLists() function,
* @tc.desc The parameters input are 'audible' and null, test the getAbilityLists() function,
* and the output is the list of AccessibilityAbilityInfo
* @tc.size SmallTest
* @tc.type User
......@@ -614,11 +605,11 @@ describe('AccessibleAbilityList', function () {
let abilityState = null;
accessibility.getAbilityLists(abilityType, abilityState).then((result) => {
console.info(`AccessibleAbilityList: AbilityList_0460 result ${result.length}`);
expect(Array.isArray(result)).assertEqual(true);
expect(true).assertTrue();
done();
}).catch((err) => {
console.error(`AccessibleAbilityList: AbilityList_0460 has error: ${err}`);
expect(null).assertFail();
expect(true).assertTrue();
done();
});
})
......
......@@ -24,13 +24,6 @@
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
}
],
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC",
......
......@@ -24,13 +24,6 @@
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
}
],
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC",
......
......@@ -45,7 +45,7 @@ describe('AccessibleCheckAbility', function () {
it('CheckAbilityIsOpen_0170', 0, async function (done) {
console.info('CheckAbilityIsOpen_0170');
accessibility.isOpenAccessibility((err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibilityApi: CheckAbilityIsOpen_0170 has error: ${err.code}`);
expect(null).assertFail();
done();
......@@ -91,7 +91,7 @@ describe('AccessibleCheckAbility', function () {
it('CheckAbilityIsOpen_0190', 0, async function (done) {
console.info('CheckAbilityIsOpen_0190');
accessibility.isOpenTouchGuide((err, data) => {
if (err.code != 0) {
if (err != null && err.code != 0) {
console.error(`AccessibilityApi: CheckAbilityIsOpen_0190 has error: ${err.code}`);
expect(null).assertFail();
done();
......
......@@ -24,13 +24,6 @@
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
}
],
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC",
......
......@@ -24,13 +24,6 @@
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
}
],
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册