From e63ba7f73dba0a3331ae61e91ec481a7749d1cd2 Mon Sep 17 00:00:00 2001 From: inter515 Date: Fri, 14 Jul 2023 18:00:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EPUSH=E7=B1=BB=E5=9E=8Bextensi?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: inter515 --- .../ets/test/GetBundleInfoForSelf.test.ets | 21 ++++++++++++++----- .../entry/src/main/module.json | 11 ++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) mode change 100755 => 100644 bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/module.json diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets index 648f4bcfc..4e5c86d94 100644 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets @@ -485,9 +485,9 @@ export default function getBundleInfoForSelf() { expect(data.appInfo).assertEqual(null); expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); let extensionList = data.hapModulesInfo[0].extensionAbilitiesInfo - expect(extensionList.length).assertEqual(15); + expect(extensionList.length).assertEqual(16); let count = 0; - for (let i = 0;i < 15; i++) { + for (let i = 0;i < 16; i++) { switch (extensionList[i].name) { case "Form": console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); @@ -590,10 +590,15 @@ export default function getBundleInfoForSelf() { expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.APP_ACCOUNT_AUTHORIZATION) count = count + 15; break; + case 'push': + console.info("push" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.PUSH) + count = count + 16; + break; } console.info("count" + JSON.stringify(count)); } - expect(count).assertEqual(120); + expect(count).assertEqual(136); expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); expect(data.reqPermissionDetails.length).assertEqual(0); expect(data.permissionGrantStates.length).assertEqual(0); @@ -621,8 +626,9 @@ export default function getBundleInfoForSelf() { expect(data.appInfo).assertEqual(null); expect(data.hapModulesInfo[0].abilitiesInfo.length).assertEqual(0); let extensionList = data.hapModulesInfo[0].extensionAbilitiesInfo + expect(extensionList.length).assertEqual(16); let count = 0; - for (let i = 0;i < 15; i++) { + for (let i = 0;i < 16; i++) { switch (extensionList[i].name) { case "Form": console.info("Form" + JSON.stringify(extensionList[i].extensionAbilityType)); @@ -725,10 +731,15 @@ export default function getBundleInfoForSelf() { expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.APP_ACCOUNT_AUTHORIZATION) count = count + 15; break; + case 'push': + console.info("push" + JSON.stringify(extensionList[i].extensionAbilityType)); + expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.PUSH) + count = count + 16; + break; } console.info("count" + JSON.stringify(count)); } - expect(count).assertEqual(120); + expect(count).assertEqual(136); expect(data.hapModulesInfo[0].metadata.length).assertEqual(0); expect(data.reqPermissionDetails.length).assertEqual(0); expect(data.permissionGrantStates.length).assertEqual(0); diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/module.json b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/module.json old mode 100755 new mode 100644 index eca7cf05a..864e634be --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/module.json +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/module.json @@ -364,6 +364,17 @@ "srcEntrance": "./ets/FormAbility/FormAbility.ts", "type": "appAccountAuthorization", "visible": true + }, + { + "description": "$string:form_description", + "descriptionId": 16777219, + "icon": "$media:icon", + "iconId": 16777225, + "label": "$string:entry_label", + "name": "push", + "srcEntrance": "./ets/FormAbility/FormAbility.ts", + "type": "push", + "visible": true } ], "requestPermissions": [ -- GitLab