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

!9155 ActsAbilityMonitorTest概率性失败

Merge pull request !9155 from songjindian/arr_xts
......@@ -652,17 +652,13 @@ export default function abilityTest() {
function UnSubscribeCallback() {
console.debug("====>commonEvent_foreground UnSubscribeCallback====>");
}
var AddAbility
function SubscribeCallBack(err, data) {
console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data));
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_1000===createSubscriber" + JSON.stringify(data));
var AddAbility = data
Delegator.getCurrentTopAbility().then((ability) => {
console.info("===ACTS_AddAbilityMonitor_1000===ability" + JSON.stringify(ability).length);
Delegator.doAbilityBackground(ability).then(async () => {
console.info("===ACTS_AddAbilityMonitor_1000===data succeed.");
expect(true).assertTrue();
await Subscriber.subscribe(AddAbility, (err, data) => {
AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_1000CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
......@@ -682,6 +678,11 @@ export default function abilityTest() {
}, 2500)
}
})
Delegator.getCurrentTopAbility().then((ability) => {
console.info("===ACTS_AddAbilityMonitor_1000===ability" + JSON.stringify(ability).length);
Delegator.doAbilityBackground(ability).then(async () => {
console.info("===ACTS_AddAbilityMonitor_1000===data succeed.");
expect(true).assertTrue();
}).catch(() => {
console.info("===ACTS_AddAbilityMonitor_1000===data succeed.");
expect(false).assertTrue();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册