Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8f75c281
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,发现更多精彩内容 >>
提交
8f75c281
编写于
7月 21, 2022
作者:
J
junyi233
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加enterpriseAdmin枚举测试用例
Signed-off-by:
N
junyi233
<
zhengjun29@huawei.com
>
上级
ccb353fe
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
80 addition
and
8 deletion
+80
-8
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
...try/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
+67
-8
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/module.json
...r/sceneProject/bmsstagedemoone/entry/src/main/module.json
+13
-0
未找到文件。
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
浏览文件 @
8f75c281
...
@@ -23,6 +23,7 @@ const BUNDLE_NAME3 = 'com.example.third1';
...
@@ -23,6 +23,7 @@ const BUNDLE_NAME3 = 'com.example.third1';
const ABILITY_NAME1 = "ExtensionAbility1";
const ABILITY_NAME1 = "ExtensionAbility1";
const ABILITY_NAME2 = "noexitAbility";
const ABILITY_NAME2 = "noexitAbility";
const ABILITY_NAME3 = "ServiceAbility";
const ABILITY_NAME3 = "ServiceAbility";
const ABILITY_NAME4 = "EnterpriseAdminAbility";
let userId = 0;
let userId = 0;
export default function QueryExtensionAbilityInfos() {
export default function QueryExtensionAbilityInfos() {
...
@@ -782,14 +783,15 @@ export default function QueryExtensionAbilityInfos() {
...
@@ -782,14 +783,15 @@ export default function QueryExtensionAbilityInfos() {
*/
*/
it('SUB_BMS_APPINFO_EXTENSION_0020', 0, async function (done) {
it('SUB_BMS_APPINFO_EXTENSION_0020', 0, async function (done) {
await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_EXTENSION_ABILITY).then(data => {
await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_EXTENSION_ABILITY).then(data => {
expect(data.extensionAbilityInfo.length).assertEqual(
7
);
expect(data.extensionAbilityInfo.length).assertEqual(
8
);
expect(data.extensionAbilityInfo[0].name).assertEqual("ExtensionAbilityA");
expect(data.extensionAbilityInfo[0].name).assertEqual("ExtensionAbilityA");
expect(data.extensionAbilityInfo[1].name).assertEqual("ExtensionAbilityB");
expect(data.extensionAbilityInfo[1].name).assertEqual("ExtensionAbilityB");
expect(data.extensionAbilityInfo[2].name).assertEqual("ExtensionAbilityQ");
expect(data.extensionAbilityInfo[2].name).assertEqual("ExtensionAbilityQ");
expect(data.extensionAbilityInfo[3].name).assertEqual("ExtensionAbilityW");
expect(data.extensionAbilityInfo[3].name).assertEqual("ExtensionAbilityW");
expect(data.extensionAbilityInfo[4].name).assertEqual("ExtensionAbility1");
expect(data.extensionAbilityInfo[4].name).assertEqual("EnterpriseAdminAbility");
expect(data.extensionAbilityInfo[5].name).assertEqual("FormAbility");
expect(data.extensionAbilityInfo[5].name).assertEqual("ExtensionAbility1");
expect(data.extensionAbilityInfo[6].name).assertEqual("ServiceAbility");
expect(data.extensionAbilityInfo[6].name).assertEqual("FormAbility");
expect(data.extensionAbilityInfo[7].name).assertEqual("ServiceAbility");
}).catch(err => {
}).catch(err => {
expect(err).assertFail();
expect(err).assertFail();
});
});
...
@@ -799,14 +801,15 @@ export default function QueryExtensionAbilityInfos() {
...
@@ -799,14 +801,15 @@ export default function QueryExtensionAbilityInfos() {
done();
done();
return;
return;
}
}
expect(data.extensionAbilityInfo.length).assertEqual(
7
);
expect(data.extensionAbilityInfo.length).assertEqual(
8
);
expect(data.extensionAbilityInfo[0].name).assertEqual("ExtensionAbilityA");
expect(data.extensionAbilityInfo[0].name).assertEqual("ExtensionAbilityA");
expect(data.extensionAbilityInfo[1].name).assertEqual("ExtensionAbilityB");
expect(data.extensionAbilityInfo[1].name).assertEqual("ExtensionAbilityB");
expect(data.extensionAbilityInfo[2].name).assertEqual("ExtensionAbilityQ");
expect(data.extensionAbilityInfo[2].name).assertEqual("ExtensionAbilityQ");
expect(data.extensionAbilityInfo[3].name).assertEqual("ExtensionAbilityW");
expect(data.extensionAbilityInfo[3].name).assertEqual("ExtensionAbilityW");
expect(data.extensionAbilityInfo[4].name).assertEqual("ExtensionAbility1");
expect(data.extensionAbilityInfo[4].name).assertEqual("EnterpriseAdminAbility");
expect(data.extensionAbilityInfo[5].name).assertEqual("FormAbility");
expect(data.extensionAbilityInfo[5].name).assertEqual("ExtensionAbility1");
expect(data.extensionAbilityInfo[6].name).assertEqual("ServiceAbility");
expect(data.extensionAbilityInfo[6].name).assertEqual("FormAbility");
expect(data.extensionAbilityInfo[7].name).assertEqual("ServiceAbility");
done();
done();
})
})
})
})
...
@@ -833,6 +836,62 @@ export default function QueryExtensionAbilityInfos() {
...
@@ -833,6 +836,62 @@ export default function QueryExtensionAbilityInfos() {
})
})
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0022
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos get enterpriseAdmin extensionAbility
*/
it('SUB_BMS_APPINFO_EXTENSION_0022', 0, async function (done) {
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME4
}, bundle.ExtensionAbilityType.ENTERPRISE_ADMIN, 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_NAME4);
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(11);
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).assertEqual(1);
});
bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME4
}, bundle.ExtensionAbilityType.ENTERPRISE_ADMIN, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT,
userId, (err, data) => {
if (err) {
expect(err).assertEqual(1);
done();
return;
}
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual(ABILITY_NAME4);
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(11);
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();
})
})
function checkApplication(data) {
function checkApplication(data) {
expect(data[0].applicationInfo.name).assertEqual("ohos.acts.bundle.stage");
expect(data[0].applicationInfo.name).assertEqual("ohos.acts.bundle.stage");
expect(data[0].applicationInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage");
expect(data[0].applicationInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage");
...
...
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/module.json
浏览文件 @
8f75c281
...
@@ -219,6 +219,19 @@
...
@@ -219,6 +219,19 @@
"resource"
:
"$profile:form_config"
"resource"
:
"$profile:form_config"
}
}
]
]
},
{
"name"
:
"EnterpriseAdminAbility"
,
"srcEntrance"
:
"./ets/ServiceAbility/FormAbility.ts"
,
"label"
:
"$string:form_FormAbility_label"
,
"description"
:
"$string:form_FormAbility_desc"
,
"type"
:
"enterpriseAdmin"
,
"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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录