Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9254cff6
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9254cff6
编写于
7月 04, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 04, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9203 修复ActsAbilityMonitorTest偶现事件订阅对象被回收造成失败
Merge pull request !9203 from songjindian/change_monitor
上级
8bacc473
271a314b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
466 addition
and
460 deletion
+466
-460
ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets
...e/abilitymontior/entry/src/main/ets/test/Ability.test.ets
+466
-460
未找到文件。
ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
9254cff6
...
@@ -115,36 +115,35 @@ export default function abilityTest() {
...
@@ -115,36 +115,35 @@ export default function abilityTest() {
}
}
}, (async (err) => {
}, (async (err) => {
console.debug("====>ACTS_AddAbilityMonitor_0200 success====>" + err.code);
console.debug("====>ACTS_AddAbilityMonitor_0200 success====>" + err.code);
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0200===createSubscriber" + JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0200CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
console.debug("====>0200startAbility success====>");
console.debug("====>0200startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0200===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0200CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
}))
}))
})
})
...
@@ -268,36 +267,35 @@ export default function abilityTest() {
...
@@ -268,36 +267,35 @@ export default function abilityTest() {
onAbilityDestroy: onAbilityDestroy
onAbilityDestroy: onAbilityDestroy
}, (async (err) => {
}, (async (err) => {
console.debug("====>ACTS_AddAbilityMonitor_0400 success====>" + err.code);
console.debug("====>ACTS_AddAbilityMonitor_0400 success====>" + err.code);
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0400===createSubscriber" + JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0400CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility4'
abilityName: 'MainAbility4'
}).then(async () => {
}).then(async () => {
console.debug("====>0400startAbility success====>");
console.debug("====>0400startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0400===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0400CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
}))
}))
})
})
...
@@ -332,36 +330,36 @@ export default function abilityTest() {
...
@@ -332,36 +330,36 @@ export default function abilityTest() {
onWindowStageCreate: onWindowStageCreate
onWindowStageCreate: onWindowStageCreate
}, (async (err) => {
}, (async (err) => {
console.debug("====>ACTS_AddAbilityMonitor_0500 success====>" + err.code);
console.debug("====>ACTS_AddAbilityMonitor_0500 success====>" + err.code);
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0500===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0500CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBacke===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
console.debug("====>0500startAbility success====>");
console.debug("====>0500startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0500===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0500CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBacke===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
}))
}))
})
})
...
@@ -396,36 +394,36 @@ export default function abilityTest() {
...
@@ -396,36 +394,36 @@ export default function abilityTest() {
onWindowStageDestroy: onWindowStageDestroy
onWindowStageDestroy: onWindowStageDestroy
}, (async (err) => {
}, (async (err) => {
console.debug("====>ACTS_AddAbilityMonitor_0600 success====>" + err.code);
console.debug("====>ACTS_AddAbilityMonitor_0600 success====>" + err.code);
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0600===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0600CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBackf===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility4'
abilityName: 'MainAbility4'
}).then(async () => {
}).then(async () => {
console.debug("====>0600startAbility success====>");
console.debug("====>0600startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0600===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0600CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBackf===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
}))
}))
})
})
...
@@ -468,36 +466,36 @@ export default function abilityTest() {
...
@@ -468,36 +466,36 @@ export default function abilityTest() {
onAbilityCreate: onAbilityCreate
onAbilityCreate: onAbilityCreate
}, (async (err) => {
}, (async (err) => {
console.debug("====>ACTS_AddAbilityMonitor_0700 addAbilityMonitorsec====>" + err.code);
console.debug("====>ACTS_AddAbilityMonitor_0700 addAbilityMonitorsec====>" + err.code);
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0700===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0700CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBacka===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
console.debug("====>0700startAbility success====>");
console.debug("====>0700startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0700===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0700CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBacka===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
}))
}))
}))
}))
...
@@ -533,36 +531,36 @@ export default function abilityTest() {
...
@@ -533,36 +531,36 @@ export default function abilityTest() {
onAbilityCreate: onAbilityCreatePromise
onAbilityCreate: onAbilityCreatePromise
}).then(() => {
}).then(() => {
console.debug("====>ACTS_AddAbilityMonitor_0800 success====>");
console.debug("====>ACTS_AddAbilityMonitor_0800 success====>");
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0800===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0800CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
globalThis.abilitydelegator.startAbility(
globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
console.debug("====>0800startAbility success====>");
console.debug("====>0800startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0800===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0800CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
})
})
...
@@ -597,36 +595,36 @@ export default function abilityTest() {
...
@@ -597,36 +595,36 @@ export default function abilityTest() {
onAbilityForeground: onAbilityForegroundPromise
onAbilityForeground: onAbilityForegroundPromise
}).then(async () => {
}).then(async () => {
console.debug("====>ACTS_AddAbilityMonitor_0900 success====>");
console.debug("====>ACTS_AddAbilityMonitor_0900 success====>");
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0900===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0900CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
console.debug("====>0900startAbility success====>");
console.debug("====>0900startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_0900===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_0900CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
})
})
...
@@ -751,36 +749,36 @@ export default function abilityTest() {
...
@@ -751,36 +749,36 @@ export default function abilityTest() {
onAbilityDestroy: onAbilityDestroyPromise
onAbilityDestroy: onAbilityDestroyPromise
}).then(async () => {
}).then(async () => {
console.debug("====>ACTS_AddAbilityMonitor_1100 success====>");
console.debug("====>ACTS_AddAbilityMonitor_1100 success====>");
await globalThis.abilitydelegator.startAbility(
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
{
console.info("===ACTS_AddAbilityMonitor_1100===createSubscriber"
bundleName: 'com.example.abilitymonitortest',
+ JSON.stringify(data));
abilityName: 'MainAbility4'
var AddAbility = data
}).then(async () => {
Subscriber.subscribe(data, (err, data) => {
console.debug("====>1100startAbility success====>");
console.log('===ACTS_AddAbilityMonitor_1100CallBack==='
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
+ err.code + JSON.stringify(data))
console.info("===ACTS_AddAbilityMonitor_1100===createSubscriber"
Subscriber.unsubscribe(AddAbility, (err, data) => {
+ JSON.stringify(data));
console.log('===UnSubscribeCallBack===' + err.code)
var AddAbility = data
await Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_1100CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
{
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility4'
}).then(async () => {
console.debug("====>1100startAbility success====>");
})
})
})
})
})
})
...
@@ -815,36 +813,36 @@ export default function abilityTest() {
...
@@ -815,36 +813,36 @@ export default function abilityTest() {
onWindowStageCreate: onWindowStageCreatePromise
onWindowStageCreate: onWindowStageCreatePromise
}).then(async () => {
}).then(async () => {
console.debug("====>ACTS_AddAbilityMonitor_1200 success====>");
console.debug("====>ACTS_AddAbilityMonitor_1200 success====>");
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_1200===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_1200CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
console.debug("====>1200startAbility success====>");
console.debug("====>1200startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_1200===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_1200CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
})
})
...
@@ -879,36 +877,36 @@ export default function abilityTest() {
...
@@ -879,36 +877,36 @@ export default function abilityTest() {
onWindowStageDestroy: onWindowStageDestroyPromsie
onWindowStageDestroy: onWindowStageDestroyPromsie
}).then(async () => {
}).then(async () => {
console.debug("====>ACTS_AddAbilityMonitor_1300 success====>");
console.debug("====>ACTS_AddAbilityMonitor_1300 success====>");
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_1300===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_1300CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility4'
abilityName: 'MainAbility4'
}).then(async () => {
}).then(async () => {
console.debug("====>1300startAbility success====>");
console.debug("====>1300startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_1300===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(data, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_1300CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
})
})
...
@@ -948,36 +946,36 @@ export default function abilityTest() {
...
@@ -948,36 +946,36 @@ export default function abilityTest() {
abilityName: 'MainAbility2',
abilityName: 'MainAbility2',
onAbilityCreate: onAbilityCreate
onAbilityCreate: onAbilityCreate
}).then(async () => {
}).then(async () => {
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_1400===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_1400CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
console.debug("====>1400startAbility success====>");
console.debug("====>1400startAbility success====>");
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_AddAbilityMonitor_1400===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_AddAbilityMonitor_1400CallBack==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, (err, data) => {
console.log('===UnSubscribeCallBack===' + err.code)
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
})
})
...
@@ -1600,33 +1598,34 @@ export default function abilityTest() {
...
@@ -1600,33 +1598,34 @@ export default function abilityTest() {
expect(err.code).assertEqual(0)
expect(err.code).assertEqual(0)
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0100 success====>");
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0100 success====>");
})
})
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_WaitAbilityMonitor_Callback_0100===createSubscriber" + JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Callback_0100===' + err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0100 startAbility success====>");
console.info("===ACTS_WaitAbilityMonitor_Callback_0100===createSubscriber" + JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Callback_0100===' + err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
...
@@ -1704,35 +1703,36 @@ export default function abilityTest() {
...
@@ -1704,35 +1703,36 @@ export default function abilityTest() {
expect(err.code).assertEqual(0)
expect(err.code).assertEqual(0)
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0300 success====>");
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0300 success====>");
})
})
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_WaitAbilityMonitor_Callback_0300===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Callback_0300==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0300 startAbility success====>");
console.info("===ACTS_WaitAbilityMonitor_Callback_0300===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Callback_0300==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
...
@@ -1810,35 +1810,36 @@ export default function abilityTest() {
...
@@ -1810,35 +1810,36 @@ export default function abilityTest() {
expect(err.code).assertEqual(0)
expect(err.code).assertEqual(0)
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0500 success====>");
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0500 success====>");
})
})
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_WaitAbilityMonitor_Callback_0500===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Callback_0500===' + err.code
+ JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBackU===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0500 startAbility success====>");
console.info("===ACTS_WaitAbilityMonitor_Callback_0500===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Callback_0500===' + err.code
+ JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBackU===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
...
@@ -1876,35 +1877,36 @@ export default function abilityTest() {
...
@@ -1876,35 +1877,36 @@ export default function abilityTest() {
expect(err.code).assertEqual(0)
expect(err.code).assertEqual(0)
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0600 success====>");
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0600 success====>");
})
})
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_WaitAbilityMonitor_Callback_0600===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Callback_0600==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBackU===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Callback_0600 startAbility success====>");
console.info("===ACTS_WaitAbilityMonitor_Callback_0600===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Callback_0600==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBackU===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
...
@@ -1939,35 +1941,36 @@ export default function abilityTest() {
...
@@ -1939,35 +1941,36 @@ export default function abilityTest() {
data.waitAbilityMonitor(monitor).then(async (data) => {
data.waitAbilityMonitor(monitor).then(async (data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0100 success====>");
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0100 success====>");
})
})
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_WaitAbilityMonitor_Promise_0100===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Promise_0100==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0100 startAbility success====>");
console.info("===ACTS_WaitAbilityMonitor_Promise_0100===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Promise_0100==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
...
@@ -2040,35 +2043,36 @@ export default function abilityTest() {
...
@@ -2040,35 +2043,36 @@ export default function abilityTest() {
data.waitAbilityMonitor(monitor, 1000).then(async (data) => {
data.waitAbilityMonitor(monitor, 1000).then(async (data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0300 success====>");
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0300 success====>");
})
})
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_WaitAbilityMonitor_Promise_0300===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Promise_0300==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBackM===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0300 startAbility success====>");
console.info("===ACTS_WaitAbilityMonitor_Promise_0300===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Promise_0300==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBackM===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
...
@@ -2142,35 +2146,36 @@ export default function abilityTest() {
...
@@ -2142,35 +2146,36 @@ export default function abilityTest() {
data.waitAbilityMonitor(monitor, 100).then(async (data) => {
data.waitAbilityMonitor(monitor, 100).then(async (data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0500 success====>");
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0500 success====>");
})
})
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_WaitAbilityMonitor_Promise_0500===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Promise_0500==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0500 startAbility success====>");
console.info("===ACTS_WaitAbilityMonitor_Promise_0500===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Promise_0500==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
...
@@ -2206,35 +2211,36 @@ export default function abilityTest() {
...
@@ -2206,35 +2211,36 @@ export default function abilityTest() {
data.waitAbilityMonitor(monitor, -1).then(async (data) => {
data.waitAbilityMonitor(monitor, -1).then(async (data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0600 success====>");
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0600 success====>");
})
})
Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.info("===ACTS_WaitAbilityMonitor_Promise_0600===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Promise_0600==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
await globalThis.abilitydelegator.startAbility(
await globalThis.abilitydelegator.startAbility(
{
{
bundleName: 'com.example.abilitymonitortest',
bundleName: 'com.example.abilitymonitortest',
abilityName: 'MainAbility2'
abilityName: 'MainAbility2'
}).then(async () => {
}).then(async () => {
await Subscriber.createSubscriber(commonEventSubscribeInfo, async (err, data) => {
console.debug("====>ACTS_WaitAbilityMonitor_Promise_0600 startAbility success====>");
console.info("===ACTS_WaitAbilityMonitor_Promise_0600===createSubscriber"
+ JSON.stringify(data));
var AddAbility = data
await Subscriber.subscribe(AddAbility, (err, data) => {
console.log('===ACTS_WaitAbilityMonitor_Promise_0600==='
+ err.code + JSON.stringify(data))
Subscriber.unsubscribe(AddAbility, () => {
console.log('===UnSubscribeCallBack===')
})
if (data.code == 1) {
expect(data.code).assertEqual(1);
setTimeout(() => {
done();
}, 2500)
}
else {
expect().assertFail();
setTimeout(() => {
done();
}, 2500)
}
})
})
})
})
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录