Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
27d7a37a
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看板
提交
27d7a37a
编写于
8月 30, 2023
作者:
K
kirl75
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xts_获取当前ability增加延时
Signed-off-by:
N
kirl75
<
kirl.liu@huawei.com
>
上级
ecd0c185
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
8 addition
and
4 deletion
+8
-4
ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/test/Ability.test.ets
...bilitystageatest/entry/src/main/ets/test/Ability.test.ets
+2
-1
ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/test/Ability.test.ets
...bilitystagebtest/entry/src/main/ets/test/Ability.test.ets
+2
-1
ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts
...e/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts
+4
-2
未找到文件。
ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
27d7a37a
...
@@ -43,11 +43,12 @@ export default function abilityTest() {
...
@@ -43,11 +43,12 @@ export default function abilityTest() {
var
Subscriber
;
var
Subscriber
;
var
AbilityDelegator
=
abilityDelegatorRegistry
.
getAbilityDelegator
();
var
AbilityDelegator
=
abilityDelegatorRegistry
.
getAbilityDelegator
();
function
SubscribeCallBack
(
err
,
data
)
{
async
function
SubscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"ACTS_GetCurrentTopAbility_0100====>Subscribe CallBack data:====>"
console
.
debug
(
"ACTS_GetCurrentTopAbility_0100====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
==
'GetCurrentTopAbilityB'
)
.
assertTrue
();
expect
(
data
.
event
==
'GetCurrentTopAbilityB'
)
.
assertTrue
();
if
(
data
.
event
==
'GetCurrentTopAbilityB'
)
{
if
(
data
.
event
==
'GetCurrentTopAbilityB'
)
{
await
sleep
(
1000
);
AbilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
AbilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
console
.
log
(
"ACTS_GetCurrentTopAbility_0100 and"
);
console
.
log
(
"ACTS_GetCurrentTopAbility_0100 and"
);
console
.
debug
(
"====>thisTopAbility_0100====>"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"====>thisTopAbility_0100====>"
+
JSON
.
stringify
(
data
));
...
...
ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
27d7a37a
...
@@ -45,10 +45,11 @@ export default function abilityTest() {
...
@@ -45,10 +45,11 @@ export default function abilityTest() {
var
Subscriber
;
var
Subscriber
;
var
AbilityDelegator
=
await
abilityDelegatorRegistry
.
getAbilityDelegator
();
var
AbilityDelegator
=
await
abilityDelegatorRegistry
.
getAbilityDelegator
();
function SubscribeCallBack(err, data) {
async
function
SubscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"ACTS_GetCurrentTopAbility_0200====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"ACTS_GetCurrentTopAbility_0200====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
expect
(
data
.
event
==
'GetCurrentTopAbility'
)
.
assertTrue
();
expect
(
data
.
event
==
'GetCurrentTopAbility'
)
.
assertTrue
();
if
(
data
.
event
==
'GetCurrentTopAbility'
)
{
if
(
data
.
event
==
'GetCurrentTopAbility'
)
{
await
sleep
(
1000
);
AbilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
AbilityDelegator
.
getCurrentTopAbility
((
err
,
data
)
=>
{
console
.
debug
(
"====>thisTopAbility====>"
+
JSON
.
stringify
(
data
.
lastRequestWant
))
console
.
debug
(
"====>thisTopAbility====>"
+
JSON
.
stringify
(
data
.
lastRequestWant
))
console
.
debug
(
"====>start startAbility====>"
);
console
.
debug
(
"====>start startAbility====>"
);
...
...
ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts
浏览文件 @
27d7a37a
...
@@ -44,12 +44,14 @@ export default class MainAbility3 extends Ability {
...
@@ -44,12 +44,14 @@ export default class MainAbility3 extends Ability {
onForeground
()
{
onForeground
()
{
// Ability has brought to foreground
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility3 onForeground
"
)
console
.
log
(
"
[Demo] MainAbility3 onForeground
"
);
setTimeout
(()
=>
{
globalThis
.
abilitydelegator
.
getCurrentTopAbility
().
then
((
data
)
=>
{
globalThis
.
abilitydelegator
.
getCurrentTopAbility
().
then
((
data
)
=>
{
globalThis
.
ability3
=
data
globalThis
.
ability3
=
data
console
.
debug
(
"
====>MainAbility getCurrentTopAbility:====>
"
+
JSON
.
stringify
(
globalThis
.
ability3
));
console
.
debug
(
"
====>MainAbility getCurrentTopAbility:====>
"
+
JSON
.
stringify
(
globalThis
.
ability3
));
commonEvent
.
publish
(
"
ACTS_DoAbility_Event
"
,
PublishCallBackOne
);
commonEvent
.
publish
(
"
ACTS_DoAbility_Event
"
,
PublishCallBackOne
);
})
})
},
1000
);
}
}
onBackground
()
{
onBackground
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录