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

!9155 ActsAbilityMonitorTest概率性失败

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