Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6ebc1469
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看板
未验证
提交
6ebc1469
编写于
8月 31, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 31, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9981 修复ActsOnAndOffScreenTest时序问题
Merge pull request !9981 from 于文泽/onOff
上级
37543b28
ffbdf0cc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
28 deletion
+29
-28
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
...ntest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
+10
-8
ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
...lesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
+19
-20
未找到文件。
ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
浏览文件 @
6ebc1469
...
@@ -441,7 +441,7 @@ export default function OnAndOffScreenTest() {
...
@@ -441,7 +441,7 @@ export default function OnAndOffScreenTest() {
let
flag
=
false
;
let
flag
=
false
;
let
status1
=
undefined
;
let
status1
=
undefined
;
let
life
List
=
[]
;
let
life
Set
=
new
Set
()
;
let
listCheck
=
[
"onCreate"
,
"onWindowStageCreate"
,
"onForeground"
,
"onBackground"
];
let
listCheck
=
[
"onCreate"
,
"onWindowStageCreate"
,
"onForeground"
,
"onBackground"
];
let
onCreate
=
"StageOnAndOffScreen_MainAbility2_onCreate"
;
let
onCreate
=
"StageOnAndOffScreen_MainAbility2_onCreate"
;
let
onWindowStageCreate
=
"StageOnAndOffScreen_MainAbility2_onWindowStageCreate"
;
let
onWindowStageCreate
=
"StageOnAndOffScreen_MainAbility2_onWindowStageCreate"
;
...
@@ -465,27 +465,27 @@ export default function OnAndOffScreenTest() {
...
@@ -465,27 +465,27 @@ export default function OnAndOffScreenTest() {
console
.
log
(
TAG
+
"SubscribeInfoCallback : "
+
JSON
.
stringify
(
data
));
console
.
log
(
TAG
+
"SubscribeInfoCallback : "
+
JSON
.
stringify
(
data
));
if
(
data
.
event
==
onCreate
)
{
if
(
data
.
event
==
onCreate
)
{
life
List
.
push
(
"onCreate"
);
life
Set
.
add
(
"onCreate"
);
}
}
if
(
data
.
event
==
onWindowStageCreate
)
{
if
(
data
.
event
==
onWindowStageCreate
)
{
life
List
.
push
(
"onWindowStageCreate"
);
life
Set
.
add
(
"onWindowStageCreate"
);
}
}
if
(
data
.
event
==
onForeground
)
{
if
(
data
.
event
==
onForeground
)
{
life
List
.
push
(
"onForeground"
);
life
Set
.
add
(
"onForeground"
);
}
}
if
(
data
.
event
==
onBackground
)
{
if
(
data
.
event
==
onBackground
)
{
life
List
.
push
(
"onBackground"
);
life
Set
.
add
(
"onBackground"
);
}
}
if
(
data
.
event
==
onWindowStageDestroy
)
{
if
(
data
.
event
==
onWindowStageDestroy
)
{
life
List
.
push
(
"onWindowStageDestroy"
);
life
Set
.
add
(
"onWindowStageDestroy"
);
}
}
if
(
data
.
event
==
onDestroy
)
{
if
(
data
.
event
==
onDestroy
)
{
life
List
.
push
(
"onDestroy"
);
life
Set
.
add
(
"onDestroy"
);
}
}
if
(
data
.
event
==
onForeground2
&&
!
flag
)
{
if
(
data
.
event
==
onForeground2
&&
!
flag
)
{
...
@@ -497,7 +497,9 @@ export default function OnAndOffScreenTest() {
...
@@ -497,7 +497,9 @@ export default function OnAndOffScreenTest() {
setTimeout
(
async
()
=>
{
setTimeout
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriber
,
async
(
err
,
data
)
=>
{
commonEvent
.
unsubscribe
(
subscriber
,
async
(
err
,
data
)
=>
{
console
.
log
(
TAG
+
"UnSubscribeInfoCallback : "
+
JSON
.
stringify
(
data
));
console
.
log
(
TAG
+
"UnSubscribeInfoCallback : "
+
JSON
.
stringify
(
data
));
expect
(
JSON
.
stringify
(
lifeList
))
.
assertEqual
(
JSON
.
stringify
(
listCheck
));
for
(
let
i
in
listCheck
)
{
expect
(
lifeSet
.
has
(
listCheck
[
i
]))
.
assertTrue
();
}
expect
(
status1
)
.
assertTrue
();
expect
(
status1
)
.
assertTrue
();
done
();
done
();
});
});
...
...
ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
浏览文件 @
6ebc1469
...
@@ -496,32 +496,31 @@ export default function lifecycleTest() {
...
@@ -496,32 +496,31 @@ export default function lifecycleTest() {
console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1));
console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1));
console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1));
console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1));
var strtemp = "";
var strtemp = "";
var listtemp = []
;
let settemp = new Set()
;
var listtemp2 = []
;
let settemp2 = new Set()
;
for (var i = 0; i < globalThis.list1.length; i++) {
for (var i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12);
strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp == "MainAbility2") {
if (strtemp == "MainAbility2") {
listtemp.push(globalThis.list1[i]);
settemp.add(globalThis.list1[i]);
console.log(TAG + " set1 is :" + JSON.stringify(globalThis.list1[i]));
} else if (strtemp == "MainAbility5") {
} else if (strtemp == "MainAbility5") {
listtemp2.push(globalThis.list1[i]);
settemp2.add(globalThis.list1[i]);
console.log(TAG + " set2 is :" + JSON.stringify(globalThis.list1[i]));
}
}
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
expect(settemp.has("MainAbility2 onAbilityCreate")).assertTrue();
console.log(TAG + " listtemp2 is :" + JSON.stringify(listtemp2));
expect(settemp.has("MainAbility2 onWindowStageCreate")).assertTrue();
let exlist = listtemp;
expect(settemp.has("MainAbility2 onAbilityForeground")).assertTrue();
let exlist2 = listtemp2;
expect(settemp.has("MainAbility2 onAbilityBackground")).assertTrue();
expect(exlist[0]).assertEqual("MainAbility2 onAbilityCreate");
expect(settemp.has("MainAbility2 onWindowStageDestroy")).assertTrue();
expect(exlist[1]).assertEqual("MainAbility2 onWindowStageCreate");
expect(settemp.has("MainAbility2 onAbilityDestroy")).assertTrue();
expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground");
expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground");
expect(settemp2.has("MainAbility5 onAbilityCreate")).assertTrue();
expect(exlist[4]).assertEqual("MainAbility2 onWindowStageDestroy");
expect(settemp2.has("MainAbility5 onWindowStageCreate")).assertTrue();
expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy");
expect(settemp2.has("MainAbility5 onAbilityForeground")).assertTrue();
expect(exlist2[0]).assertEqual("MainAbility5 onAbilityCreate");
expect(settemp2.has("MainAbility5 onAbilityBackground")).assertTrue();
expect(exlist2[1]).assertEqual("MainAbility5 onWindowStageCreate");
expect(settemp2.has("MainAbility5 onWindowStageDestroy")).assertTrue();
expect(exlist2[2]).assertEqual("MainAbility5 onAbilityForeground");
expect(settemp2.has("MainAbility5 onAbilityDestroy")).assertTrue();
expect(exlist2[3]).assertEqual("MainAbility5 onAbilityBackground");
expect(exlist2[4]).assertEqual("MainAbility5 onWindowStageDestroy");
expect(exlist2[5]).assertEqual("MainAbility5 onAbilityDestroy");
globalThis.applicationContext1
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录