提交 3ebb347d 编写于 作者: D dingyao

Add api7、api8 unpermission ets test

Signed-off-by: Ndingyao <dingyao5@huawei.com>
上级 e4c913bd
......@@ -15,7 +15,7 @@
import bundle from '@ohos.bundle'
import innerBundleManager from '@ohos.bundle.innerBundleManager'
import { describe, it, expect } from 'deccjsunit/index'
import {describe, it, expect} from 'deccjsunit/index'
const STATUS_INSTALL_PERMISSION_DENIED = 0X44;
const STATUS_UNINSTALL_PERMISSION_DENIED = 0X45;
......@@ -144,8 +144,8 @@ describe('ActsBmsJsUnPermissionTest', function () {
it('queryAbilityByWantTest_100', 0, async function (done) {
console.debug('queryAbilityByWantTest_100 start');
bundle.queryAbilityByWant({
bundleName : LAUNCHER_BUNDLE_NAME,
abilityName : LAUNCHER_MAIN_ABILITY
bundleName: LAUNCHER_BUNDLE_NAME,
abilityName: LAUNCHER_MAIN_ABILITY
}, DEFAULT_FLAG, DEFAULT_USER_ID).then(data => {
expect().assertFail();
done();
......@@ -211,8 +211,8 @@ describe('ActsBmsJsUnPermissionTest', function () {
it('setAbilityEnabledTest_100', 0, async function (done) {
console.debug('setAbilityEnabledTest_100 start');
let abilityInfo = {
bundleName : LAUNCHER_BUNDLE_NAME,
name : LAUNCHER_MAIN_ABILITY
bundleName: LAUNCHER_BUNDLE_NAME,
name: LAUNCHER_MAIN_ABILITY
};
bundle.setAbilityEnabled(abilityInfo, false).then(data => {
expect().assertFail();
......@@ -270,4 +270,40 @@ describe('ActsBmsJsUnPermissionTest', function () {
done();
});
});
/*
* @tc.number: getAbilityLabelTest_100
* @tc.name: getAbilityLabel : Gets the specified ability label
* @tc.desc: Check the return value of the interface (by promise)
* @tc.level 0
*/
it('getAbilityLabelTest_100', 0, async function (done) {
console.debug('[getAbilityLabelTest_100] promise START');
await bundle.getAbilityLabel(LAUNCHER_BUNDLE_NAME, LAUNCHER_MAIN_ABILITY)
.then((data) => {
expect().assertFail();
done();
})
.catch((error) => {
expect(error).assertEqual(INVALID_CODE);
done();
});
});
/*
* @tc.number: getAbilityInfo_100
* @tc.name: test getAbilityInfo
* @tc.desc: test getAbilityInfo
*/
it('getAbilityInfo_100', 0, async function (done) {
console.debug('getAbilityInfo_100 start');
bundle.getAbilityInfo(LAUNCHER_BUNDLE_NAME, LAUNCHER_MAIN_ABILITY).then(data => {
expect().assertFail();
done();
}).catch(err => {
expect(err).assertEqual(INVALID_CODE);
done();
});
})
})
......@@ -62,7 +62,7 @@ export default function GetabilityInfo() {
});
/*
* @tc.number: bundle_getAllApplicationInfo_test_0200
* @tc.number: bundle_getAbilityInfo_test_0200
* @tc.name: getAbilityInfo : The basic ability is enhanced to obtain the specified Ability information
* @tc.desc: Check the return value of the interface (by callback)
* @tc.level 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册