Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
dc33f114
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,发现更多精彩内容 >>
提交
dc33f114
编写于
6月 20, 2022
作者:
I
inter515
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改代码长度
Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
dd61eca2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
48 addition
and
45 deletion
+48
-45
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+48
-45
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
dc33f114
...
@@ -106,7 +106,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -106,7 +106,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfo interfaces with one hap.
* @tc.desc Test getBundleInfo interfaces with one hap.
*/
*/
it
(
'
getBundleInfo_0600
'
,
0
,
async
function
(
done
)
{
it
(
'
getBundleInfo_0600
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
|
demo
.
BundleFlag
.
GET_ABILITY_INFO_WITH_DISABLE
,
OnReceiveEvent
);
await
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
|
demo
.
BundleFlag
.
GET_ABILITY_INFO_WITH_DISABLE
,
OnReceiveEvent
);
function
OnReceiveEvent
(
err
,
datainfo
)
{
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
info
(
"
getBundleInfo_0600 dataInfo ====
"
+
datainfo
);
console
.
info
(
"
getBundleInfo_0600 dataInfo ====
"
+
datainfo
);
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
);
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
);
...
@@ -233,7 +234,6 @@ describe('ActsBundleManagerTest', function () {
...
@@ -233,7 +234,6 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
[
i
].
moduleInfos
[
j
].
moduleSourceDir
.
length
).
assertLarger
(
0
);
expect
(
datainfo
[
i
].
moduleInfos
[
j
].
moduleSourceDir
.
length
).
assertLarger
(
0
);
}
}
}
}
}
}
/**
/**
...
@@ -1103,55 +1103,58 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1103,55 +1103,58 @@ describe('ActsBundleManagerTest', function () {
await
demo
.
queryAbilityByWant
({
await
demo
.
queryAbilityByWant
({
entities
:
[
'
entity.system.home
'
,
'
entitiesentities
'
]
entities
:
[
'
entity.system.home
'
,
'
entitiesentities
'
]
},
4
,
userId
).
then
(
data
=>
{
},
4
,
userId
).
then
(
data
=>
{
let
queryResultCount
=
0
;
checkAbilityInfos
(
data
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
let
datainfo
=
data
[
i
];
if
(
datainfo
.
bundleName
==
NAME3
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
);
expect
(
datainfo
.
description
).
assertEqual
(
DESCRIPTION
);
expect
(
datainfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME3
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
PAGE
);
expect
(
datainfo
.
applicationInfo
.
name
).
assertEqual
(
NAME3
);
expect
(
datainfo
.
applicationInfo
.
description
).
assertEqual
(
DESCRIPTION
);
expect
(
datainfo
.
applicationInfo
.
descriptionId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
);
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
true
);
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
PORTRAIT
);
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
);
for
(
let
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
.
length
;
j
++
)
{
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
);
}
queryResultCount
++
;
}
if
(
datainfo
.
bundleName
==
NAME4
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
DATA
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME4
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
FOLLOW_RECENT
);
queryResultCount
++
;
}
if
(
datainfo
.
bundleName
==
NAME5
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
PAGE
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME5
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
UNSPECIFIED
);
queryResultCount
++
;
}
}
expect
(
queryResultCount
).
assertEqual
(
3
);
done
();
done
();
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
done
();
done
();
})
})
})
})
function
checkAbilityInfos
(
data
)
{
let
queryResultCount
=
0
;
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
let
datainfo
=
data
[
i
];
if
(
datainfo
.
bundleName
==
NAME3
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
);
expect
(
datainfo
.
description
).
assertEqual
(
DESCRIPTION
);
expect
(
datainfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME3
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
PAGE
);
expect
(
datainfo
.
applicationInfo
.
name
).
assertEqual
(
NAME3
);
expect
(
datainfo
.
applicationInfo
.
description
).
assertEqual
(
DESCRIPTION
);
expect
(
datainfo
.
applicationInfo
.
descriptionId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
);
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
();
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
true
);
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
PORTRAIT
);
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
);
for
(
let
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
.
length
;
j
++
)
{
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
);
}
queryResultCount
++
;
}
if
(
datainfo
.
bundleName
==
NAME4
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
DATA
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME4
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
FOLLOW_RECENT
);
queryResultCount
++
;
}
if
(
datainfo
.
bundleName
==
NAME5
)
{
expect
(
datainfo
.
name
).
assertEqual
(
"
com.example.myapplication.MainAbility
"
);
expect
(
datainfo
.
type
).
assertEqual
(
demo
.
AbilityType
.
PAGE
);
expect
(
datainfo
.
bundleName
).
assertEqual
(
NAME5
);
expect
(
datainfo
.
orientation
).
assertEqual
(
demo
.
DisplayOrientation
.
UNSPECIFIED
);
queryResultCount
++
;
}
}
expect
(
queryResultCount
).
assertEqual
(
3
);
}
/**
/**
* @tc.number queryAbilityByWant_0400
* @tc.number queryAbilityByWant_0400
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录