提交 2a733d04 编写于 作者: Z zhijianwen

emitter_release

Signed-off-by: Nzhijianwen <zhijianwen@huawei.com>
上级 4b05c238
...@@ -12,346 +12,365 @@ ...@@ -12,346 +12,365 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter'
import notification from '@ohos.notification'; import notification from '@ohos.notification'
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent'
import wantAgent from '@ohos.wantAgent'; import wantAgent from '@ohos.wantAgent'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle'; import bundle from '@ohos.bundle'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Assert } from 'deccjsunit/index'; import account from '@ohos.account.osAccount'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, Assert } from 'deccjsunit/index'
describe('EmitterTest', function () { describe('EmitterTest', function () {
const TAG = 'EmitterTest ===> ' const TAG = 'EmitterTest ===> '
async function applyPermission() { console.info(TAG + 'EmitterTest START' )
let appInfo = await bundle.getApplicationInfo('com.example.emittertest', 0, 100);
let atManager = abilityAccessCtrl.createAtManager(); let userId
if (atManager != null) {
let tokenID = appInfo.accessTokenId; async function getUserId() {
console.info('[permission]case accessTokenId is' + tokenID); await account.getAccountManager().getOsAccountLocalIdFromProcess().then(account => {
let permissionName1 = 'ohos.permission.NOTIFICATION_CONTROLLER'; console.info("getOsAccountLocalIdFromProcess userid ==========" + account)
userId = account
await atManager.grantUserGrantedPermission(tokenID, permissionName1).then((result) => { }).catch(err => {
console.info('[permission]case grantUserGrantedPermission success:' + result); console.info("getOsAccountLocalIdFromProcess err ==========" + JSON.stringify(err))
}).catch((err) => { })
console.info('[permission]case grantUserGrantedPermission failed:' + err); }
});
} else { async function applyPermission() {
console.info('[permission]case apply permission failed,createAtManager failed'); let appInfo = await bundle.getApplicationInfo('com.example.emittertest', 0, userId)
} let atManager = abilityAccessCtrl.createAtManager()
if (atManager != null) {
let tokenID = appInfo.accessTokenId
console.info('[permission]case accessTokenId is' + tokenID)
let permissionName1 = 'ohos.permission.NOTIFICATION_CONTROLLER'
await atManager.grantUserGrantedPermission(tokenID, permissionName1).then((result) => {
console.info('[permission]case grantUserGrantedPermission success:' + result)
}).catch((err) => {
console.info('[permission]case grantUserGrantedPermission failed:' + err)
})
} else {
console.info('[permission]case apply permission failed,createAtManager failed')
} }
}
const bundlel = { const bundlel = {
bundle: 'com.example.emittertest' bundle: 'com.example.emittertest'
} }
let innerEvent = { let innerEvent = {
eventId: undefined, eventId: undefined,
priority: undefined priority: undefined
} }
let eventData = {
data: {
'id': undefined,
'content': undefined
}
}
let wantAgentInfo = { let eventData = {
wants: [ data: {
{ 'id': undefined,
bundleName: 'com.example.emittertest', 'content': undefined
abilityName: 'com.example.emittertest.TestAbility' }
} }
],
operationType: wantAgent.OperationType.START_ABILITY, let wantAgentInfo = {
requestCode: 0, wants: [
wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG], {
extraInfo: { bundleName: 'com.example.emittertest',
key_1: 'value_1', abilityName: 'com.example.emittertest.TestAbility'
key_2: 'value_2', }
} ],
operationType: wantAgent.OperationType.START_ABILITY,
requestCode: 0,
wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG],
extraInfo: {
key_1: 'value_1',
key_2: 'value_2',
} }
let subscriber = undefined }
beforeAll(async function() { beforeAll(async function () {
await applyPermission(); await getUserId()
await notification.enableNotification(bundlel, true, (err) => { await applyPermission()
if (err.code) { await notification.enableNotification(bundlel, true, (err) => {
console.info(TAG + ': enableNotification failed! Err.code ===> ' + JSON.stringify(err.code)) if (err.code) {
console.info(TAG + ': enableNotification failed! Err.message ===> ' + JSON.stringify(err.message)) console.info(TAG + ': enableNotification failed! Err.code ===> ' + JSON.stringify(err.code))
expect(false).assertTrue() console.info(TAG + ': enableNotification failed! Err.message ===> ' + JSON.stringify(err.message))
} else { expect(false).assertTrue()
console.info(TAG + ': enableNotification successd!') } else {
expect(true).assertTrue() console.info(TAG + ': enableNotification successd!')
} expect(true).assertTrue()
}); }
console.info(TAG + 'beforeAll case');
}) })
afterEach(async function() { console.info(TAG + 'beforeAll case')
await notification.cancelAll((err) => { })
if (err.code) { afterEach(async function () {
console.info(TAG + ': cancelAll failed! Err.code ===> ' + err.code) await notification.cancelAll((err) => {
console.info(TAG + ': cancelAll failed! Err.message ===> ' + err.message) if (err.code) {
expect(false).assertTrue() console.info(TAG + ': cancelAll failed! Err.code ===> ' + err.code)
} else { console.info(TAG + ': cancelAll failed! Err.message ===> ' + err.message)
console.info(TAG + ': cancelAll successd!') expect(false).assertTrue()
expect(true).assertTrue() } else {
} console.info(TAG + ': cancelAll successd!')
}) expect(true).assertTrue()
}
}) })
function EmitterCallback(eventData) { })
console.info(TAG + 'eventData.id: ' + JSON.stringify(eventData.data.id));
console.info(TAG + 'eventData.content: ' + JSON.stringify(eventData.data.content)); function EmitterCallback(eventData) {
if (eventData.data.id == 0) { console.info(TAG + 'eventData.id: ' + JSON.stringify(eventData.data.id))
expect(eventData.data.content).assertEqual('message_0'); console.info(TAG + 'eventData.content: ' + JSON.stringify(eventData.data.content))
} else if (eventData.data.id == 1) { if (eventData.data.id == 0) {
expect(eventData.data.content).assertEqual('message_1'); expect(eventData.data.content).assertEqual('message_0')
} else if (eventData.data.id == 2) { } else if (eventData.data.id == 1) {
expect(eventData.data.content).assertEqual('message_2'); expect(eventData.data.content).assertEqual('message_1')
} else if (eventData.data.id == 3) { } else if (eventData.data.id == 2) {
expect(eventData.data.content).assertEqual('message_3'); expect(eventData.data.content).assertEqual('message_2')
} else if (eventData.data.id == 4) { } else if (eventData.data.id == 3) {
expect(eventData.data.content).assertEqual('message_4'); expect(eventData.data.content).assertEqual('message_3')
} else if (eventData.data.id == 5) { } else if (eventData.data.id == 4) {
expect(eventData.data.content).assertEqual('message_5'); expect(eventData.data.content).assertEqual('message_4')
} } else if (eventData.data.id == 5) {
expect(eventData.data.content).assertEqual('message_5')
} }
}
it('EmitterTest_001', 0, async function (done) {
console.info(TAG + 'EmitterTest_001 start.') it('EmitterTest_001', 0, async function (done) {
innerEvent.eventId = 1 console.info(TAG + 'EmitterTest_001 START.')
innerEvent.priority = events_emitter.EventPriority.IDLE innerEvent.eventId = 1
innerEvent.priority = events_emitter.EventPriority.IDLE
eventData.data.id = 0
eventData.data.content = 'message_0' eventData.data.id = 0
eventData.data.content = 'message_0'
events_emitter.on(innerEvent, EmitterCallback)
events_emitter.emit(innerEvent, eventData) events_emitter.on(innerEvent, EmitterCallback)
eventData.data.id = 1 events_emitter.emit(innerEvent, eventData)
eventData.data.content = 'message_1' eventData.data.id = 1
events_emitter.emit(innerEvent, eventData) eventData.data.content = 'message_1'
console.info(TAG + 'EmitterTest_001 end.') events_emitter.emit(innerEvent, eventData)
console.info(TAG + 'EmitterTest_001 end.')
done()
})
it('EmitterTest_002', 0, async function (done) {
console.info(TAG + 'EmitterTest_002 START.')
innerEvent.eventId = 2
innerEvent.priority = events_emitter.EventPriority.LOW
eventData.data.id = 2
eventData.data.content = 'message_2'
events_emitter.once(innerEvent, EmitterCallback)
events_emitter.emit(innerEvent, eventData)
console.info(TAG + 'EmitterTest_002 end.')
done()
})
it('EmitterTest_003', 0, async function (done) {
console.info(TAG + 'EmitterTest_003 START.')
innerEvent.eventId = 3
innerEvent.priority = events_emitter.EventPriority.HIGH
eventData.data.id = 3
eventData.data.content = 'message_3'
events_emitter.once(innerEvent, EmitterCallback)
events_emitter.emit(innerEvent, eventData)
console.info(TAG + 'EmitterTest_003 end.')
done()
})
it('EmitterTest_004', 0, async function (done) {
console.info(TAG + 'EmitterTest_004 START.')
innerEvent.eventId = 4
innerEvent.priority = events_emitter.EventPriority.IMMEDIATE
eventData.data.id = 4
eventData.data.content = 'message_4'
events_emitter.once(innerEvent, EmitterCallback)
events_emitter.emit(innerEvent, eventData)
console.info(TAG + 'EmitterTest_004 end.')
done()
})
it('EmitterTest_005', 0, async function (done) {
console.info(TAG + 'EmitterTest_005 START.')
innerEvent.eventId = 5
innerEvent.priority = events_emitter.EventPriority.IMMEDIATE
eventData.data.id = 5
eventData.data.content = 'message_5'
events_emitter.once(innerEvent, EmitterCallback)
events_emitter.emit(innerEvent, eventData)
events_emitter.off(5)
console.info(TAG + 'EmitterTest_005 end.')
done()
})
it('wantAgent_trigger_001', 0, async function (done) {
console.info(TAG + 'wantAgent_trigger_001 START.')
await wantAgent.getWantAgent(wantAgentInfo, (err, data) => {
if (err.code) {
console.info(TAG + ': getWant failed! Err.code ===> ' + JSON.stringify(err.code))
console.info(TAG + ': getWant failed! Err.message ===> ' + JSON.stringify(err.message))
expect(false).assertTrue()
done() done()
} else {
console.info(TAG + ': getWant successd!')
console.info(TAG + ': wantAgentInfo ===> ' + JSON.stringify(data))
expect(typeof (data)).assertEqual('object')
let triggerInfo = {
code: 100,
want: null,
permission: null,
extraInfo: {
triggerInfo_key_1: 'triggerInfo_value_1',
triggerInfo_key_2: 'triggerInfo_value_2',
}
}
wantAgent.trigger(data, triggerInfo, (err, data) => {
console.info(TAG + ': trigger successd! CompleteData ===> ' + JSON.stringify(data))
console.info(TAG + ': data.want.bundleName ===> ' + JSON.stringify(data.want.abilityName))
console.info(TAG + ': data.want.abilityName ===> ' + JSON.stringify(data.want.abilityName))
console.info(TAG + ': data.want.parameters.key_1 ===> ' + JSON.stringify(data.want.parameters.key_1))
console.info(TAG + ': data.want.parameters.key_2 ===> ' + JSON.stringify(data.want.parameters.key_2))
expect(data.want.bundleName).assertEqual('com.example.emittertest')
expect(data.want.abilityName).assertEqual('com.example.emittertest.TestAbility')
expect(data.want.parameters.key_1).assertEqual('value_1')
expect(data.want.parameters.key_2).assertEqual('value_2')
done()
})
}
}) })
})
it('EmitterTest_002', 0, async function (done) { it('commonEvent_subscriberInfo_001', 0, async function (done) {
console.info(TAG + 'EmitterTest_002 start.') console.info(TAG + 'commonEvent_subscriberInfo_001 START.')
innerEvent.eventId = 2
innerEvent.priority = events_emitter.EventPriority.LOW
eventData.data.id = 2 let CommonEventSubscribeInfo = {
eventData.data.content = 'message_2' events: ['event'],
publisherPermission: '',
events_emitter.once(innerEvent, EmitterCallback) publisherDeviceId: '',
events_emitter.emit(innerEvent, eventData) userId: 100,
console.info(TAG + 'EmitterTest_002 end.') priority: 1000
done() }
})
it('EmitterTest_003', 0, async function (done) {
console.info(TAG + 'EmitterTest_003 start.')
innerEvent.eventId = 3
innerEvent.priority = events_emitter.EventPriority.HIGH
eventData.data.id = 3 let CommonEventSubscriber = await commonEvent.createSubscriber(CommonEventSubscribeInfo)
eventData.data.content = 'message_3' if (CommonEventSubscriber == undefined) {
console.info(TAG + ': createSubscriber failed! Err.message ===> ' + JSON.stringify(CommonEventSubscriber))
expect(false).assertTrue()
}
events_emitter.once(innerEvent, EmitterCallback) await CommonEventSubscriber.getSubscribeInfo((err, CommonEventSubscribeInfo) => {
events_emitter.emit(innerEvent, eventData) if (err.code) {
console.info(TAG + 'EmitterTest_003 end.') console.info(TAG + ': getSubscribeInfo failed! Err.code ===> ' + JSON.stringify(err.code))
console.info(TAG + ': getSubscribeInfo failed! Err.message ===> ' + JSON.stringify(err.message))
expect(false).assertTrue()
done() done()
}) } else {
console.info(TAG + ': getSubscribeInfo successd! CommonEventSubscribeInfo ===> ' + JSON.stringify(CommonEventSubscribeInfo))
it('EmitterTest_004', 0, async function (done) {
console.info(TAG + 'EmitterTest_004 start.')
innerEvent.eventId = 4
innerEvent.priority = events_emitter.EventPriority.IMMEDIATE
eventData.data.id = 4
eventData.data.content = 'message_4'
events_emitter.once(innerEvent, EmitterCallback)
events_emitter.emit(innerEvent, eventData)
console.info(TAG + 'EmitterTest_004 end.')
done() done()
}
}) })
})
it('EmitterTest_005', 0, async function (done) { it('notification_publish_001', 0, async function (done) {
console.info(TAG + 'EmitterTest_005 start.') console.info(TAG + 'notification_publish_001 START.')
innerEvent.eventId = 5
innerEvent.priority = events_emitter.EventPriority.IMMEDIATE await notification.isNotificationEnabled(bundlel, (err, data) => {
if (err.code) {
eventData.data.id = 5 console.info(TAG + ': isNotificationEnabled failed! Err.code ===> ' + JSON.stringify(err.code))
eventData.data.content = 'message_5' console.info(TAG + ': isNotificationEnabled failed! Err.message ===> ' + JSON.stringify(err.message))
expect(false).assertTrue()
events_emitter.once(innerEvent, EmitterCallback) } else {
events_emitter.emit(innerEvent, eventData) console.info(TAG + ': isNotificationEnabled successd! Result ===> ' + JSON.stringify(data))
events_emitter.off(5) expect(true).assertTrue()
console.info(TAG + 'EmitterTest_005 end.') }
done()
})
it('wantAgent_trigger_001', 0, async function (done){
await wantAgent.getWantAgent(wantAgentInfo, (err, data) => {
if (err.code) {
console.info(TAG + ': getWant failed! Err.code ===> ' + JSON.stringify(err.code))
console.info(TAG + ': getWant failed! Err.message ===> ' + JSON.stringify(err.message))
expect(false).assertTrue()
done()
} else {
console.info(TAG + ': getWant successd!')
console.info(TAG + ': wantAgentInfo ===> ' + JSON.stringify(data))
expect(typeof(data)).assertEqual('object')
let triggerInfo = {
code: 100,
want: null,
permission: null,
extraInfo: {
triggerInfo_key_1: 'triggerInfo_value_1',
triggerInfo_key_2: 'triggerInfo_value_2',
}
}
wantAgent.trigger(data, triggerInfo, (err, data) => {
console.info(TAG + ': trigger successd! CompleteData ===> ' + JSON.stringify(data))
console.info(TAG + ': data.want.bundleName ===> ' + JSON.stringify(data.want.abilityName))
console.info(TAG + ': data.want.abilityName ===> ' + JSON.stringify(data.want.abilityName))
console.info(TAG + ': data.want.parameters.key_1 ===> ' + JSON.stringify(data.want.parameters.key_1))
console.info(TAG + ': data.want.parameters.key_2 ===> ' + JSON.stringify(data.want.parameters.key_2))
expect(data.want.bundleName).assertEqual('com.example.emittertest')
expect(data.want.abilityName).assertEqual('com.example.emittertest.TestAbility')
expect(data.want.parameters.key_1).assertEqual('value_1')
expect(data.want.parameters.key_2).assertEqual('value_2')
done()
})
}
})
}) })
async function SubscribeCallbackData(data) {
it('notification_publish_001', 0, async function (done){ console.info(TAG + ': data ===> ' + JSON.stringify(data))
await notification.isNotificationEnabled(bundlel, (err, data) => { console.info(TAG + ': data.request.content.normal.title ===> ' + JSON.stringify(data.request.content.normal.title))
if (err.code) { console.info(TAG + ': data.request.content.normal.text ===> ' + JSON.stringify(data.request.content.normal.text))
console.info(TAG + ': isNotificationEnabled failed! Err.code ===> ' + JSON.stringify(err.code)) console.info(TAG + ': data.request.content.normal.additionalText ===> ' + JSON.stringify(data.request.content.normal.additionalText))
console.info(TAG + ': isNotificationEnabled failed! Err.message ===> ' + JSON.stringify(err.message)) console.info(TAG + ': data.request.actionButtons[0].title ===> ' + JSON.stringify(data.request.actionButtons[0].title))
expect(false).assertTrue() expect(data.request.content.normal.title).assertEqual('title')
} else { expect(data.request.content.normal.text).assertEqual('text')
console.info(TAG + ': isNotificationEnabled successd! Result ===> ' + JSON.stringify(data)) expect(data.request.content.normal.additionalText).assertEqual('additionalText')
expect(true).assertTrue() expect(data.request.content.normal.creatorBundleName).assertEqual(bundlel.bundle)
} expect(data.request.content.normal.creatorPid != undefined).assertTrue()
}) expect(data.request.content.normal.creatorUid != undefined).assertTrue()
async function SubscribeCallbackData(data) { expect(data.request.actionButtons[0].title).assertEqual('additionalText')
console.info(TAG + ': data ===> ' + JSON.stringify(data)) expect(data.request.actionButtons[0].extras.wantAgentInfo_key_1).assertEqual('wantAgentInfo_key_1')
console.info(TAG + ': data.request.content.normal.title ===> ' + JSON.stringify(data.request.content.normal.title)) expect(data.request.actionButtons[0].extras.wantAgentInfo_key_2).assertEqual('wantAgentInfo_key_2')
console.info(TAG + ': data.request.content.normal.text ===> ' + JSON.stringify(data.request.content.normal.text)) expect(data.request.actionButtons[0].userInput.inputKey).assertEqual('Please input at this')
console.info(TAG + ': data.request.content.normal.additionalText ===> ' + JSON.stringify(data.request.content.normal.additionalText)) expect(true).assertTrue()
console.info(TAG + ': data.request.actionButtons[0].title ===> ' + JSON.stringify(data.request.actionButtons[0].title))
expect(data.request.content.normal.title).assertEqual('title'); await notification.unsubscribe(NotificationSubscriber, (err) => {
expect(data.request.content.normal.text).assertEqual('text'); if (err.code) {
expect(data.request.content.normal.additionalText).assertEqual('additionalText'); console.info(TAG + ': unsubscribe failed! Err.code ===> ' + JSON.stringify(err.code))
expect(data.request.content.normal.creatorBundleName).assertEqual(bundlel.bundle); console.info(TAG + ': unsubscribe failed! Err.message ===> ' + JSON.stringify(err.message))
expect(data.request.content.normal.creatorPid != undefined).assertTrue() expect(false).assertTrue()
expect(data.request.content.normal.creatorUid != undefined).assertTrue() done()
expect(data.request.actionButtons[0].title).assertEqual('additionalText'); } else {
expect(data.request.actionButtons[0].extras.wantAgentInfo_key_1).assertEqual('wantAgentInfo_key_1') console.info(TAG + ': unsubscribe successd!')
expect(data.request.actionButtons[0].extras.wantAgentInfo_key_2).assertEqual('wantAgentInfo_key_2') expect(true).assertTrue()
expect(data.request.actionButtons[0].userInput.inputKey).assertEqual('Please input at this')
expect(true).assertTrue()
await notification.unsubscribe(NotificationSubscriber, (err) => {
if (err.code) {
console.info(TAG + ': unsubscribe failed! Err.code ===> ' + JSON.stringify(err.code))
console.info(TAG + ': unsubscribe failed! Err.message ===> ' + JSON.stringify(err.message))
expect(false).assertTrue()
done()
} else {
console.info(TAG + ': unsubscribe successd!')
expect(true).assertTrue()
}
})
}
let NotificationSubscriber = {
onConsume: SubscribeCallbackData
} }
})
}
await notification.subscribe(NotificationSubscriber, (err)=>{ let NotificationSubscriber = {
if (err.code) { onConsume: SubscribeCallbackData
console.info(TAG + ': subscribe failed! Err.code ===> ' + JSON.stringify(err.code)) }
console.info(TAG + ': subscribe failed! Err.message ===> ' + JSON.stringify(err.message))
expect(false).assertTrue()
} else {
console.info(TAG + ': subscribe successd!')
expect(true).assertTrue()
done()
}
})
let wantAgentInstance = await wantAgent.getWantAgent(wantAgentInfo)
const NotificationRequest = {
content : {
contentType : notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal : {
title : 'title',
text : 'text',
additionalText : 'additionalText'
},
},
actionButtons: [
{
title : 'activeButton_title',
wantAgent : wantAgentInstance,
extras : {
wantAgentInfo_key_1: 'wantAgentInfo_key_1',
wantAgentInfo_key_2: 'wantAgentInfo_key_2',
},
userInput : {
inputKey : 'Please input at this'
}
}
],
}
// 发布通知 await notification.subscribe(NotificationSubscriber, (err) => {
await notification.publish(NotificationRequest, (err) => { if (err.code) {
if (err.code) { console.info(TAG + ': subscribe failed! Err.code ===> ' + JSON.stringify(err.code))
console.info(TAG + ': publish failed! Err.code ===> ' + JSON.stringify(err.code)) console.info(TAG + ': subscribe failed! Err.message ===> ' + JSON.stringify(err.message))
console.info(TAG + ': publish failed! Err.message ===> ' + JSON.stringify(err.message)) expect(false).assertTrue()
expect(false).assertTrue() } else {
} else { console.info(TAG + ': subscribe successd!')
console.info(TAG + ': publish successd!') expect(true).assertTrue()
expect(true).assertTrue() done()
} }
})
}) })
let wantAgentInstance = await wantAgent.getWantAgent(wantAgentInfo)
it('commonEvent_subscriberInfo_001', 0, async function (done){ const NotificationRequest = {
let CommonEventSubscribeInfo = { content: {
events: ['event'], contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
publisherPermission: '', normal: {
publisherDeviceId: '', title: 'title',
userId: 100, text: 'text',
priority: 1000 additionalText: 'additionalText'
} },
},
let CommonEventSubscriber = await commonEvent.createSubscriber(CommonEventSubscribeInfo) actionButtons: [
if (CommonEventSubscriber == undefined) { {
console.info(TAG + ': createSubscriber failed! Err.message ===> ' + JSON.stringify(CommonEventSubscriber)) title: 'activeButton_title',
expect(false).assertTrue() wantAgent: wantAgentInstance,
extras: {
wantAgentInfo_key_1: 'wantAgentInfo_key_1',
wantAgentInfo_key_2: 'wantAgentInfo_key_2',
},
userInput: {
inputKey: 'Please input at this'
}
} }
],
}
await CommonEventSubscriber.getSubscribeInfo((err, CommonEventSubscribeInfo)=>{ await notification.publish(NotificationRequest, (err) => {
if (err.code) { if (err.code) {
console.info(TAG + ': getSubscribeInfo failed! Err.code ===> ' + JSON.stringify(err.code)) console.info(TAG + ': publish failed! Err.code ===> ' + JSON.stringify(err.code))
console.info(TAG + ': getSubscribeInfo failed! Err.message ===> ' + JSON.stringify(err.message)) console.info(TAG + ': publish failed! Err.message ===> ' + JSON.stringify(err.message))
expect(false).assertTrue() expect(false).assertTrue()
done() } else {
} else { console.info(TAG + ': publish successd!')
console.info(TAG + ': getSubscribeInfo successd! CommonEventSubscribeInfo ===> ' + JSON.stringify(CommonEventSubscribeInfo)) expect(true).assertTrue()
done() }
}
})
})
}) })
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册