Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
34b3168e
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
34b3168e
编写于
8月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5232 XTS-abilityStageMonitor测试套失败用例适配
Merge pull request !5232 from chengxingzhen/master
上级
f7c8fef8
736c6d9a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
6 deletion
+24
-6
ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/Test.json
...ime/abilitystagemonitor/abilitystagemonitortest/Test.json
+1
-1
ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/AbilityStageMonitor.test.ets
...test/entry/src/main/ets/test/AbilityStageMonitor.test.ets
+23
-5
未找到文件。
ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/Test.json
浏览文件 @
34b3168e
...
...
@@ -6,7 +6,7 @@
"bundle-name"
:
"com.example.abilitystagemonitortest"
,
"module-name"
:
"entry_test"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
"
7
000"
"testcase-timeout"
:
"
15
000"
},
"kits"
:
[
{
...
...
ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/AbilityStageMonitor.test.ets
浏览文件 @
34b3168e
...
...
@@ -21,6 +21,8 @@ let moduleName1: any
let monitor: any
let want: any
let timeout = 3000;
let addMonitor = false;
let removeMonitor = false;
function sleep(delay) {
let start = (new Date()).getTime();
...
...
@@ -194,7 +196,7 @@ export default function abilityStageMonitorTest() {
console.info("SUB_AA_AbilityStageMonitor_0400 wait abilityStage");
a
wait a
bilityDelegator.waitAbilityStageMonitor(monitor, timeout).then((abilityStage) => {
abilityDelegator.waitAbilityStageMonitor(monitor, timeout).then((abilityStage) => {
moduleName1 = abilityStage.context.currentHapModuleInfo.name;
console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " +
JSON.stringify(abilityStage));
...
...
@@ -329,6 +331,8 @@ export default function abilityStageMonitorTest() {
it('SUB_AA_AbilityStageMonitor_0700', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0700 begin")
addMonitor = false;
removeMonitor = false;
monitor = {
moduleName: "feature_assisth",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
...
...
@@ -338,6 +342,7 @@ export default function abilityStageMonitorTest() {
await abilityDelegator.addAbilityStageMonitor(monitor).then((data) => {
console.info("stageMonitor addAbilityStageMonitor promise, data = " + data);
addMonitor = true;
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0700 addAbilityStageMonitor err: " + JSON.stringify(err));
expect().assertFail()
...
...
@@ -349,18 +354,21 @@ export default function abilityStageMonitorTest() {
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0600 waitAbilityStageMonitor err: " + JSON.stringify(err));
expect(err.code).assertEqual(-1)
done()
})
console.info("SUB_AA_AbilityStageMonitor_0700 removeAbilityStageMonitor");
await abilityDelegator.removeAbilityStageMonitor(monitor).then((data) => {
console.info("stageMonitor addAbilityStageMonitor promise, data = " + data);
removeMonitor = true;
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0700 removeAbilityStageMonitor err: " + JSON.stringify(err));
expect().assertFail()
done()
});
expect(addMonitor).assertTrue();
expect(removeMonitor).assertTrue();
done()
})
/**
...
...
@@ -374,6 +382,8 @@ export default function abilityStageMonitorTest() {
it('SUB_AA_AbilityStageMonitor_0800', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0800 begin")
addMonitor = false;
removeMonitor = false;
monitor = {
moduleName: "feature_assisti",
srcEntrance: "./ets/Application/AbilityStage.ts",
...
...
@@ -385,6 +395,7 @@ export default function abilityStageMonitorTest() {
abilityDelegator.addAbilityStageMonitor(monitor, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0800 addAbilityStageMonitor callback, data = " + data +
"err: " + err);
addMonitor = true;
})
} catch (error) {
console.log("SUB_AA_AbilityStageMonitor_0800 addAbilityStageMonitor callback err: " + error);
...
...
@@ -397,7 +408,6 @@ export default function abilityStageMonitorTest() {
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0600 waitAbilityStageMonitor err: " + JSON.stringify(err));
expect(err.code).assertEqual(-1)
done()
})
try {
...
...
@@ -405,12 +415,20 @@ export default function abilityStageMonitorTest() {
abilityDelegator.removeAbilityStageMonitor(monitor, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0800 removeAbilityStageMonitor callback, data = " +
data + "err: " + err);
removeMonitor = true;
})
} catch (error) {
console.log("SUB_AA_AbilityStageMonitor_0800 removeAbilityStageMonitor callback err: " + error);
expect().assertFail()
done()
}
setTimeout(() => {
expect(addMonitor).assertTrue()
expect(removeMonitor).assertTrue()
done()
}, 3000);
})
/**
...
...
@@ -474,8 +492,8 @@ export default function abilityStageMonitorTest() {
it('SUB_AA_AbilityStageMonitor_1000', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_1000 begin")
let
addMonitor = false;
let removeMonitor = tru
e;
addMonitor = false;
removeMonitor = fals
e;
monitor = {
moduleName: "feature_assa",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录