Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
eddf73fd
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看板
未验证
提交
eddf73fd
编写于
7月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4485 补充增加的ExtensionAbilityType字段
Merge pull request !4485 from junyi233/myfeature
上级
d23bc7ac
3f683962
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
142 addition
and
5 deletion
+142
-5
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
...try/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
+116
-5
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/module.json
...r/sceneProject/bmsstagedemoone/entry/src/main/module.json
+26
-0
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
浏览文件 @
eddf73fd
...
...
@@ -24,6 +24,9 @@ const ABILITY_NAME1 = "ExtensionAbility1";
const ABILITY_NAME2 = "noexitAbility";
const ABILITY_NAME3 = "ServiceAbility";
const ABILITY_NAME4 = "EnterpriseAdminAbility";
const ABILITY_NAME5 = "ThumbnailAbility";
const ABILITY_NAME6 = "PreviewAbility";
const Finger_Print = "8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5";
let userId = 0;
export default function QueryExtensionAbilityInfos() {
...
...
@@ -776,6 +779,110 @@ export default function QueryExtensionAbilityInfos() {
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0018
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos get thumbnail extensionAbility
*/
it('SUB_BMS_APPINFO_EXTENSION_0018', 0, async function (done) {
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME5
}, bundle.ExtensionAbilityType.THUMBNAIL, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT,
userId).then(data => {
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual(ABILITY_NAME5);
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.THUMBNAIL);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
}).catch(err => {
expect(err).assertFail();
});
bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME5
}, bundle.ExtensionAbilityType.THUMBNAIL, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT,
userId, (err, data) => {
expect(err).assertEqual(0);
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual(ABILITY_NAME5);
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.THUMBNAIL);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0019
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos get preview extensionAbility
*/
it('SUB_BMS_APPINFO_EXTENSION_0019', 0, async function (done) {
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME6
}, bundle.ExtensionAbilityType.PREVIEW, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT,
userId).then(data => {
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual(ABILITY_NAME6);
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.PREVIEW);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
}).catch(err => {
expect(err).assertFail();
});
bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME6
}, bundle.ExtensionAbilityType.PREVIEW, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT,
userId, (err, data) => {
expect(err).assertEqual(0);
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual(ABILITY_NAME6);
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.PREVIEW);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0020
* @tc.name: test getBundleInfo api
...
...
@@ -783,7 +890,7 @@ export default function QueryExtensionAbilityInfos() {
*/
it('SUB_BMS_APPINFO_EXTENSION_0020', 0, async function (done) {
await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_EXTENSION_ABILITY).then(data => {
expect(data.extensionAbilityInfo.length).assertEqual(
8
);
expect(data.extensionAbilityInfo.length).assertEqual(
10
);
expect(data.extensionAbilityInfo[0].name).assertEqual("ExtensionAbilityA");
expect(data.extensionAbilityInfo[1].name).assertEqual("ExtensionAbilityB");
expect(data.extensionAbilityInfo[2].name).assertEqual("ExtensionAbilityQ");
...
...
@@ -791,7 +898,9 @@ export default function QueryExtensionAbilityInfos() {
expect(data.extensionAbilityInfo[4].name).assertEqual("EnterpriseAdminAbility");
expect(data.extensionAbilityInfo[5].name).assertEqual("ExtensionAbility1");
expect(data.extensionAbilityInfo[6].name).assertEqual("FormAbility");
expect(data.extensionAbilityInfo[7].name).assertEqual("ServiceAbility");
expect(data.extensionAbilityInfo[7].name).assertEqual("PreviewAbility");
expect(data.extensionAbilityInfo[8].name).assertEqual("ServiceAbility");
expect(data.extensionAbilityInfo[9].name).assertEqual("ThumbnailAbility");
}).catch(err => {
expect(err).assertFail();
});
...
...
@@ -801,7 +910,7 @@ export default function QueryExtensionAbilityInfos() {
done();
return;
}
expect(data.extensionAbilityInfo.length).assertEqual(
8
);
expect(data.extensionAbilityInfo.length).assertEqual(
10
);
expect(data.extensionAbilityInfo[0].name).assertEqual("ExtensionAbilityA");
expect(data.extensionAbilityInfo[1].name).assertEqual("ExtensionAbilityB");
expect(data.extensionAbilityInfo[2].name).assertEqual("ExtensionAbilityQ");
...
...
@@ -809,7 +918,9 @@ export default function QueryExtensionAbilityInfos() {
expect(data.extensionAbilityInfo[4].name).assertEqual("EnterpriseAdminAbility");
expect(data.extensionAbilityInfo[5].name).assertEqual("ExtensionAbility1");
expect(data.extensionAbilityInfo[6].name).assertEqual("FormAbility");
expect(data.extensionAbilityInfo[7].name).assertEqual("ServiceAbility");
expect(data.extensionAbilityInfo[7].name).assertEqual("PreviewAbility");
expect(data.extensionAbilityInfo[8].name).assertEqual("ServiceAbility");
expect(data.extensionAbilityInfo[9].name).assertEqual("ThumbnailAbility");
done();
})
})
...
...
@@ -916,7 +1027,7 @@ export default function QueryExtensionAbilityInfos() {
expect(data[0].applicationInfo.uid).assertLarger(0);
expect(data[0].applicationInfo.entityType).assertEqual("unspecified");
expect(data[0].applicationInfo.removable).assertTrue();
expect(data[0].applicationInfo.fingerprint).assertEqual(
""
);
expect(data[0].applicationInfo.fingerprint).assertEqual(
Finger_Print
);
}
})
...
...
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/module.json
浏览文件 @
eddf73fd
...
...
@@ -232,6 +232,32 @@
"resource"
:
"$profile:form_config"
}
]
},
{
"name"
:
"ThumbnailAbility"
,
"srcEntrance"
:
"./ets/ServiceAbility/FormAbility.ts"
,
"label"
:
"$string:form_FormAbility_label"
,
"description"
:
"$string:form_FormAbility_desc"
,
"type"
:
"thumbnail"
,
"metadata"
:
[
{
"name"
:
"ohos.extension.form"
,
"resource"
:
"$profile:form_config"
}
]
},
{
"name"
:
"PreviewAbility"
,
"srcEntrance"
:
"./ets/ServiceAbility/FormAbility.ts"
,
"label"
:
"$string:form_FormAbility_label"
,
"description"
:
"$string:form_FormAbility_desc"
,
"type"
:
"preview"
,
"metadata"
:
[
{
"name"
:
"ohos.extension.form"
,
"resource"
:
"$profile:form_config"
}
]
}
]
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录