提交 2df26241 编写于 作者: D dy

add appexecfwk actsbundlemanageretstest

Signed-off-by: Ndy <dingyao5@huawei.com>
上级 f66528f4
......@@ -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;
......@@ -47,7 +47,7 @@ describe('ActsBmsJsUnPermissionTest', function () {
expect(data.status).assertEqual(STATUS_INSTALL_PERMISSION_DENIED);
expect(data.statusMessage).assertEqual("STATUS_INSTALL_PERMISSION_DENIED");
done();
};
}
});
/*
......@@ -69,7 +69,7 @@ describe('ActsBmsJsUnPermissionTest', function () {
expect(data.status).assertEqual(STATUS_UNINSTALL_PERMISSION_DENIED);
expect(data.statusMessage).assertEqual("STATUS_UNINSTALL_PERMISSION_DENIED");
done();
};
}
});
/*
......@@ -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();
......@@ -195,8 +195,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();
......@@ -254,4 +254,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();
});
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册