diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js index f657b1a09a7b0fa1676654cd5b89d3cc38ae619a..e8d6279769763902d220dccb651b417fcad77ace 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js @@ -39,13 +39,14 @@ describe('ActsBmsAccessTokenTest', function () { installer.install(BUNDLE_PATH1, installParam, OnReceiveInstallEvent); async function OnReceiveInstallEvent(err, data) { checkInstallOrUninstall(err, data); - await bundle.getApplicationInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_DEFAULT, USERID).then(applicationInfo => { - console.info('accessTokenId: ' + applicationInfo.accessTokenId); - expect(applicationInfo.name).assertEqual(BUNDLE_NAME1); - expect(applicationInfo.accessTokenId).assertLarger(0); - }).catch((err) => { - expect(err).assertFail(); - }); + await bundle.getApplicationInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_DEFAULT, USERID) + .then(applicationInfo => { + console.info('accessTokenId: ' + applicationInfo.accessTokenId); + expect(applicationInfo.name).assertEqual(BUNDLE_NAME1); + expect(applicationInfo.accessTokenId).assertLarger(0); + }).catch((err) => { + expect(err).assertFail(); + }); installer.uninstall(BUNDLE_NAME1, installParam, (err, data) => { checkInstallOrUninstall(err, data); done(); @@ -63,19 +64,20 @@ describe('ActsBmsAccessTokenTest', function () { installer.install(BUNDLE_PATH1, installParam, OnReceiveInstallEvent); async function OnReceiveInstallEvent(err, data) { checkInstallOrUninstall(err, data); - await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION).then(bundleInfo => { - expect(bundleInfo.name).assertEqual(BUNDLE_NAME1); - expect(bundleInfo.reqPermissions.length).assertEqual(3); - expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); - expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.BETA"); - expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); - expect(bundleInfo.reqPermissionStates.length).assertEqual(3); - expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); - expect(bundleInfo.reqPermissionStates[1]).assertEqual(-1); - expect(bundleInfo.reqPermissionStates[2]).assertEqual(0); - }).catch((err) => { - expect(err).assertFail(); - }); + await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION) + .then(bundleInfo => { + expect(bundleInfo.name).assertEqual(BUNDLE_NAME1); + expect(bundleInfo.reqPermissions.length).assertEqual(3); + expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); + expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.BETA"); + expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); + expect(bundleInfo.reqPermissionStates.length).assertEqual(3); + expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[1]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[2]).assertEqual(0); + }).catch((err) => { + expect(err).assertFail(); + }); installer.uninstall(BUNDLE_NAME1, installParam, (err, data) => { checkInstallOrUninstall(err, data); done(); @@ -97,23 +99,24 @@ describe('ActsBmsAccessTokenTest', function () { } async function OnReceiveUpdateEvent(err, data) { checkInstallOrUninstall(err, data); - await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION).then(bundleInfo => { - expect(bundleInfo.name).assertEqual(BUNDLE_NAME1); - expect(bundleInfo.reqPermissions.length).assertEqual(5); - expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); - expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); - expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND"); - expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.SYSTEM_FLOAT_WINDOW"); - expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.USE_BLUETOOTH"); - expect(bundleInfo.reqPermissionStates.length).assertEqual(5); - expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); - expect(bundleInfo.reqPermissionStates[1]).assertEqual(0); - expect(bundleInfo.reqPermissionStates[2]).assertEqual(-1); - expect(bundleInfo.reqPermissionStates[3]).assertEqual(0); - expect(bundleInfo.reqPermissionStates[4]).assertEqual(0); - }).catch((err) => { - expect(err).assertFail(); - }); + await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION) + .then(bundleInfo => { + expect(bundleInfo.name).assertEqual(BUNDLE_NAME1); + expect(bundleInfo.reqPermissions.length).assertEqual(5); + expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); + expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); + expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND"); + expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.SYSTEM_FLOAT_WINDOW"); + expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.USE_BLUETOOTH"); + expect(bundleInfo.reqPermissionStates.length).assertEqual(5); + expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[1]).assertEqual(0); + expect(bundleInfo.reqPermissionStates[2]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[3]).assertEqual(0); + expect(bundleInfo.reqPermissionStates[4]).assertEqual(0); + }).catch((err) => { + expect(err).assertFail(); + }); installer.uninstall(BUNDLE_NAME1, installParam, (err, data) => { checkInstallOrUninstall(err, data); done(); @@ -135,25 +138,26 @@ describe('ActsBmsAccessTokenTest', function () { } async function OnReceiveUpdateEvent(err, data) { checkInstallOrUninstall(err, data); - await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION).then(bundleInfo => { - expect(bundleInfo.name).assertEqual(BUNDLE_NAME1); - expect(bundleInfo.reqPermissions.length).assertEqual(6); - expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); - expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.BETA"); - expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); - expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND"); - expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.SYSTEM_FLOAT_WINDOW"); - expect(bundleInfo.reqPermissions[5]).assertEqual("ohos.permission.USE_BLUETOOTH"); - expect(bundleInfo.reqPermissionStates.length).assertEqual(6); - expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); - expect(bundleInfo.reqPermissionStates[1]).assertEqual(-1); - expect(bundleInfo.reqPermissionStates[2]).assertEqual(0); - expect(bundleInfo.reqPermissionStates[3]).assertEqual(-1); - expect(bundleInfo.reqPermissionStates[4]).assertEqual(0); - expect(bundleInfo.reqPermissionStates[5]).assertEqual(0); - }).catch((err) => { - expect(err).assertFail(); - }); + await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION) + .then(bundleInfo => { + expect(bundleInfo.name).assertEqual(BUNDLE_NAME1); + expect(bundleInfo.reqPermissions.length).assertEqual(6); + expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA"); + expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.BETA"); + expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING"); + expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND"); + expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.SYSTEM_FLOAT_WINDOW"); + expect(bundleInfo.reqPermissions[5]).assertEqual("ohos.permission.USE_BLUETOOTH"); + expect(bundleInfo.reqPermissionStates.length).assertEqual(6); + expect(bundleInfo.reqPermissionStates[0]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[1]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[2]).assertEqual(0); + expect(bundleInfo.reqPermissionStates[3]).assertEqual(-1); + expect(bundleInfo.reqPermissionStates[4]).assertEqual(0); + expect(bundleInfo.reqPermissionStates[5]).assertEqual(0); + }).catch((err) => { + expect(err).assertFail(); + }); installer.uninstall(BUNDLE_NAME1, installParam, (err, data) => { checkInstallOrUninstall(err, data); done(); @@ -175,13 +179,14 @@ describe('ActsBmsAccessTokenTest', function () { ); async function OnReceiveInstallEvent(err, data) { checkInstallOrUninstall(err, data); - await bundle.getApplicationInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_DEFAULT).then((applicationInfo) => { - console.info("bms_AccessTokenId_0500 accessTokenId: " + applicationInfo.accessTokenId); - expect(applicationInfo.name).assertEqual(BUNDLE_NAME1); - expect(applicationInfo.accessTokenId).assertLarger(0); - }).catch((err) => { - expect(err).assertFail(); - }); + await bundle.getApplicationInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_DEFAULT) + .then((applicationInfo) => { + console.info("bms_AccessTokenId_0500 accessTokenId: " + applicationInfo.accessTokenId); + expect(applicationInfo.name).assertEqual(BUNDLE_NAME1); + expect(applicationInfo.accessTokenId).assertLarger(0); + }).catch((err) => { + expect(err).assertFail(); + }); installer.uninstall( BUNDLE_NAME1, installParam, diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js index b51c3c47691ff92e36d886732d7332dd2e653ee7..a2bfa3a185920e733181d2d25e0fe2276759a5cc 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js @@ -44,11 +44,12 @@ describe('ActsBmsQueryAbilityByWant', function () { action: ['action.system.home'], entities: ['entity.system.home'], bundleName: BUNDLE_NAME1 - }, bundle.BundleFlag.GET_ABILITY_INFO_WITH_APPLICATION | bundle.BundleFlag.GET_ABILITY_INFO_SYSTEMAPP_ONLY, USERID).then(data => { - expect(data).assertFail(); - }).catch(err => { - expect(err).assertEqual(1); - }); + }, bundle.BundleFlag.GET_ABILITY_INFO_WITH_APPLICATION | bundle.BundleFlag.GET_ABILITY_INFO_SYSTEMAPP_ONLY, + USERID).then(data => { + expect(data).assertFail(); + }).catch(err => { + expect(err).assertEqual(1); + }); bundle.queryAbilityByWant({ action: ['action.system.home'], entities: ['entity.system.home'], diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js index 757be1dc41adfb6eb693b0d9586c9bee6e75f464..cb81b8ca965f304d846067027e0d34cca941abaa 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js @@ -96,47 +96,16 @@ describe('ActsBmsHapModuleTest', function () { if (result.hapModuleInfos.length == 2) { let hapModuleInfo = result.hapModuleInfos[0]; let hapModuleInfo1 = result.hapModuleInfos[1]; + checkHapMoudleInfos(hapModuleInfo); + checkHapMoudleInfos(hapModuleInfo1); expect(hapModuleInfo.name).assertEqual(BUNDLE_NAME1); expect(hapModuleInfo1.name).assertEqual(BUNDLE_NAME6); expect(hapModuleInfo.moduleName).assertEqual('entry'); - expect(hapModuleInfo.description).assertEqual(''); - expect(hapModuleInfo.descriptionId).assertEqual(0); - expect(hapModuleInfo.iconPath).assertEqual("$media:icon"); - expect(hapModuleInfo.icon).assertEqual(''); - expect(hapModuleInfo.label).assertEqual('$string:app_name'); - expect(hapModuleInfo.labelId).assertEqual(0); - expect(hapModuleInfo.iconId).assertEqual(0); - expect(hapModuleInfo.backgroundImg).assertEqual(""); - expect(hapModuleInfo.supportedModes).assertEqual(0); - expect(hapModuleInfo.reqCapabilities.length).assertEqual(0); - expect(hapModuleInfo.deviceTypes[0]).assertEqual('phone'); expect(hapModuleInfo.mainAbilityName).assertEqual(FIRSTMAINABILITY); expect(hapModuleInfo.mainElementName).assertEqual(FIRSTMAINABILITY); - expect(hapModuleInfo.abilityInfo.length).assertLarger(0); - expect(hapModuleInfo.colorMode).assertEqual(-1); - expect(hapModuleInfo.extensionAbilityInfo.length).assertEqual(0); - expect(hapModuleInfo.metadata.length).assertEqual(0); - expect(hapModuleInfo.installationFree).assertEqual(false); - expect(hapModuleInfo1.name).assertEqual(BUNDLE_NAME6); expect(hapModuleInfo1.moduleName).assertEqual('bmsmainabilitysecondscene'); - expect(hapModuleInfo1.description).assertEqual(''); - expect(hapModuleInfo1.descriptionId).assertEqual(0); - expect(hapModuleInfo1.iconPath).assertEqual("$media:icon"); - expect(hapModuleInfo1.icon).assertEqual(''); - expect(hapModuleInfo1.label).assertEqual('$string:app_name'); - expect(hapModuleInfo1.labelId).assertEqual(0); - expect(hapModuleInfo1.iconId).assertEqual(0); - expect(hapModuleInfo1.backgroundImg).assertEqual(""); - expect(hapModuleInfo1.supportedModes).assertEqual(0); - expect(hapModuleInfo1.reqCapabilities.length).assertEqual(0); - expect(hapModuleInfo1.deviceTypes[0]).assertEqual('phone'); expect(hapModuleInfo1.mainAbilityName).assertEqual(SECONDMAINABILITY); expect(hapModuleInfo1.mainElementName).assertEqual(SECONDMAINABILITY); - expect(hapModuleInfo1.abilityInfo.length).assertLarger(0); - expect(hapModuleInfo1.colorMode).assertEqual(-1); - expect(hapModuleInfo1.extensionAbilityInfo.length).assertEqual(0); - expect(hapModuleInfo1.metadata.length).assertEqual(0); - expect(hapModuleInfo1.installationFree).assertEqual(false); } installer.uninstall(BUNDLE_NAME1, installParam, (err, data) => { checkInstallOrUninstall(err, data); @@ -156,36 +125,37 @@ describe('ActsBmsHapModuleTest', function () { installer.install(BUNDLE_PATH3, installParam, onReceiveInstallEvent); async function onReceiveInstallEvent(err, data) { checkInstallOrUninstall(err, data); - await bundle.getBundleInfo(BUNDLE_NAME2, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES).then(async (result) => { - expect(result.hapModuleInfos.length).assertEqual(1); - if (result.hapModuleInfos.length > 0) { - let hapModuleInfo = result.hapModuleInfos[0]; - expect(hapModuleInfo.name).assertEqual(BUNDLE_NAME2); - expect(hapModuleInfo.moduleName).assertEqual('entry'); - expect(hapModuleInfo.description).assertEqual(''); - expect(hapModuleInfo.descriptionId).assertEqual(0); - expect(hapModuleInfo.iconPath).assertEqual("$media:icon"); - expect(hapModuleInfo.icon).assertEqual(''); - expect(hapModuleInfo.label).assertEqual('$string:app_name'); - expect(hapModuleInfo.labelId).assertEqual(0); - expect(hapModuleInfo.iconId).assertEqual(0); - expect(hapModuleInfo.backgroundImg).assertEqual(""); - expect(hapModuleInfo.supportedModes).assertEqual(0); - expect(hapModuleInfo.reqCapabilities.length).assertEqual(0); - expect(hapModuleInfo.deviceTypes[0]).assertEqual('phone'); - expect(hapModuleInfo.mainAbilityName).assertEqual(""); - expect(hapModuleInfo.mainElementName).assertEqual(""); - expect(hapModuleInfo.abilityInfo.length).assertLarger(0); - expect(hapModuleInfo.colorMode).assertEqual(-1); - expect(hapModuleInfo.extensionAbilityInfo.length).assertEqual(0); - expect(hapModuleInfo.metadata.length).assertEqual(0); - expect(hapModuleInfo.installationFree).assertEqual(false); - } - installer.uninstall(BUNDLE_NAME2, installParam, (err, data) => { - checkInstallOrUninstall(err, data); - done(); + await bundle.getBundleInfo(BUNDLE_NAME2, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES) + .then(async (result) => { + expect(result.hapModuleInfos.length).assertEqual(1); + if (result.hapModuleInfos.length > 0) { + let hapModuleInfo = result.hapModuleInfos[0]; + expect(hapModuleInfo.name).assertEqual(BUNDLE_NAME2); + expect(hapModuleInfo.moduleName).assertEqual('entry'); + expect(hapModuleInfo.description).assertEqual(''); + expect(hapModuleInfo.descriptionId).assertEqual(0); + expect(hapModuleInfo.iconPath).assertEqual("$media:icon"); + expect(hapModuleInfo.icon).assertEqual(''); + expect(hapModuleInfo.label).assertEqual('$string:app_name'); + expect(hapModuleInfo.labelId).assertEqual(0); + expect(hapModuleInfo.iconId).assertEqual(0); + expect(hapModuleInfo.backgroundImg).assertEqual(""); + expect(hapModuleInfo.supportedModes).assertEqual(0); + expect(hapModuleInfo.reqCapabilities.length).assertEqual(0); + expect(hapModuleInfo.deviceTypes[0]).assertEqual('phone'); + expect(hapModuleInfo.mainAbilityName).assertEqual(""); + expect(hapModuleInfo.mainElementName).assertEqual(""); + expect(hapModuleInfo.abilityInfo.length).assertLarger(0); + expect(hapModuleInfo.colorMode).assertEqual(-1); + expect(hapModuleInfo.extensionAbilityInfo.length).assertEqual(0); + expect(hapModuleInfo.metadata.length).assertEqual(0); + expect(hapModuleInfo.installationFree).assertEqual(false); + } + installer.uninstall(BUNDLE_NAME2, installParam, (err, data) => { + checkInstallOrUninstall(err, data); + done(); + }); }); - }); } }); @@ -313,6 +283,25 @@ describe('ActsBmsHapModuleTest', function () { } }); + function checkHapMoudleInfos(info) { + expect(info.description).assertEqual(''); + expect(info.descriptionId).assertEqual(0); + expect(info.iconPath).assertEqual("$media:icon"); + expect(info.icon).assertEqual(''); + expect(info.label).assertEqual('$string:app_name'); + expect(info.labelId).assertEqual(0); + expect(info.iconId).assertEqual(0); + expect(info.backgroundImg).assertEqual(""); + expect(info.supportedModes).assertEqual(0); + expect(info.reqCapabilities.length).assertEqual(0); + expect(info.deviceTypes[0]).assertEqual('phone'); + expect(info.abilityInfo.length).assertLarger(0); + expect(info.colorMode).assertEqual(-1); + expect(info.extensionAbilityInfo.length).assertEqual(0); + expect(info.metadata.length).assertEqual(0); + expect(info.installationFree).assertEqual(false); + } + function checkInstallOrUninstall(err, data) { expect(err.code).assertEqual(0); expect(data.status).assertEqual(0); diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js index 898b23399ec8548dad627e605b0fd2da292f077e..179f79923586a683883ed1686d556f92681adb8d 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js @@ -120,49 +120,18 @@ describe('ActsBmsJsTest', function () { let abilityInfo2 = result.abilityInfos[1]; let abilityInfo3 = result.abilityInfos[2]; let abilityInfo4 = result.abilityInfos[3]; - expect(abilityInfo1.name).assertEqual(ABILITIY_NAME2); + checkAbilityInfos(abilityInfo1); + expect(abilityInfo2.metaData.length).assertEqual(1); + expect(abilityInfo2.metaData[0].name).assertEqual("Data5B"); + expect(abilityInfo2.metaData[0].value).assertEqual("float"); + expect(abilityInfo2.metaData[0].extra).assertEqual("$string:mainability_description"); expect(abilityInfo2.name).assertEqual(ABILITIY_NAME3); expect(abilityInfo3.name).assertEqual(ABILITIY_NAME7); expect(abilityInfo4.name).assertEqual(ABILITIY_NAME8); - expect(abilityInfo1.srcLanguage).assertEqual('js'); - expect(abilityInfo1.srcPath).assertEqual(''); - expect(abilityInfo1.label).assertEqual("$string:app_name"); - expect(abilityInfo1.description).assertEqual("$string:mainability_description"); - expect(abilityInfo1.icon).assertEqual("$media:icon"); - expect(abilityInfo1.isVisible).assertEqual(true); - expect(abilityInfo1.permissions.length).assertEqual(0); - expect(abilityInfo1.deviceTypes[0]).assertEqual('phone'); - expect(abilityInfo1.process).assertEqual(""); - expect(abilityInfo1.uri).assertEqual(""); - expect(abilityInfo1.bundleName).assertEqual(BUNDLE_NAME3); - expect(abilityInfo1.moduleName).assertEqual("entry"); - expect(Object.keys(abilityInfo1.applicationInfo).length).assertLarger(0); - expect(abilityInfo1.type).assertEqual(1); expect(abilityInfo3.type).assertEqual(2); expect(abilityInfo4.type).assertEqual(2); - expect(abilityInfo1.orientation).assertEqual(0); - expect(abilityInfo1.launchMode).assertEqual(1); - expect(abilityInfo1.backgroundModes).assertEqual(0); expect(abilityInfo3.backgroundModes).assertEqual(511); expect(abilityInfo4.backgroundModes).assertEqual(129); - expect(abilityInfo1.descriptionId).assertLarger(0); - expect(abilityInfo1.formEnabled).assertEqual(false); - expect(abilityInfo1.iconId).assertLarger(0); - expect(abilityInfo1.labelId).assertLarger(0); - expect(abilityInfo1.subType).assertEqual(0); - expect(abilityInfo1.readPermission).assertEqual(""); - expect(abilityInfo1.writePermission).assertEqual(""); - expect(abilityInfo1.targetAbility).assertEqual(""); - expect(abilityInfo1.theme).assertEqual(""); - expect(abilityInfo1.metaData.length).assertEqual(1); - expect(abilityInfo1.metaData[0].name).assertEqual("Data5A"); - expect(abilityInfo1.metaData[0].value).assertEqual("float"); - expect(abilityInfo1.metaData[0].extra).assertEqual("$string:mainability_description"); - expect(abilityInfo2.metaData.length).assertEqual(1); - expect(abilityInfo2.metaData[0].name).assertEqual("Data5B"); - expect(abilityInfo2.metaData[0].value).assertEqual("float"); - expect(abilityInfo2.metaData[0].extra).assertEqual("$string:mainability_description"); - expect(abilityInfo1.enabled).assertEqual(true); } installer.uninstall(BUNDLE_NAME3, installParam, (err, data) => { checkInstallOrUninstall(err, data); @@ -396,6 +365,41 @@ describe('ActsBmsJsTest', function () { done(); }); + function checkAbilityInfos(info) { + expect(info.name).assertEqual(ABILITIY_NAME2); + expect(info.srcLanguage).assertEqual('js'); + expect(info.srcPath).assertEqual(''); + expect(info.label).assertEqual("$string:app_name"); + expect(info.description).assertEqual("$string:mainability_description"); + expect(info.icon).assertEqual("$media:icon"); + expect(info.isVisible).assertEqual(true); + expect(info.permissions.length).assertEqual(0); + expect(info.deviceTypes[0]).assertEqual('phone'); + expect(info.process).assertEqual(""); + expect(info.uri).assertEqual(""); + expect(info.bundleName).assertEqual(BUNDLE_NAME3); + expect(info.moduleName).assertEqual("entry"); + expect(Object.keys(info.applicationInfo).length).assertLarger(0); + expect(info.type).assertEqual(1); + expect(info.orientation).assertEqual(0); + expect(info.launchMode).assertEqual(1); + expect(info.backgroundModes).assertEqual(0); + expect(info.descriptionId).assertLarger(0); + expect(info.formEnabled).assertEqual(false); + expect(info.iconId).assertLarger(0); + expect(info.labelId).assertLarger(0); + expect(info.subType).assertEqual(0); + expect(info.readPermission).assertEqual(""); + expect(info.writePermission).assertEqual(""); + expect(info.targetAbility).assertEqual(""); + expect(info.theme).assertEqual(""); + expect(info.metaData.length).assertEqual(1); + expect(info.metaData[0].name).assertEqual("Data5A"); + expect(info.metaData[0].value).assertEqual("float"); + expect(info.metaData[0].extra).assertEqual("$string:mainability_description"); + expect(info.enabled).assertEqual(true); + } + function checkInstallOrUninstall(err, data) { expect(err.code).assertEqual(0); expect(data.status).assertEqual(0);