Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cd6afaca
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看板
提交
cd6afaca
编写于
3月 31, 2022
作者:
I
inter515
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码规范修改-移除getBundleArchiveInfo接口
Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
4bbc855c
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
83 addition
and
542 deletion
+83
-542
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
.../entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
+83
-43
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+0
-499
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
浏览文件 @
cd6afaca
...
...
@@ -38,17 +38,25 @@ describe('ActsBmsQueryAbilityByWant', function () {
it
(
'
bms_queryAbilityByWant_0100
'
,
0
,
async
function
(
done
)
{
await
bundle
.
getBundleInstaller
().
then
(
installer
=>
{
installer
.
install
(
BUNDLE_PATH1
,
installParam
,
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
async
function
onReceiveinstallEvent
(
err
,
data
)
{
checkInstallOrUninstall
(
err
,
data
);
await
bundle
.
queryAbilityByWant
({
action
:
[
'
action.system.home
'
],
entities
:
[
'
entity.system.home
'
],
bundleName
:
BUNDLE_NAME1
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
USERID
).
then
(
data
=>
{
expect
(
data
).
assertEqual
(
"
QueryAbilityInfos failed
"
);
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
bundle
.
queryAbilityByWant
({
action
:
[
'
action.system.home
'
],
entities
:
[
'
entity.system.home
'
],
bundleName
:
BUNDLE_NAME1
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
USERID
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
err
).
assertEqual
(
1
);
}
expect
(
err
).
assertEqual
(
1
);
expect
(
data
).
assertEqual
(
"
QueryAbilityInfos failed
"
);
installer
.
uninstall
(
BUNDLE_NAME1
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
done
();
...
...
@@ -72,13 +80,28 @@ describe('ActsBmsQueryAbilityByWant', function () {
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
USERID
).
then
(
data
=>
{
expect
(
data
.
length
).
assertLarger
(
0
);
for
(
let
i
=
0
;
i
<
data
.
length
;
++
i
)
{
expect
(
data
[
i
].
applicationInfo
.
systemApp
).
assertEqual
(
true
);
}
done
();
}
).
catch
(
err
=>
{
expect
(
err
).
assertFail
();
});
bundle
.
queryAbilityByWant
(
{
action
:
[
'
action.system.home
'
],
entities
:
[
'
entity.system.home
'
]
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
USERID
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
err
).
assertFail
();
}
expect
(
data
.
length
).
assertLarger
(
0
);
for
(
let
i
=
0
;
i
<
data
.
length
;
++
i
)
{
expect
(
data
[
i
].
applicationInfo
.
systemApp
).
assertEqual
(
true
);
}
done
();
});
});
...
...
@@ -109,45 +132,28 @@ describe('ActsBmsQueryAbilityByWant', function () {
abilityName
:
''
,
},
},
bundle
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
USERID
);
for
(
let
i
=
0
;
i
<
dataInfos
.
length
;
i
++
){
console
.
info
(
'
dataInfos=============
'
+
i
);
for
(
const
item
in
dataInfos
[
0
])
{
const
a
=
dataInfos
[
0
][
item
];
console
.
info
(
item
+
"
:
"
+
JSON
.
stringify
(
a
));
};
};
expect
(
dataInfos
.
length
).
assertEqual
(
1
);
expect
(
dataInfos
[
0
].
name
).
assertEqual
(
ABILITIY_NAME8
);
expect
(
dataInfos
[
0
].
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
dataInfos
[
0
].
description
).
assertEqual
(
'
$string:mainability_description
'
);
expect
(
dataInfos
[
0
].
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
dataInfos
[
0
].
srcPath
).
assertEqual
(
""
);
expect
(
dataInfos
[
0
].
srcLanguage
).
assertEqual
(
"
js
"
);
expect
(
dataInfos
[
0
].
isVisible
).
assertEqual
(
false
);
expect
(
dataInfos
[
0
].
permissions
.
length
).
assertEqual
(
0
);
expect
(
dataInfos
[
0
].
deviceCapabilities
.
length
).
assertEqual
(
0
);
expect
(
dataInfos
[
0
].
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
dataInfos
[
0
].
process
).
assertEqual
(
''
);
expect
(
dataInfos
[
0
].
uri
).
assertEqual
(
''
);
expect
(
dataInfos
[
0
].
bundleName
).
assertEqual
(
SYSTEM_NAME
);
expect
(
dataInfos
[
0
].
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
Object
.
keys
(
dataInfos
[
0
].
applicationInfo
).
length
).
assertLarger
(
0
);
expect
(
dataInfos
[
0
].
type
).
assertEqual
(
1
);
expect
(
dataInfos
[
0
].
orientation
).
assertEqual
(
0
);
expect
(
dataInfos
[
0
].
launchMode
).
assertEqual
(
1
);
expect
(
dataInfos
[
0
].
backgroundModes
).
assertEqual
(
0
);
expect
(
dataInfos
[
0
].
descriptionId
).
assertLarger
(
0
);
expect
(
dataInfos
[
0
].
formEnabled
).
assertEqual
(
false
);
expect
(
dataInfos
[
0
].
iconId
).
assertLarger
(
0
);
expect
(
dataInfos
[
0
].
labelId
).
assertLarger
(
0
);
expect
(
dataInfos
[
0
].
subType
).
assertEqual
(
0
);
expect
(
dataInfos
[
0
].
readPermission
).
assertEqual
(
""
);
expect
(
dataInfos
[
0
].
writePermission
).
assertEqual
(
""
);
expect
(
dataInfos
[
0
].
targetAbility
).
assertEqual
(
""
);
expect
(
dataInfos
[
0
].
theme
).
assertEqual
(
""
);
expect
(
dataInfos
[
0
].
metaData
.
length
).
assertEqual
(
0
);
expect
(
dataInfos
[
0
].
metadata
.
length
).
assertEqual
(
0
);
expect
(
dataInfos
[
0
].
enabled
).
assertEqual
(
true
);
cheackAbilityInfos
(
dataInfos
[
0
]);
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
"
entity.app.music
"
,
"
entity.app.email
"
,
"
entity.app.contacts
"
,
"
entity.app.maps
"
,
"
entity.app.browser
"
,
"
entity.app.calendar
"
,
"
entity.app.messaging
"
,
"
entity.app.files
"
,
"
entity.app.gallery
"
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
''
,
abilityName
:
''
,
},
},
bundle
.
BundleFlag
.
GET_BUNDLE_DEFAULT
,
USERID
,
(
err
,
data
)
=>
{
expect
(
data
.
length
).
assertEqual
(
1
);
cheackAbilityInfos
(
data
[
0
]);
});
installer
.
uninstall
(
SYSTEM_NAME
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
done
();
...
...
@@ -155,6 +161,40 @@ describe('ActsBmsQueryAbilityByWant', function () {
});
});
async
function
cheackAbilityInfos
(
data
)
{
expect
(
data
.
name
).
assertEqual
(
ABILITIY_NAME8
);
expect
(
data
.
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
data
.
description
).
assertEqual
(
'
$string:mainability_description
'
);
expect
(
data
.
icon
).
assertEqual
(
"
$media:icon
"
);
expect
(
data
.
srcPath
).
assertEqual
(
""
);
expect
(
data
.
srcLanguage
).
assertEqual
(
"
js
"
);
expect
(
data
.
isVisible
).
assertEqual
(
false
);
expect
(
data
.
permissions
.
length
).
assertEqual
(
0
);
expect
(
data
.
deviceCapabilities
.
length
).
assertEqual
(
0
);
expect
(
data
.
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
data
.
process
).
assertEqual
(
''
);
expect
(
data
.
uri
).
assertEqual
(
''
);
expect
(
data
.
bundleName
).
assertEqual
(
SYSTEM_NAME
);
expect
(
data
.
moduleName
).
assertEqual
(
"
entry
"
);
expect
(
Object
.
keys
(
data
.
applicationInfo
).
length
).
assertLarger
(
0
);
expect
(
data
.
type
).
assertEqual
(
1
);
expect
(
data
.
orientation
).
assertEqual
(
0
);
expect
(
data
.
launchMode
).
assertEqual
(
1
);
expect
(
data
.
backgroundModes
).
assertEqual
(
0
);
expect
(
data
.
descriptionId
).
assertLarger
(
0
);
expect
(
data
.
formEnabled
).
assertEqual
(
false
);
expect
(
data
.
iconId
).
assertLarger
(
0
);
expect
(
data
.
labelId
).
assertLarger
(
0
);
expect
(
data
.
subType
).
assertEqual
(
0
);
expect
(
data
.
readPermission
).
assertEqual
(
""
);
expect
(
data
.
writePermission
).
assertEqual
(
""
);
expect
(
data
.
targetAbility
).
assertEqual
(
""
);
expect
(
data
.
theme
).
assertEqual
(
""
);
expect
(
data
.
metaData
.
length
).
assertEqual
(
0
);
expect
(
data
.
metadata
.
length
).
assertEqual
(
0
);
expect
(
data
.
enabled
).
assertEqual
(
true
);
}
function
checkInstallOrUninstall
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
cd6afaca
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录