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

!5476 修改无障碍XTS功能测试用例

Merge pull request !5476 from Mupceet/release_0915_xts_master
...@@ -38,7 +38,6 @@ export default function abilityTest() { ...@@ -38,7 +38,6 @@ export default function abilityTest() {
prompt.showToast({ prompt.showToast({
message: 'CASE All End' message: 'CASE All End'
}) })
disableAll(LOG_PREFIX + ' disableAll ')
done() done()
}) })
/** /**
......
...@@ -20,22 +20,18 @@ import config from '@ohos.accessibility.config' ...@@ -20,22 +20,18 @@ import config from '@ohos.accessibility.config'
export { }; export { };
const LOG: string = "[xtsLog]"; const LOG: string = "[xtsLog]";
const CaptionConfiguration_0010 = () => { const CaptionConfiguration_0270 = () => {
const caseName = "CaptionConfiguration_0010" const caseName = "CaptionConfiguration_0270"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captions.get().then((res) => {
if (!captionsManager) { console.info(logTag + "Config before modification. enabled=" + res);
console.info(logTag + "captionsManager is undefined"); config.captions.set(!res).then(() => {
return; console.info(logTag + "Config after modification. enabled=" + !res);
} commonEventPublishOnTargetChangeExtra(caseName);
let before = captionsManager.enabled; }).catch((err) => {
console.info(logTag + "captionsManager before modification. enabled=" + before); console.info(logTag + "caption set err=" + JSON.stringify(err));
captionsManager.enabled = !captionsManager.enabled; });
let after = captionsManager.enabled; });
console.info(logTag + "captionsManager after modification. enabled=" + after);
if (before != after) {
commonEventPublishOnTargetChangeExtra(caseName);
}
} }
const printCaptionsManagerStyle = (logTag, captionsManager) => { const printCaptionsManagerStyle = (logTag, captionsManager) => {
...@@ -75,209 +71,237 @@ const foreachList = (currValue, array) => { ...@@ -75,209 +71,237 @@ const foreachList = (currValue, array) => {
return result; return result;
} }
const CaptionConfiguration_0020 = () => { const CaptionConfiguration_0280 = () => {
const caseName = "CaptionConfiguration_0020" const caseName = "CaptionConfiguration_0280"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.fontFamily = foreachList(captionsManager.style.fontFamily, ['default', 'monospacedSerif', 'serif', printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif',
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']);
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0030 = () => { const CaptionConfiguration_0290 = () => {
const caseName = "CaptionConfiguration_0030" const caseName = "CaptionConfiguration_0290"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captions.get().then((res) => {
if (!captionsManager) { console.info(logTag + "Config before modification. enabled=" + res);
console.info(logTag + "captionsManager is undefined"); config.captions.set(!res).then(() => {
return; console.info(logTag + "Config after modification. enabled=" + !res);
} commonEventPublishOnTargetChangeExtra(caseName);
let before = (captionsManager.enabled); }).catch((err) => {
console.info(logTag + "captionsManager before modification. enabled=" + before); console.info(logTag + "caption set err=" + JSON.stringify(err));
captionsManager.enabled = !captionsManager.enabled; });
let after = captionsManager.enabled; });
console.info(logTag + "captionsManager after modification. enabled=" + after);
if (before != after) {
commonEventPublishOnTargetChangeExtra(caseName);
}
} }
const CaptionConfiguration_0040 = () => { const CaptionConfiguration_0300 = () => {
const caseName = "CaptionConfiguration_0040" const caseName = "CaptionConfiguration_0300"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.fontFamily = foreachList(captionsManager.style.fontFamily, ['default', 'monospacedSerif', 'serif', printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif',
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']);
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0050 = () => { const CaptionConfiguration_0310 = () => {
const caseName = "CaptionConfiguration_0050" const caseName = "CaptionConfiguration_0310"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.fontFamily = foreachList(captionsManager.style.fontFamily, ['default', 'monospacedSerif', 'serif', printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif',
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']);
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0060 = () => { const CaptionConfiguration_0320 = () => {
const caseName = "CaptionConfiguration_0060" const caseName = "CaptionConfiguration_0320"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.fontScale = (captionsManager.style.fontScale ?? 0) + 1; printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); captionsStyle.fontScale = (res.fontScale ?? 0) + 1;
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0070 = () => { const CaptionConfiguration_0330 = () => {
const caseName = "CaptionConfiguration_0070" const caseName = "CaptionConfiguration_0330"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.fontColor = foreachList(captionsManager.style.fontColor, ['red', 'yellow', 'blue', '#ff0000ff', '##ff000000', 'black', 'white']); printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); captionsStyle.fontColor = foreachList(res.fontColor, ['red', 'yellow', 'blue', '#FFFFFF', '#000000', 'black', 'white']);
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0080 = () => { const CaptionConfiguration_0340 = () => {
const caseName = "CaptionConfiguration_0080" const caseName = "CaptionConfiguration_0340"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.fontEdgeType = foreachList(captionsManager.style.fontEdgeType, ['none', 'raised', 'depressed', 'uniform', 'dropShadow']); printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); captionsStyle.fontEdgeType = foreachList(res.fontEdgeType, ['none', 'raised', 'depressed', 'uniform', 'dropShadow']);
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0090 = () => { const CaptionConfiguration_0090 = () => {
const caseName = "CaptionConfiguration_0090" const caseName = "CaptionConfiguration_0090"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.backgroundColor = foreachList(captionsManager.style.backgroundColor, ['red', 'yellow', 'blue', '#ff0000ff', '##ff000000', 'black', 'white']); printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); captionsStyle.backgroundColor = foreachList(res.backgroundColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']);
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0100 = () => { const CaptionConfiguration_0100 = () => {
const caseName = "CaptionConfiguration_0100" const caseName = "CaptionConfiguration_0100"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.windowColor = foreachList(captionsManager.style.windowColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', 'black', 'white']); printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); captionsStyle.windowColor = foreachList(res.windowColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']);
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0110 = () => { const CaptionConfiguration_0110 = () => {
const caseName = "CaptionConfiguration_0110" const caseName = "CaptionConfiguration_0110"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
}
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager);
for (let index = 0; index < 3; index++) {
printCaptionsManagerStyle(logTag + "captionsManager before modification. times=" + index + ". style=", captionsManager);
captionsManager.style.windowColor = foreachList(captionsManager.style.windowColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']);
printCaptionsManagerStyle(logTag + "captionsManager after modification. times=" + index + ". style=", captionsManager);
}
setTimeout(() => {
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager);
if (before != after) {
commonEventPublishOnTargetChangeExtra(caseName);
} }
}, 2000) var captionsStyle = res;
for (let index = 0; index < 3; index++) {
printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
captionsStyle.windowColor = foreachList(res.windowColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']);
printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
config.captionsStyle.set(captionsStyle).then(() => {
commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
}
})
}; };
const CaptionConfiguration_0120 = () => { const CaptionConfiguration_0120 = () => {
const caseName = "CaptionConfiguration_0120" const caseName = "CaptionConfiguration_0120"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captions.get().then((res) => {
if (!captionsManager) { console.info(logTag + "Config before modification. enabled=" + res);
console.info(logTag + "captionsManager is undefined"); config.captions.set(!res).then(() => {
return; console.info(logTag + "Config after modification. enabled=" + !res);
} commonEventPublishOnTargetChangeExtra(caseName);
const before = console.info(logTag + "captionsManager before modification. enabled=" + captionsManager.enabled); }).catch((err) => {
captionsManager.enabled = undefined; console.info(logTag + "caption set err=" + JSON.stringify(err));
const after = console.info(logTag + "captionsManager after modification. enabled=" + captionsManager.enabled); });
if (before != after) { });
commonEventPublishOnTargetChangeExtra(caseName);
}
}; };
const CaptionConfiguration_0130 = () => { const CaptionConfiguration_0130 = () => {
const caseName = "CaptionConfiguration_0130" const caseName = "CaptionConfiguration_0130"
const logTag = LOG + caseName; const logTag = LOG + caseName;
let captionsManager = accessibility.getCaptionsManager(); config.captionsStyle.get().then((res) => {
if (!captionsManager) { if (!res) {
console.info(logTag + "captionsManager is undefined"); console.info(logTag + "captionsStyle is undefined");
return; return;
} }
const before = printCaptionsManagerStyle(logTag + "captionsManager before modification. style=", captionsManager); var captionsStyle = res;
captionsManager.style.fontEdgeType = undefined; printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res));
const after = printCaptionsManagerStyle(logTag + "captionsManager after modification. style=", captionsManager); captionsStyle.fontEdgeType = undefined;
if (before != after) { printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle));
commonEventPublishOnTargetChangeExtra(caseName); config.captionsStyle.set(captionsStyle).then(() => {
} commonEventPublishOnTargetChangeExtra(caseName);
}).catch((err) => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
});
})
}; };
const CaptionConfiguration_0140 = () => { const CaptionConfiguration_0140 = () => {
...@@ -490,8 +514,6 @@ const CaptionConfiguration_0240 = () => { ...@@ -490,8 +514,6 @@ const CaptionConfiguration_0240 = () => {
console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err));
}); });
} }
}) })
}; };
...@@ -527,29 +549,29 @@ const commonEventPublishOnTargetChangeExtra = (caseName) => { ...@@ -527,29 +549,29 @@ const commonEventPublishOnTargetChangeExtra = (caseName) => {
const excuteAbility = (data) => { const excuteAbility = (data) => {
switch (data) { switch (data) {
case "CaptionConfiguration_0010" + "_AccessibilityApp_start": case "CaptionConfiguration_0270" + "_AccessibilityApp_start":
CaptionConfiguration_0010() CaptionConfiguration_0270()
break; break;
case "CaptionConfiguration_0020" + "_AccessibilityApp_start": case "CaptionConfiguration_0280" + "_AccessibilityApp_start":
CaptionConfiguration_0020() CaptionConfiguration_0280()
break; break;
case "CaptionConfiguration_0030" + "_AccessibilityApp_start": case "CaptionConfiguration_0290" + "_AccessibilityApp_start":
CaptionConfiguration_0030() CaptionConfiguration_0290()
break; break;
case "CaptionConfiguration_0040" + "_AccessibilityApp_start": case "CaptionConfiguration_0300" + "_AccessibilityApp_start":
CaptionConfiguration_0040() CaptionConfiguration_0300()
break; break;
case "CaptionConfiguration_0050" + "_AccessibilityApp_start": case "CaptionConfiguration_0310" + "_AccessibilityApp_start":
CaptionConfiguration_0050() CaptionConfiguration_0310()
break; break;
case "CaptionConfiguration_0060" + "_AccessibilityApp_start": case "CaptionConfiguration_0320" + "_AccessibilityApp_start":
CaptionConfiguration_0060() CaptionConfiguration_0320()
break; break;
case "CaptionConfiguration_0070" + "_AccessibilityApp_start": case "CaptionConfiguration_0330" + "_AccessibilityApp_start":
CaptionConfiguration_0070() CaptionConfiguration_0330()
break; break;
case "CaptionConfiguration_0080" + "_AccessibilityApp_start": case "CaptionConfiguration_0340" + "_AccessibilityApp_start":
CaptionConfiguration_0080() CaptionConfiguration_0340()
break; break;
case "CaptionConfiguration_0090" + "_AccessibilityApp_start": case "CaptionConfiguration_0090" + "_AccessibilityApp_start":
CaptionConfiguration_0090() CaptionConfiguration_0090()
...@@ -590,12 +612,6 @@ const excuteAbility = (data) => { ...@@ -590,12 +612,6 @@ const excuteAbility = (data) => {
case "CaptionConfiguration_0210" + "_AccessibilityApp_start": case "CaptionConfiguration_0210" + "_AccessibilityApp_start":
CaptionConfiguration_0210() CaptionConfiguration_0210()
break; break;
case "CaptionConfiguration_0210" + "_AccessibilityApp_start":
CaptionConfiguration_0210()
break;
case "CaptionConfiguration_0220" + "_AccessibilityApp_start":
CaptionConfiguration_0220()
break;
case "CaptionConfiguration_0220" + "_AccessibilityApp_start": case "CaptionConfiguration_0220" + "_AccessibilityApp_start":
CaptionConfiguration_0220() CaptionConfiguration_0220()
break; break;
......
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import commonEvent from '@ohos.commonEvent'
import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'
const logTag = "[xtsLog]"
class ServiceExtAbility extends AccessibilityExtensionAbility {
onConnect() {
const context = this.context;
console.info(logTag + "AccessibilityAll onAbilityConnected");
var commonEventSubscribeInfo = {
events: ["on_assist_change", "execute_accessibility_event"]
}
function subscriberCallback(err, data) {
console.info(logTag + "AccessibilityALLD subscriberCallback start");
console.info(logTag + "AccessibilityALLD receive event err:" + JSON.stringify(err));
console.info(logTag + "AccessibilityALLD receive event data:" + JSON.stringify(data));
console.info(logTag + "AccessibilityALLD subscriberCallback end");
}
var subscriber
commonEvent.createSubscriber(commonEventSubscribeInfo).then(function (data) {
console.info(logTag + " AccessibilityALLD createSubscriber Start====")
subscriber = data;
commonEvent.subscribe(subscriber, subscriberCallback);
console.info(logTag + " AccessibilityALLD createSubscriber End====")
})
console.info(logTag + " AccessibilityALLD onShow End====")
}
onAccessibilityEvent(accessibilityEvent) {
printAccessibilityEvent(accessibilityEvent);
return true;
}
onKeyEvent(keyEvent) {
console.info(" onKeyEvent");
console.info(logTag + "onKeyEvent KeyInterception AccessibilityAllD: " + JSON.stringify(keyEvent));
return true;
}
}
const printAccessibilityEvent = (accessibilityEvent) => {
console.info(logTag + "AccessibilityAllD onAccessibilityEvent Start");
console.info(logTag + "AccessibilityAllD onAccessibilityEvent accessibilityEvent=" + JSON.stringify(accessibilityEvent));
console.info(logTag + "AccessibilityAllD onAccessibilityEvent End");
}
export default ServiceExtAbility
...@@ -18,6 +18,14 @@ import accessibility from '@ohos.accessibility'; ...@@ -18,6 +18,14 @@ import accessibility from '@ohos.accessibility';
import config from '@ohos.accessibility.config'; import config from '@ohos.accessibility.config';
const LOG = "[xtsLog]" const LOG = "[xtsLog]"
const START_TIMEOUT = 5000; const START_TIMEOUT = 5000;
var backList = []
let subScriber = undefined;
let registerOn = false;
const callbackData = (data) => {
console.info(LOG + " captionsManager on res = " + JSON.stringify(data))
registerOn = true
}
const CaptionConfigurationOn = (logTag, captionType) => { const CaptionConfigurationOn = (logTag, captionType) => {
let captionsManager = accessibility.getCaptionsManager(); let captionsManager = accessibility.getCaptionsManager();
...@@ -25,11 +33,7 @@ const CaptionConfigurationOn = (logTag, captionType) => { ...@@ -25,11 +33,7 @@ const CaptionConfigurationOn = (logTag, captionType) => {
console.info(logTag + " captionsManager is undefined"); console.info(logTag + " captionsManager is undefined");
return; return;
} }
captionsManager.on(captionType, (res) => { captionsManager.on(captionType, callbackData);
console.info(logTag + " captionsManager on " + captionType + " res: " + JSON.stringify(res));
onbackList.push(logTag + "_on_success")
console.info(logTag + "_on_success");
});
} }
const CaptionConfigurationOff = (logTag, captionType) => { const CaptionConfigurationOff = (logTag, captionType) => {
...@@ -38,37 +42,32 @@ const CaptionConfigurationOff = (logTag, captionType) => { ...@@ -38,37 +42,32 @@ const CaptionConfigurationOff = (logTag, captionType) => {
console.info(logTag + " captionsManager is undefined"); console.info(logTag + " captionsManager is undefined");
return; return;
} }
captionsManager.off(captionType, (res) => { captionsManager.off(captionType, callbackData);
console.info(logTag + " captionsManager off " + captionType + " res: " + JSON.stringify(res)); }
});
const CaptionConfigurationOffAll = (logTag, captionType) => {
let captionsManager = accessibility.getCaptionsManager();
if (!captionsManager) {
console.info(logTag + " captionsManager is undefined");
return;
}
captionsManager.off(captionType);
} }
const captionOn = (logTag, caseName) => { const captionOn = (logTag, caseName) => {
config.captions.on((res) => { config.captions.on(callbackData);
console.info(logTag + " captionOn res = " + JSON.stringify(res));
console.info(logTag + "_on_success");
onbackList.push(caseName + "_on_success")
});
} }
const captionOff = (logTag, captionType) => { const captionOff = (logTag, captionType) => {
config.captions.off((res) => { config.captions.off(callbackData);
console.info(logTag + " caption off " + captionType + " res: " + JSON.stringify(res));
});
} }
const captionStyleOn = (logTag, caseName) => { const captionStyleOn = (logTag, caseName) => {
config.captionsStyle.on((res) => { config.captionsStyle.on(callbackData);
console.info(logTag + " captionsStyle On res = " + JSON.stringify(res));
console.info(logTag + "_on_success");
onbackList.push(caseName + "_on_success")
});
} }
const captionStyleOff = (logTag, captionType) => { const captionStyleOff = (logTag, captionType) => {
config.captionsStyle.off((res) => { config.captionsStyle.off(callbackData);
console.info(logTag + " captionsStyle off " + captionType + " res: " + JSON.stringify(res));
});
} }
const excuteCase = (caseNamePara) => { const excuteCase = (caseNamePara) => {
...@@ -83,16 +82,15 @@ const excuteCase = (caseNamePara) => { ...@@ -83,16 +82,15 @@ const excuteCase = (caseNamePara) => {
} }
commonEvent.publish("on_target_change", commonEventPublishData, publishCallback); commonEvent.publish("on_target_change", commonEventPublishData, publishCallback);
} }
var backList = []
let subScriber = undefined;
var onbackList = []
export default function CaptionConfigurationTest() { export default function CaptionConfigurationTest() {
describe('ActsCaptionConfigurationTest', function () { describe('ActsCaptionConfigurationTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info(LOG + 'ActsCaptionConfigurationTest: beforeEach'); console.info(LOG + 'ActsCaptionConfigurationTest: beforeEach');
setTimeout(() => { setTimeout(() => {
backList = []
done(); done();
}, 3000); }, 1000);
}); });
beforeAll(async function (done) { beforeAll(async function (done) {
console.info(LOG + 'ActsCaptionConfigurationTest: beforeAll'); console.info(LOG + 'ActsCaptionConfigurationTest: beforeAll');
...@@ -124,13 +122,14 @@ export default function CaptionConfigurationTest() { ...@@ -124,13 +122,14 @@ export default function CaptionConfigurationTest() {
}); });
/** /**
* @tc.number: CaptionConfiguration_0010 * @tc.number: CaptionConfiguration_0270
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0010', 1, async function (done) { it('CaptionConfiguration_0270', 1, async function (done) {
const caseName = "CaptionConfiguration_0010"; const caseName = "CaptionConfiguration_0270";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOn(caseName, 'enableChange') CaptionConfigurationOn(caseName, 'enableChange')
}, 1000); }, 1000);
...@@ -139,117 +138,110 @@ export default function CaptionConfigurationTest() { ...@@ -139,117 +138,110 @@ export default function CaptionConfigurationTest() {
}, 3000); }, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') !== -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(true);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true); CaptionConfigurationOff(caseName, 'enableChange')
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
/** /**
* @tc.number: CaptionConfiguration_0020 * @tc.number: CaptionConfiguration_0280
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0020', 1, async function (done) { it('CaptionConfiguration_0280', 1, async function (done) {
const caseName = "CaptionConfiguration_0020"; const caseName = "CaptionConfiguration_0280";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
CaptionConfigurationOn(caseName, 'styleChange') CaptionConfigurationOn(caseName, 'styleChange')
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
}, 3000); }, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') !== -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(true);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true); CaptionConfigurationOffAll(caseName, 'styleChange')
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
/** /**
* @tc.number: CaptionConfiguration_0030 * @tc.number: CaptionConfiguration_0290
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0030', 1, async function (done) { it('CaptionConfiguration_0290', 1, async function (done) {
const caseName = "CaptionConfiguration_0030"; const caseName = "CaptionConfiguration_0290";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOn(caseName, 'enableChange'); CaptionConfigurationOn(caseName, 'enableChange');
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOff(caseName, 'enableChange') CaptionConfigurationOff(caseName, 'enableChange')
setTimeout(() => {
excuteCase(caseName);
}, 3000);
}, 2000); }, 2000);
setTimeout(() => {
excuteCase(caseName);
}, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
/** /**
* @tc.number: CaptionConfiguration_0040 * @tc.number: CaptionConfiguration_0300
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0040', 1, async function (done) { it('CaptionConfiguration_0300', 1, async function (done) {
const caseName = "CaptionConfiguration_0040"; const caseName = "CaptionConfiguration_0300";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOn(caseName, 'styleChange'); CaptionConfigurationOn(caseName, 'styleChange');
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOff(caseName, 'styleChange') CaptionConfigurationOff(caseName, 'styleChange')
setTimeout(() => {
excuteCase(caseName);
}, 3000);
}, 2000); }, 2000);
setTimeout(() => {
excuteCase(caseName);
}, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
/** /**
* @tc.number: CaptionConfiguration_0050 * @tc.number: CaptionConfiguration_0310
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0050', 1, async function (done) { it('CaptionConfiguration_0310', 1, async function (done) {
const caseName = "CaptionConfiguration_0050"; const caseName = "CaptionConfiguration_0310";
const logF = LOG + caseName; const logF = LOG + caseName;
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
...@@ -266,12 +258,12 @@ export default function CaptionConfigurationTest() { ...@@ -266,12 +258,12 @@ export default function CaptionConfigurationTest() {
}); });
/** /**
* @tc.number: CaptionConfiguration_0060 * @tc.number: CaptionConfiguration_0320
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0060', 1, async function (done) { it('CaptionConfiguration_0320', 1, async function (done) {
const caseName = "CaptionConfiguration_0060"; const caseName = "CaptionConfiguration_0320";
const logF = LOG + caseName; const logF = LOG + caseName;
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
...@@ -288,12 +280,12 @@ export default function CaptionConfigurationTest() { ...@@ -288,12 +280,12 @@ export default function CaptionConfigurationTest() {
}); });
/** /**
* @tc.number: CaptionConfiguration_0070 * @tc.number: CaptionConfiguration_0330
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0070', 1, async function (done) { it('CaptionConfiguration_0330', 1, async function (done) {
const caseName = "CaptionConfiguration_0070"; const caseName = "CaptionConfiguration_0330";
const logF = LOG + caseName; const logF = LOG + caseName;
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
...@@ -310,12 +302,12 @@ export default function CaptionConfigurationTest() { ...@@ -310,12 +302,12 @@ export default function CaptionConfigurationTest() {
}); });
/** /**
* @tc.number: CaptionConfiguration_0080 * @tc.number: CaptionConfiguration_0340
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0080', 1, async function (done) { it('CaptionConfiguration_0340', 1, async function (done) {
const caseName = "CaptionConfiguration_0080"; const caseName = "CaptionConfiguration_0340";
const logF = LOG + caseName; const logF = LOG + caseName;
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
...@@ -405,6 +397,7 @@ export default function CaptionConfigurationTest() { ...@@ -405,6 +397,7 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0120', 1, async function (done) { it('CaptionConfiguration_0120', 1, async function (done) {
const caseName = "CaptionConfiguration_0120"; const caseName = "CaptionConfiguration_0120";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOn(caseName, undefined); CaptionConfigurationOn(caseName, undefined);
}, 1000); }, 1000);
...@@ -413,15 +406,12 @@ export default function CaptionConfigurationTest() { ...@@ -413,15 +406,12 @@ export default function CaptionConfigurationTest() {
}, 2000); }, 2000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false; if (backList.indexOf(caseName + '_on_target_change_extra_success') != -1) {
if (backList.indexOf(caseName + '_on_target_change_extra_success') == -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -456,23 +446,22 @@ export default function CaptionConfigurationTest() { ...@@ -456,23 +446,22 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0140', 1, async function (done) { it('CaptionConfiguration_0140', 1, async function (done) {
const caseName = "CaptionConfiguration_0140"; const caseName = "CaptionConfiguration_0140";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
captionOn(logF, caseName) captionOn(logF, caseName);
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
}, 3000); }, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') !== -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(true);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true); captionOff(logF, caseName);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -485,21 +474,20 @@ export default function CaptionConfigurationTest() { ...@@ -485,21 +474,20 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0150', 1, async function (done) { it('CaptionConfiguration_0150', 1, async function (done) {
const caseName = "CaptionConfiguration_0150"; const caseName = "CaptionConfiguration_0150";
const logF = LOG + caseName; const logF = LOG + caseName;
captionStyleOn(logF, caseName) registerOn = false;
captionStyleOn(logF, caseName);
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
}, 3000); }, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') !== -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(true);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true); config.captionsStyle.off();
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -512,26 +500,24 @@ export default function CaptionConfigurationTest() { ...@@ -512,26 +500,24 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0160', 1, async function (done) { it('CaptionConfiguration_0160', 1, async function (done) {
const caseName = "CaptionConfiguration_0160"; const caseName = "CaptionConfiguration_0160";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
captionOn(logF, caseName) captionOn(logF, caseName)
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
captionOff(logF, caseName) captionOff(logF, caseName)
setTimeout(() => {
excuteCase(caseName);
}, 3000);
}, 2000); }, 2000);
setTimeout(() => {
excuteCase(caseName);
}, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -544,26 +530,25 @@ export default function CaptionConfigurationTest() { ...@@ -544,26 +530,25 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0170', 1, async function (done) { it('CaptionConfiguration_0170', 1, async function (done) {
const caseName = "CaptionConfiguration_0170"; const caseName = "CaptionConfiguration_0170";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
captionStyleOn(logF, caseName); captionStyleOn(logF, caseName);
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
captionStyleOff(logF, caseName) captionStyleOff(logF, caseName)
setTimeout(() => {
excuteCase(caseName);
}, 3000);
}, 2000); }, 2000);
setTimeout(() => {
excuteCase(caseName);
}, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -741,7 +726,5 @@ export default function CaptionConfigurationTest() { ...@@ -741,7 +726,5 @@ export default function CaptionConfigurationTest() {
done(); done();
}, 8000); }, 8000);
}); });
}) })
} }
...@@ -33,21 +33,6 @@ ...@@ -33,21 +33,6 @@
] ]
} }
], ],
"extensionAbilities": [
{
"name": "ServiceExtAbility",
"srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts",
"label": "$string:entry_desc",
"description": "$string:entry_desc",
"type": "accessibility",
"metadata": [
{
"name": "ohos.accessibleability",
"resource": "$profile:accessibility_config"
}
],
"permissions": ["ohos.permission.GET_BUNDLE_INFO"]
}],
"requestPermissions": [ "requestPermissions": [
{ {
"name": "ohos.permission.SYSTEM_FLOAT_WINDOW", "name": "ohos.permission.SYSTEM_FLOAT_WINDOW",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册