提交 394f556b 编写于 作者: Mupceet's avatar Mupceet

无障碍权限功能测试

Signed-off-by: Mupceet's avatarMupceet <mupceet@gmail.com>
上级 df0793d2
......@@ -61,7 +61,7 @@ struct Index {
.margin(5)
.onClick((e) => {
accessibility.getAbilityLists('all', 'enable', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.error(LOG_PREFIX + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......
......@@ -52,7 +52,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('spoken', 'install', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -98,7 +98,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('audible', 'install', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -144,7 +144,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('visual', 'install', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -190,7 +190,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('haptic', 'install', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -236,7 +236,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('generic', 'install', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -282,7 +282,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('all', 'enable', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -306,7 +306,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('all', 'enable', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -333,7 +333,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('all', 'enable', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -360,7 +360,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('all', 'enable', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.error(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -514,7 +514,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('all', 'disable', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......@@ -560,7 +560,7 @@ export default function abilityTest() {
disableAbility(logTag, [AUDIBLE_BUNDLE_NAME])
setTimeout(() => {
accessibility.getAbilityLists('all', 'disable', (err, data) => {
if (err.code != 0) {
if (err && err.code != 0) {
console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err))
return
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册