提交 471f53c6 编写于 作者: I inter515

系统应用包名修改为辅助demo包名'

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