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

!2698 【XTS】【事件通知子系统】publish,sub,distributed,wantAgentInfo用例修改

Merge pull request !2698 from fujiarui/cherry-pick-1647835062
......@@ -61,10 +61,13 @@ describe('ActsAnsDistributeTest', function () {
it('ActsDistribute_test_0300', 0, async function (done) {
await notify.getDeviceRemindType((err,data) => {
console.debug("===>ActsDistribute_test_0300===>"+ JSON.stringify(data))
expect(data != notify.DeviceRemindType.IDLE_DONOT_REMIND ).assertEqual(true);
expect(data != notify.DeviceRemindType.IDLE_REMIND).assertEqual(true);
expect(data != notify.DeviceRemindType.ACTIVE_DONOT_REMIND).assertEqual(true);
expect(data).assertEqual(notify.DeviceRemindType.ACTIVE_REMIND);
if (data != notify.DeviceRemindType.IDLE_DONOT_REMIND
&& data != notify.DeviceRemindType.IDLE_REMIND
&& data != notify.DeviceRemindType.ACTIVE_DONOT_REMIND
&& data != notify.DeviceRemindType.ACTIVE_REMIND )
{
expect().assertFail();
}
done();
});
})
......@@ -77,9 +80,15 @@ describe('ActsAnsDistributeTest', function () {
it('ActsDistribute_test_0400', 0, async function (done) {
function onConsume0100(data) {
console.info("========ActsDistribute_test_0400 onConsume data:=======>" + JSON.stringify(data));
expect(data.request.distributedOption.remindType).assertEqual(3);
if (data.request.distributedOption.remindType != notify.DeviceRemindType.IDLE_DONOT_REMIND
&& data.request.distributedOption.remindType != notify.DeviceRemindType.IDLE_REMIND
&& data.request.distributedOption.remindType != notify.DeviceRemindType.ACTIVE_DONOT_REMIND
&& data.request.distributedOption.remindType != notify.DeviceRemindType.ACTIVE_REMIND )
{
expect().assertFail();
}
expect(data.request.deviceId).assertEqual("");
console.info("========ActsDistribute_test_0400 onConsume data:=======>" + JSON.stringify(data.request.notificationFlags));
console.info("ActsDistribute_test_0400 onConsume data"+JSON.stringify(data.request.notificationFlags));
expect(JSON.stringify(data.request.notificationFlags)).assertEqual(undefined);
}
await notify.enableDistributed(true);
......
......@@ -229,7 +229,8 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG]
}
wantAgent.getWantAgent(agentInfoc,
setTimeout(function(){
wantAgent.getWantAgent(agentInfoc,
(err, data) => {
if (err.code == 0) {
WantAgentc = data;
......@@ -266,11 +267,13 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.info(data);
expect(typeof(data)).assertEqual("object");
}
done();
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_0300====>");
done();
}, time);
});
}, 1000);
})
/*
......@@ -334,7 +337,8 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG]
}
wantAgent.getWantAgent(agentInfof,
setTimeout(function(){
wantAgent.getWantAgent(agentInfof,
(err, data) => {
console.log("=======agentInfof======="+err.code+JSON.stringify(data))
if (err.code == 0) {
......@@ -359,11 +363,13 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
else{
console.info('----getWantAgent failed!----'+err.code+data);
}
done();
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_0400====>");
done();
}, time);
});
}, 1000);
})
/*
* @tc.number: ACTS_SetWantInfo_0500
......@@ -425,7 +431,8 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG]
}
wantAgent.getWantAgent(agentInfof,
setTimeout(function(){
wantAgent.getWantAgent(agentInfof,
(err, data) => {
if (err.code == 0) {
WantAgente = data;
......@@ -462,6 +469,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_0500====>");
}, time);
});
}, 1000);
})
/*
* @tc.number: ACTS_SetWantInfo_0600
......
......@@ -19,6 +19,9 @@
"deviceType": [
"phone"
],
"reqPermissions": [{
"name": "ohos.permission.NOTIFICATION_CONTROLLER"
}],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
......
......@@ -18,6 +18,11 @@
"name": ".MyApplication",
"deviceType": [
"phone"
],
"reqPermissions": [
{
"name": "ohos.permission.NOTIFICATION_CONTROLLER"
}
],
"distro": {
"deliveryWithInstall": true,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册