Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
55cbb404
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,发现更多精彩内容 >>
提交
55cbb404
编写于
11月 16, 2022
作者:
X
xinxin13
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix actswindowstagelifecyclesinglehaptest
Signed-off-by:
N
xinxin13
<
xinxin13@huawei.com
>
上级
8d0569bb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
21 deletion
+23
-21
ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts
...lehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts
+1
-1
ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
...lesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
+22
-20
未找到文件。
ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts
浏览文件 @
55cbb404
...
...
@@ -46,7 +46,7 @@ export default class MainAbility5 extends Ability {
}).
catch
((
error
)
=>
{
console
.
error
(
'
[Demo] MainAbility5 terminateself failed. Cause:
'
+
error
);
})
},
5
00
);
},
10
00
);
}
onBackground
()
{
...
...
ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
浏览文件 @
55cbb404
...
...
@@ -410,22 +410,24 @@ export default function lifecycleTest() {
transferStr0 += globalThis.list1[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
expect(transferStr0.indexOf("MainAbility5 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageDestroy")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
",data: " + JSON.stringify(data));
console.log("------------Singlehap_WindowStageLifeCycleTest_0500 END-------------");
done();
})
setTimeout(()=>{
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
expect(transferStr0.indexOf("MainAbility5 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageDestroy")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
",data: " + JSON.stringify(data));
console.log("------------Singlehap_WindowStageLifeCycleTest_0500 END-------------");
done();
})
},1000)
}, 3800);
});
...
...
@@ -617,9 +619,9 @@ export default function lifecycleTest() {
it("Singlehap_WindowStageLifeCycleTest_0800", 0, async function (done) {
console.log("------------Singlehap_WindowStageLifeCycleTest_0800 START-------------");
TAG = "Singlehap_WindowStageLifeCycleTest_0800";
var
id1;
var
id2;
var
str = {
let
id1;
let
id2;
let
str = {
"bundleName": "com.example.windowstagelifecycle_xts",
"abilityName": "MainAbility6",
}
...
...
@@ -634,7 +636,7 @@ export default function lifecycleTest() {
console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid6));
id1 = globalThis.callbackid6;
console.log(TAG + " firstCallback id : " + JSON.stringify(id1));
var
str1 = {
let
str1 = {
"bundleName": "com.example.windowstagelifecycle_xts",
"abilityName": "MainAbility2",
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录