未验证 提交 9033bcce 编写于 作者: O openharmony_ci 提交者: Gitee

!4083 【XTS】【事件通知子系统】bundlename添加

Merge pull request !4083 from 付家睿/master
......@@ -170,6 +170,56 @@ describe('ActsSubscriberTestUnorder', async function (done) {
})
})
/*
* @tc.number : ActsSubscriberTestUnorder_0400
* @tc.name : verify subscribe and publish : Check subscribe and publish common event data
* with publishInfo data
* @tc.desc : Check the subscriber can receive event "publish_event0300" type of the interface (by Promise)
*/
it('ActsSubscriberTestUnorder_0400', 0, async function (done) {
console.info("===============ActsSubscriberTestUnorder_0400==========================>");
let commonEventSubscribeInfo = {
events: ["publish_event0400"],
publisherDeviceId: "PublishDeviceId0400",
priority: 10,
};
let commonEventPublishData = {
isOrdered: false,
bundleName: "com.example.actssubscribertestunorder",
code: 55,
data: "PublishData0400",
}
function isOrderedCommonEventCallback004(err, data) {
console.info("==========================>isOrderedCommonEventCallback003");
expect(data).assertEqual(false);
done();
}
function subscriberCallBack004(err, data) {
console.info("==========================>subscriberCallBack004");
expect(data.event).assertEqual("publish_event0400");
expect(data.code).assertEqual(55);
expect(data.data).assertEqual("PublishData0400");
commonEventSubscriber004.isOrderedCommonEvent(isOrderedCommonEventCallback004);
}
Subscriber.createSubscriber(
commonEventSubscribeInfo
).then((data)=>{
console.info("===============ActsSubscriberTestUnorder_0400=========createSubscriber promise");
commonEventSubscriber004 = data;
data.getSubscribeInfo().then(()=>{
console.info("===============ActsSubscriberTestUnorder_0400=========getSubscribeInfo promise");
Subscriber.subscribe(commonEventSubscriber004, subscriberCallBack004);
setTimeout(function (){
console.info("==========ActsSubscriberTestUnorder_0400 publish start============");
Subscriber.publish("publish_event0400", commonEventPublishData, publishCallback);
}, 1000);
});
})
})
/*
* @tc.number : ActsSubscriberTestUnorder_0500
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册