提交 147cf203 编写于 作者: G gaoxi

xts适配

Signed-off-by: Ngaoxi <gaoxi785@huawei.com>
上级 37372617
......@@ -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,7 +50,7 @@ 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();
......@@ -73,7 +73,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 +96,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 +119,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 +142,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 +153,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 +167,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}`);
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(null).assertFail();
done();
}
}
console.info(`AccessibleAbilityList: AbilityList_0270 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
......@@ -211,13 +193,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(true).assertTrue();
done();
}else{
console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`);
expect(null).assertFail();
done();
}
}
console.info(`AccessibleAbilityList: AbilityList_0280 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
......@@ -225,7 +210,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 +219,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 +233,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 +242,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 +256,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 +265,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 +279,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 +288,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(true).assertTrue();
done();
}else{
console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`);
expect(null).assertFail();
done();
}
}
console.info(`AccessibleAbilityList: AbilityList_0320 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
......@@ -317,7 +305,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 +314,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(true).assertTrue();
done();
}else{
console.error(`AccessibleAbilityList: AbilityList_0280 has error: ${err.code}`);
expect(null).assertFail();
done();
}
}
console.info(`AccessibleAbilityList: AbilityList_0330 result ${data.length}`);
expect(Array.isArray(data)).assertEqual(true);
done();
});
})
......@@ -447,27 +438,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 +453,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 +475,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 +487,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 +509,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 +531,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 +553,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 +563,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 +575,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 +585,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();
});
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册