Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6eb000fc
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看板
提交
6eb000fc
编写于
9月 27, 2022
作者:
Z
zhoujun62
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
solve ActsNewWantTest#ACTS_NewWant_Test_0800 probabilistic failure problem
Signed-off-by:
N
zhoujun62
<
zhoujun62@huawei.com
>
上级
f508c78a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
30 deletion
+14
-30
ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
...coverhaptest/entry/src/main/ets/test/VerificationTest.ets
+2
-26
ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
...lyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
+10
-0
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
.../actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
+2
-4
未找到文件。
ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
浏览文件 @
6eb000fc
...
...
@@ -134,35 +134,26 @@ export default function verificationTest(){
try
{
let
list1
=
[]
let
list2
=
[
"Fa_Auxiliary_MainAbility4_onDestroy"
,
"Fa_Auxiliary_MainAbility5_onDestroy"
]
let
list2
=
[
"Fa_Auxiliary_MainAbility4_onDestroy"
]
let
number1
=
undefined
let
number2
=
undefined
let
number3
=
undefined
let
code1
=
536870912
let
code2
=
2048
let
subscriber
=
null
let
subscribeInfo
=
{
events
:
[
"Fa_Auxiliary_MainAbility4_onCreate"
,
"Fa_Auxiliary_MainAbility4_onDestroy"
,
"Fa_Auxiliary_MainAbility5_onCreate"
,
"Fa_Auxiliary_MainAbility5_onDestroy"
]
events
:
[
"Fa_Auxiliary_MainAbility4_onCreate"
,
"Fa_Auxiliary_MainAbility4_onDestroy"
]
}
function
SubscribeInfoCallback
(
err
,
data
)
{
console
.
info
(
TAG
+
"===SubscribeInfoCallback==="
+
JSON
.
stringify
(
data
))
if
(
data
.
event
==
"Fa_Auxiliary_MainAbility4_onCreate"
)
{
number1
=
data
.
parameters
.
flags
}
if
(
data
.
event
==
"Fa_Auxiliary_MainAbility5_onCreate"
)
{
number2
=
data
.
parameters
.
flags
}
if
(
data
.
event
==
"Fa_Auxiliary_MainAbility4_onDestroy"
)
{
list1
[
0
]
=
"Fa_Auxiliary_MainAbility4_onDestroy"
}
if
(
data
.
event
==
"Fa_Auxiliary_MainAbility5_onDestroy"
)
{
list1
[
1
]
=
"Fa_Auxiliary_MainAbility5_onDestroy"
}
if
(
JSON
.
stringify
(
list1
)
==
JSON
.
stringify
(
list2
))
{
expect
(
number3
)
.
assertEqual
(
1
);
expect
(
number1
)
.
assertEqual
(
code1
);
expect
(
number2
)
.
assertEqual
(
code2
);
commonEvent
.
unsubscribe
(
subscriber
,
UnSubscribeInfoCallback
)
}
}
...
...
@@ -204,21 +195,6 @@ export default function verificationTest(){
expect
()
.
assertFail
();
done
();
});
let
wantNum3
=
{
want
:
{
bundleName
:
'ohos.acts.aafwk.test.faauxiliary'
,
abilityName
:
'ohos.acts.aafwk.test.faauxiliary.MainAbility5'
,
flags
:
wantConstant
.
Flags
.
FLAG_INSTALL_ON_DEMAND
}
}
await
ability_featureAbility
.
startAbility
(
wantNum3
)
.
then
((
data
)
=>
{
console
.
info
(
TAG
+
"startAbility data = "
+
JSON
.
stringify
(
data
));
})
.
catch
((
err
)
=>
{
console
.
info
(
TAG
+
"startAbility err = "
+
JSON
.
stringify
(
err
));
expect
()
.
assertFail
();
done
();
});
}
catch
(
err
)
{
console
.
info
(
TAG
+
"catch err = "
+
JSON
.
stringify
(
err
));
expect
()
.
assertFail
();
...
...
ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
浏览文件 @
6eb000fc
...
...
@@ -17,6 +17,15 @@ import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import
Want
from
'
@ohos.application.Want
'
;
import
rpc
from
"
@ohos.rpc
"
;
function
sleep
(
delay
)
{
let
start
=
new
Date
().
getTime
();
while
(
true
)
{
if
(
new
Date
().
getTime
()
-
start
>
delay
)
{
break
;
}
}
}
export
default
class
ServiceAbility
extends
ServiceExtension
{
onCreate
(
want
:
Want
)
{
globalThis
.
abilityWant
=
want
;
...
...
@@ -28,6 +37,7 @@ export default class ServiceAbility extends ServiceExtension {
}
onConnect
(
want
)
{
sleep
(
1000
)
var
connId
;
console
.
log
(
'
ACTS_NewWant ServiceAbility onConnect, want:
'
+
want
.
abilityName
);
globalThis
.
extensionContext
=
this
.
context
...
...
ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
6eb000fc
...
...
@@ -593,10 +593,8 @@ export default function abilityTest() {
console.debug("ACTS_NewWant_Test_0800====>flagOnNewWant:====>"
+ flagOnNewWant)
if ((flagOnCreate == 0 && flagOnWindowStageCreate == 0
&& flagOnForeground == 2 && flagOnNewWant == 1)
|| (flagOnCreate == 1 && flagOnWindowStageCreate == 1
&& flagOnForeground == 2 && flagOnNewWant == 0)) {
if (flagOnCreate == 0 && flagOnWindowStageCreate == 0
&& flagOnForeground == 2 && flagOnNewWant == 1) {
flagNewWant = true;
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录