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

!1931 【全局资源调度子系统】【mater】修复提醒代理失败用例

Merge pull request !1931 from 南先森/0215
...@@ -126,24 +126,25 @@ describe('ReminderAgentTest', function () { ...@@ -126,24 +126,25 @@ describe('ReminderAgentTest', function () {
* @tc.name testAddNotificationSlotNorFun002 * @tc.name testAddNotificationSlotNorFun002
* @tc.desc Adds a reminder notification slot with the promise function and null mySlot. * @tc.desc Adds a reminder notification slot with the promise function and null mySlot.
*/ */
it('testAddNotificationSlotNorFun002', 0, async function (done) { it('testAddNotificationSlotNorFun002', 0, async function (done) {
let mySlot = null; let mySlot = null;
let promise = new Promise((resolve, reject) => { try {
reminderAgent.addNotificationSlot(mySlot).then(() => { reminderAgent.addNotificationSlot(mySlot,function(err) {
resolve(); if(err == undefined) {
}).catch(function (err) { console.info('testAddNotificationSlotNorFun002 execute success');
reject(new Error('errr occurred.')); } else {
console.info('error: ' + err.code); console.info('testAddNotificationSlotNorFun002 execute failed');
} }
); }).catch(function(err) {
promise.then(() => { console.info("testAddNotificationSlotNorFun002 execute catch" + err.code);
}, err => { })
let i = 0; } catch(error) {
expect(0).assertEqual(i); console.info("testAddNotificationSlotNorFun002 execute try - catch" + error.code);
}).catch(res => { }); let i = 0;
expect(0).assertEqual(i);
done(); done();
}) }})
/** /**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_005 * @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_005
* @tc.name testAddNotificationSlotNorFun003 * @tc.name testAddNotificationSlotNorFun003
...@@ -630,4 +631,4 @@ describe('ReminderAgentTest', function () { ...@@ -630,4 +631,4 @@ describe('ReminderAgentTest', function () {
done(); done();
}) })
}) })
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册