提交 6f2c6e1d 编写于 作者: C chenxuihui

hiappeventsubjscommit

Signed-off-by: Nchenxuihui <chenxuhui2@huawei.com>
上级 1a6e4e40
...@@ -120,13 +120,13 @@ describe('HiAppEventSubTest', function () { ...@@ -120,13 +120,13 @@ describe('HiAppEventSubTest', function () {
*/ */
it('HiAppEventSub02', 3, async function (done) { it('HiAppEventSub02', 3, async function (done) {
console.info('testHiAppEventSub02 start') console.info('testHiAppEventSub02 start')
function sleep(numberMillis){ function sleep(numberMillis) {
var now = new Date(); var now = new Date();
var exitTime = now.getTime() +numberMillis; var exitTime = now.getTime() + numberMillis;
while (true){ while (true) {
now = new Date(); now = new Date();
if(now.getTime() > exitTime) if (now.getTime() > exitTime)
return; return;
} }
} }
let holder = HiAppEvent.addWatcher({ let holder = HiAppEvent.addWatcher({
...@@ -593,7 +593,7 @@ describe('HiAppEventSubTest', function () { ...@@ -593,7 +593,7 @@ describe('HiAppEventSubTest', function () {
console.info('HiAppEventSub07 end') console.info('HiAppEventSub07 end')
}, 1000) }, 1000)
}) })
/** /**
* @tc.number DFX_DFT_HiAppEvent_Sub_0800 * @tc.number DFX_DFT_HiAppEvent_Sub_0800
* @tc.name 验证调用hiAppEvent.addWatcher,domain为无效,事件订阅失败 * @tc.name 验证调用hiAppEvent.addWatcher,domain为无效,事件订阅失败
...@@ -647,7 +647,7 @@ describe('HiAppEventSubTest', function () { ...@@ -647,7 +647,7 @@ describe('HiAppEventSubTest', function () {
console.info('HiAppEventSub08 end') console.info('HiAppEventSub08 end')
}, 1000) }, 1000)
}) })
/** /**
* @tc.number DFX_DFT_HiAppEvent_Sub_0900 * @tc.number DFX_DFT_HiAppEvent_Sub_0900
* @tc.name 验证调用hiAppEvent.addWatcher,设置domain,eventType为FAULT,事件订阅成功 * @tc.name 验证调用hiAppEvent.addWatcher,设置domain,eventType为FAULT,事件订阅成功
...@@ -1004,7 +1004,7 @@ describe('HiAppEventSubTest', function () { ...@@ -1004,7 +1004,7 @@ describe('HiAppEventSubTest', function () {
{ {
domain: "default", domain: "default",
eventTypes: [HiAppEvent.EventType.FAULT,HiAppEvent.EventType.STATISTIC, eventTypes: [HiAppEvent.EventType.FAULT,HiAppEvent.EventType.STATISTIC,
HiAppEvent.EventType.SECURITY,HiAppEvent.EventType.BEHAVIOR] HiAppEvent.EventType.SECURITY,HiAppEvent.EventType.BEHAVIOR]
} }
], ],
triggerCondition: { triggerCondition: {
...@@ -1091,7 +1091,7 @@ describe('HiAppEventSubTest', function () { ...@@ -1091,7 +1091,7 @@ describe('HiAppEventSubTest', function () {
appEventFilters: [ appEventFilters: [
{ {
eventTypes: [HiAppEvent.EventType.FAULT,HiAppEvent.EventType.STATISTIC, eventTypes: [HiAppEvent.EventType.FAULT,HiAppEvent.EventType.STATISTIC,
HiAppEvent.EventType.SECURITY,HiAppEvent.EventType.BEHAVIOR] HiAppEvent.EventType.SECURITY,HiAppEvent.EventType.BEHAVIOR]
} }
], ],
triggerCondition: { triggerCondition: {
...@@ -1258,13 +1258,13 @@ describe('HiAppEventSubTest', function () { ...@@ -1258,13 +1258,13 @@ describe('HiAppEventSubTest', function () {
*/ */
it('HiAppEventSub16', 3, async function (done) { it('HiAppEventSub16', 3, async function (done) {
console.info('testHiAppEventSub16 start') console.info('testHiAppEventSub16 start')
function sleep(numberMillis){ function sleep(numberMillis) {
var now = new Date(); var now = new Date();
var exitTime = now.getTime() +numberMillis; var exitTime = now.getTime() + numberMillis;
while (true){ while (true) {
now = new Date(); now = new Date();
if(now.getTime() > exitTime) if (now.getTime() > exitTime)
return; return;
} }
} }
let result = HiAppEvent.addWatcher({ let result = HiAppEvent.addWatcher({
...@@ -1341,13 +1341,13 @@ describe('HiAppEventSubTest', function () { ...@@ -1341,13 +1341,13 @@ describe('HiAppEventSubTest', function () {
*/ */
it('HiAppEventSub17', 3, async function (done) { it('HiAppEventSub17', 3, async function (done) {
console.info('testHiAppEventSub17 start') console.info('testHiAppEventSub17 start')
function sleep(numberMillis){ function sleep(numberMillis) {
var now = new Date(); var now = new Date();
var exitTime = now.getTime() +numberMillis; var exitTime = now.getTime() + numberMillis;
while (true){ while (true) {
now = new Date(); now = new Date();
if(now.getTime() > exitTime) if (now.getTime() > exitTime)
return; return;
} }
} }
let result = HiAppEvent.addWatcher({ let result = HiAppEvent.addWatcher({
...@@ -1627,7 +1627,7 @@ describe('HiAppEventSubTest', function () { ...@@ -1627,7 +1627,7 @@ describe('HiAppEventSubTest', function () {
console.info('HiAppEventSub21 end') console.info('HiAppEventSub21 end')
}, 1000) }, 1000)
}) })
/** /**
* @tc.number DFX_DFT_HiAppEvent_Sub_2200 * @tc.number DFX_DFT_HiAppEvent_Sub_2200
* @tc.name 验证调用hiAppEvent.addWatcher,timeout=1,事件订阅成功 * @tc.name 验证调用hiAppEvent.addWatcher,timeout=1,事件订阅成功
...@@ -1635,13 +1635,13 @@ describe('HiAppEventSubTest', function () { ...@@ -1635,13 +1635,13 @@ describe('HiAppEventSubTest', function () {
*/ */
it('HiAppEventSub22', 3, async function (done) { it('HiAppEventSub22', 3, async function (done) {
console.info('testHiAppEventSub22 start') console.info('testHiAppEventSub22 start')
function sleep(numberMillis){ function sleep(numberMillis) {
var now = new Date(); var now = new Date();
var exitTime = now.getTime() +numberMillis; var exitTime = now.getTime() + numberMillis;
while (true){ while (true) {
now = new Date(); now = new Date();
if(now.getTime() > exitTime) if (now.getTime() > exitTime)
return; return;
} }
} }
let result = HiAppEvent.addWatcher({ let result = HiAppEvent.addWatcher({
...@@ -1689,7 +1689,6 @@ describe('HiAppEventSubTest', function () { ...@@ -1689,7 +1689,6 @@ describe('HiAppEventSubTest', function () {
}, 1000) }, 1000)
}) })
/** /**
* @tc.number DFX_DFT_HiAppEvent_Sub_2300 * @tc.number DFX_DFT_HiAppEvent_Sub_2300
* @tc.name 验证调用hiAppEvent.addWatcher,timeout=0,事件订阅失败 * @tc.name 验证调用hiAppEvent.addWatcher,timeout=0,事件订阅失败
...@@ -1697,13 +1696,13 @@ describe('HiAppEventSubTest', function () { ...@@ -1697,13 +1696,13 @@ describe('HiAppEventSubTest', function () {
*/ */
it('HiAppEventSub23', 3, async function (done) { it('HiAppEventSub23', 3, async function (done) {
console.info('testHiAppEventSub23 start') console.info('testHiAppEventSub23 start')
function sleep(numberMillis){ function sleep(numberMillis) {
var now = new Date(); var now = new Date();
var exitTime = now.getTime() +numberMillis; var exitTime = now.getTime() + numberMillis;
while (true){ while (true) {
now = new Date(); now = new Date();
if(now.getTime() > exitTime) if (now.getTime() > exitTime)
return; return;
} }
} }
let result = HiAppEvent.addWatcher({ let result = HiAppEvent.addWatcher({
...@@ -1751,7 +1750,6 @@ describe('HiAppEventSubTest', function () { ...@@ -1751,7 +1750,6 @@ describe('HiAppEventSubTest', function () {
}, 1000) }, 1000)
}) })
/** /**
* @tc.number DFX_DFT_HiAppEvent_Sub_2400 * @tc.number DFX_DFT_HiAppEvent_Sub_2400
* @tc.name 验证调用hiAppEvent.addWatcher,未设置触发条件,事件订阅失败 * @tc.name 验证调用hiAppEvent.addWatcher,未设置触发条件,事件订阅失败
...@@ -1759,13 +1757,13 @@ describe('HiAppEventSubTest', function () { ...@@ -1759,13 +1757,13 @@ describe('HiAppEventSubTest', function () {
*/ */
it('HiAppEventSub24', 3, async function (done) { it('HiAppEventSub24', 3, async function (done) {
console.info('testHiAppEventSub24 start') console.info('testHiAppEventSub24 start')
function sleep(numberMillis){ function sleep(numberMillis) {
var now = new Date(); var now = new Date();
var exitTime = now.getTime() +numberMillis; var exitTime = now.getTime() + numberMillis;
while (true){ while (true) {
now = new Date(); now = new Date();
if(now.getTime() > exitTime) if (now.getTime() > exitTime)
return; return;
} }
} }
let result = HiAppEvent.addWatcher({ let result = HiAppEvent.addWatcher({
...@@ -1815,13 +1813,15 @@ describe('HiAppEventSubTest', function () { ...@@ -1815,13 +1813,15 @@ describe('HiAppEventSubTest', function () {
* @tc.name 验证调用hiAppEvent.addWatcher,触发条件仅timeout有效,事件订阅成功 * @tc.name 验证调用hiAppEvent.addWatcher,触发条件仅timeout有效,事件订阅成功
* @tc.desc HiAppEvent write interface test. * @tc.desc HiAppEvent write interface test.
*/ */
function sleep(numberMillis){ it('HiAppEventSub28', 3, async function (done) {
console.info('testHiAppEventSub28 start')
function sleep(numberMillis) {
var now = new Date(); var now = new Date();
var exitTime = now.getTime() +numberMillis; var exitTime = now.getTime() + numberMillis;
while (true){ while (true) {
now = new Date(); now = new Date();
if(now.getTime() > exitTime) if (now.getTime() > exitTime)
return; return;
} }
} }
let result = HiAppEvent.addWatcher({ let result = HiAppEvent.addWatcher({
...@@ -1923,7 +1923,6 @@ describe('HiAppEventSubTest', function () { ...@@ -1923,7 +1923,6 @@ describe('HiAppEventSubTest', function () {
}, 1000) }, 1000)
}) })
/** /**
* @tc.number DFX_DFT_HiAppEvent_Sub_2500 * @tc.number DFX_DFT_HiAppEvent_Sub_2500
* @tc.name 验证调用removeWatcher,watcher为已有watcher,订阅者、相关订阅事件删除成功 * @tc.name 验证调用removeWatcher,watcher为已有watcher,订阅者、相关订阅事件删除成功
...@@ -1962,7 +1961,6 @@ describe('HiAppEventSubTest', function () { ...@@ -1962,7 +1961,6 @@ describe('HiAppEventSubTest', function () {
}) })
/** /**
* @tc.number DFX_DFT_HiAppEvent_Sub_2600 * @tc.number DFX_DFT_HiAppEvent_Sub_2600
* @tc.name 验证调用removeWatcher,watcher无效,订阅者、相关订阅事件删除失败 * @tc.name 验证调用removeWatcher,watcher无效,订阅者、相关订阅事件删除失败
...@@ -1999,7 +1997,7 @@ describe('HiAppEventSubTest', function () { ...@@ -1999,7 +1997,7 @@ describe('HiAppEventSubTest', function () {
console.info('HiAppEventSub26 end') console.info('HiAppEventSub26 end')
}, 2000) }, 2000)
}) })
/** /**
* @tc.number DFX_DFT_HiAppEvent_Sub_2700 * @tc.number DFX_DFT_HiAppEvent_Sub_2700
* @tc.name 验证清理接口功能 * @tc.name 验证清理接口功能
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册