diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js index 2cc402d37cb8fee43f177dcbcdac633eb019aa87..53588a007c84787d03f3b78cc75ba1690fe295cf 100755 --- a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js +++ b/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/entry/src/main/js/test/ActsSubscriber_test_unorder.js @@ -23,6 +23,13 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) { console.info("==========================>publishCallback"); } + function sleep(delay) { + var start = (new Date()).getTime(); + while((new Date()).getTime() - start < delay) { + continue; + } + } + /* * @tc.number : ActsSubscriberTestUnorderSystem_0100 * @tc.name : verify subscribe and publish : Check subscribe and publish common event data @@ -32,7 +39,7 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) { it('ActsSubscriberTestUnorderSystem_0100', 0, async function (done) { console.info("===============ActsSubscriberTestUnorderSystem_0100==========================>"); var commonEventSubscribeInfo = { - events: ["publish_event0100"], + events: ["Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED"], publisherDeviceId: "PublishDeviceId0100", priority: 10, }; @@ -52,7 +59,7 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) { function subscriberCallBack001(err, data) { console.info("==========================>subscriberCallBack001"); - expect(data.event).assertEqual("publish_event0100"); + expect(data.event).assertEqual("Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED"); expect(data.bundleName).assertEqual("PublishBundleName0100"); expect(data.code).assertEqual(55); expect(data.data).assertEqual("PublishData0100"); @@ -67,7 +74,10 @@ describe('ActsSubscriberTestUnorderSystem', async function (done) { data.getSubscribeInfo().then(function (data) { console.info("===============ActsSubscriberTestUnorderSystem_0100=========getSubscribeInfo promise"); Subscriber.subscribe(commonEventSubscriber, subscriberCallBack001); - Subscriber.publish("publish_event0100", commonEventPublishData, publishCallback); + sleep(10); + Subscriber.publish("Subscriber.Support.COMMON_EVENT_BATTERY_CHANGED", + commonEventPublishData, + publishCallback); }); }) setTimeout(function (){