未验证 提交 4c48663f 编写于 作者: O openharmony_ci 提交者: Gitee

!3448 替为辅助demo的包名

Merge pull request !3448 from ry/master
......@@ -14,6 +14,29 @@
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"remount",
"mkdir /data/test"
]
},
{
"type": "PushKit",
"push": [
"bmsJstest1.hap->/data/test/bmsJstest1.hap"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 644 /data/test/*.hap",
"bm install -p /data/test/bmsJstest1.hap"
],
"teardown-command":[
"bm uninstall -n com.example.myapplication1"
]
}
]
}
......@@ -20,11 +20,10 @@ import account from '@ohos.account.osAccount'
const DEFAULT_FLAG = bundle.BundleFlag.GET_BUNDLE_DEFAULT;
const INVALID_CODE = 1;
const LAUNCHER_BUNDLE_NAME = "com.ohos.launcher";
const SELF_BUNDLENAME = "com.example.actsbmsetsunpermissiontest";
const SELF_ABILITYNAME = "com.example.actsbmsetsunpermissiontest.MainAbility";
const BUNDLE_SETTINGS = "com.ohos.settings";
const ABILITIY_SETTINGS = "com.ohos.settings.MainAbility";
const BUNDLE_NAME_OTHER = "com.example.myapplication1";
const ABILITIY_NAME_OTHER = "com.example.myapplication1.MainAbility";
const BUNDLE_NAME1 = "ohos.acts.bundle.stage";
const ABILITY_NAME1 = "ExtensionAbility1";
let userId = 0;
......@@ -67,12 +66,12 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.desc test getBundleInfo
*/
it('getBundleInfo_2000', 0, async function (done) {
await bundle.getBundleInfo(LAUNCHER_BUNDLE_NAME, DEFAULT_FLAG, { userId: userId }).then(data => {
await bundle.getBundleInfo(BUNDLE_NAME_OTHER, DEFAULT_FLAG, { userId: userId }).then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(INVALID_CODE);
});
bundle.getBundleInfo(LAUNCHER_BUNDLE_NAME, DEFAULT_FLAG, { userId: userId }, (err, data) => {
bundle.getBundleInfo(BUNDLE_NAME_OTHER, DEFAULT_FLAG, { userId: userId }, (err, data) => {
expect(err).assertEqual(INVALID_CODE);
expect(data).assertEqual(undefined);
done();
......@@ -85,12 +84,12 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.desc test getApplicationInfo
*/
it('getApplicationInfo_1800', 0, async function (done) {
await bundle.getApplicationInfo(LAUNCHER_BUNDLE_NAME, DEFAULT_FLAG).then(data => {
await bundle.getApplicationInfo(BUNDLE_NAME_OTHER, DEFAULT_FLAG).then(data => {
expect().assertFail();
}).catch(err => {
expect(err).assertEqual(INVALID_CODE);
});
bundle.getApplicationInfo(LAUNCHER_BUNDLE_NAME, DEFAULT_FLAG, (err, data) => {
bundle.getApplicationInfo(BUNDLE_NAME_OTHER, DEFAULT_FLAG, (err, data) => {
expect(err).assertEqual(INVALID_CODE);
expect(data).assertEqual(undefined);
done();
......@@ -130,7 +129,7 @@ export default function actsBmsJsUnPermissionTest() {
*/
it('SUB_BMS_HAP_STATUS_0012', 0, async function (done) {
pkg.hasInstalled({
bundleName: LAUNCHER_BUNDLE_NAME,
bundleName: BUNDLE_NAME_OTHER,
success: function success(data) {
console.info("get hasInstalled success" + JSON.stringify(data));
expect(data.result).assertFalse();
......@@ -155,12 +154,12 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.desc: test getAbilityIcon without permission
*/
it('SUB_BMS_APPINFO_GETABILITYICON_0006', 0, async function (done) {
await bundle.getAbilityIcon(BUNDLE_SETTINGS, ABILITIY_SETTINGS).then(pixelmap => {
await bundle.getAbilityIcon(BUNDLE_NAME_OTHER, ABILITIY_NAME_OTHER).then(pixelmap => {
expect(pixelmap).assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
bundle.getAbilityIcon(BUNDLE_SETTINGS, ABILITIY_SETTINGS, (err, pixelmap) => {
bundle.getAbilityIcon(BUNDLE_NAME_OTHER, ABILITIY_NAME_OTHER, (err, pixelmap) => {
expect(err).assertEqual(1);
done();
});
......
......@@ -31,7 +31,11 @@
{
"type": "ShellKit",
"run-command": [
"chmod 644 /data/test/*.hap"
"chmod 644 /data/test/*.hap",
"bm install -p /data/test/bmsJstest1.hap"
],
"teardown-command":[
"bm uninstall -n com.example.myapplication1"
]
}
]
......
......@@ -17,8 +17,8 @@ import bundle from '@ohos.bundle'
import account from '@ohos.account.osAccount'
import { describe, beforeAll, it, expect } from 'deccjsunit/index'
const LAUNCHER_BUNDLE_NAME = 'com.ohos.launcher';
const LAUNCHER_MAIN_ABILITY = 'com.ohos.launcher.MainAbility';
const LAUNCHER_BUNDLE_NAME = 'com.example.myapplication1';
const LAUNCHER_MAIN_ABILITY = 'com.example.myapplication1.MainAbility';
const DEFAULT_FLAG = bundle.BundleFlag.GET_BUNDLE_DEFAULT;
const INVALID_CODE = 1;
let userId = 0;
......
......@@ -20,8 +20,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
const BUNDLE_NAME = "com.open.harmony.packagemag";
const ABILITIY_NAME = "com.open.harmony.packagemag.MainAbility";
const SERVICE_NAME = "com.open.harmony.packagemag.ServiceAbility";
const BUNDLE_NAME_OTHER = "com.ohos.settings";
const ABILITIY_NAME_OTHER = "com.ohos.settings.MainAbility";
const BUNDLE_NAME_OTHER = "com.example.l3jsdemo";
const ABILITIY_NAME_OTHER = "com.example.l3jsdemo.MainAbility";
const BUNDLE_NAME_ERROR = "com.ohos.packagemag";
const ABILITIY_NAME_ERROR = "com.ohos.packagemag.MainAbility";
......
......@@ -16,7 +16,7 @@
import bundle from '@ohos.bundle'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
const BUNDLE_NAME1 = 'com.ohos.launcher';
const BUNDLE_NAME1 = 'com.example.l3jsdemo';
const BUNDLE_NAME2 = 'com.open.harmony.packagemag';
export default function getNameForUid() {
......
......@@ -24,7 +24,6 @@ const NAME2 = "com.example.myapplication2"
const NAME3 = "com.example.myapplication4"
const NAME4 = "com.example.myapplication5"
const NAME5 = "com.example.myapplication6"
const LAUNCHER = "com.ohos.launcher"
const VERSIONCODE1 = 1
const OBJECT = "object"
const DIR1 = "/data/app/el1/bundle/public/com.example.myapplication1/com.example.myapplication1"
......@@ -436,13 +435,13 @@ describe('ActsBundleManagerTest', function () {
/**
* @tc.number getBundleInfo_1400
* @tc.name BUNDLE::getBundleInfo
* @tc.desc Test getBundleInfo interfaces with LAUNCHER hap.(by callback)
* @tc.desc Test getBundleInfo interfaces with systemApp.(by callback)
*/
it('getBundleInfo_1400', 0, async function (done) {
let bundleOptions = {
userId: userId
};
demo.getBundleInfo(LAUNCHER, demo.BundleFlag.GET_BUNDLE_WITH_ABILITIES,
demo.getBundleInfo(NAME1, demo.BundleFlag.GET_BUNDLE_WITH_ABILITIES,
bundleOptions, (err, datainfo) => {
if (err) {
console.info("getBundleInfo_1400 fail:" + JSON.stringify(err));
......@@ -451,12 +450,12 @@ describe('ActsBundleManagerTest', function () {
return;
}
console.info("getBundleInfo_1400 success:" + JSON.stringify(datainfo));
expect(datainfo.name).assertEqual(LAUNCHER);
expect(datainfo.vendor).assertEqual("ohos");
expect(datainfo.versionCode).assertEqual(1000000);
expect(datainfo.name).assertEqual(NAME1);
expect(datainfo.vendor).assertEqual("example");
expect(datainfo.versionCode).assertEqual(1);
expect(datainfo.versionName.length).assertLarger(0);
expect(datainfo.uid).assertLarger(2099);
expect(datainfo.appInfo.name).assertEqual(LAUNCHER);
expect(datainfo.appInfo.name).assertEqual(NAME1);
expect(datainfo.appInfo.systemApp).assertEqual(true);
expect(datainfo.appInfo.supportedModes).assertEqual(0);
expect(datainfo.appInfo.moduleInfos.length).assertLarger(0);
......@@ -597,7 +596,7 @@ describe('ActsBundleManagerTest', function () {
done();
return;
}
console.info("getBundleInfo_1800 success" + JSON.stringify(datainfo));
console.info("getBundleInfo_1800 success" + JSON.stringify(dataInfo));
expect(dataInfo).assertFail();
done();
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册