From 64e30b4e6aca023a5e424f72dcfb8f1f2dac0d75 Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Thu, 23 Jun 2022 23:00:41 +0800 Subject: [PATCH] =?UTF-8?q?XTS=E5=85=83=E8=83=BD=E5=8A=9B=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengxingzhen --- aafwk/BUILD.gn | 21 - aafwk/aafwk_standard/BUILD.gn | 48 - .../entry/src/main/config.json | 83 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 144 -- .../entry/src/main/config.json | 87 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 87 - .../entry/src/main/config.json | 87 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 138 -- .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 104 -- .../entry/src/main/config.json | 87 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 98 - .../entry/src/main/config.json | 87 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 154 -- .../entry/src/main/config.json | 96 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 88 - .../entry/src/main/config.json | 87 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 154 -- .../entry/src/main/config.json | 87 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 110 -- .../entry/src/main/config.json | 87 - .../entry/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../main/js/test/MangerAbilityJsunit.test.js | 112 -- .../simulateEAbility/src/main/config.json | 74 - .../src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../simulateFAbilityFir/src/main/config.json | 74 - .../src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../simulateFAbilitySed/src/main/config.json | 74 - .../src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../verifyAAbility/src/main/config.json | 74 - .../verifyAAbility/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../verifyIAbility/src/main/config.json | 74 - .../verifyIAbility/src/main/js/default/app.js | 22 - .../src/main/js/default/pages/index/index.css | 38 - .../src/main/js/default/pages/index/index.hml | 21 - .../js/resources/base/element/string.json | 12 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../amsabilitymultiinstanceappa/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 51 - .../src/main/ets/MainAbility/MainAbility.ts | 141 -- .../entry/src/main/module.json | 80 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../amsabilitymultiinstanceappb/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 137 -- .../entry/src/main/module.json | 80 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../amsabilitymultiinstanceappc/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 135 -- .../entry/src/main/module.json | 80 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../amsabilitymultiinstanceappd/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 37 - .../src/main/ets/MainAbility/MainAbility.ts | 137 -- .../main/ets/SecondAbility/SecondAbility.ts | 137 -- .../src/main/ets/ThirdAbility/ThirdAbility.ts | 133 -- .../entry/src/main/module.json | 120 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../actsabilitymanageretstest/BUILD.gn | 36 - .../actsabilitymanageretstest/Test.json | 19 - .../entry/src/main/config.json | 192 -- .../entry/src/main/ets/MainAbility/app.ets | 22 - .../src/main/ets/MainAbility/pages/index.ets | 40 - .../src/main/ets/ServiceAbility/service.ts | 52 - .../src/main/ets/ServiceAbility2/service.ts | 132 -- .../src/main/ets/ServiceAbility3/service.ts | 133 -- .../src/main/ets/ServiceAbility4/service.ts | 132 -- .../src/main/ets/ServiceAbility5/service.ts | 147 -- .../src/main/ets/ServiceAbility6/service.ts | 108 -- .../src/main/ets/ServiceAbility7/service.ts | 135 -- .../entry/src/main/ets/TestAbility/app.ets | 32 - .../src/main/ets/TestAbility/pages/index.ets | 49 - .../ets/TestRunner/OpenHarmonyTestRunner.ts | 77 - .../src/main/ets/test/ContextJsunit.test.ets | 249 --- .../entry/src/main/ets/test/List.test.ets | 30 - .../entry/src/main/ets/test/Utils.ets | 47 - .../test/addContextAndAbilityJsunit.test.ets | 301 ---- .../ets/test/getAbilityInfoJsunit.test.ets | 333 ---- .../ets/test/getAppVersionInfoJsunit.test.ets | 92 - .../test/getApplicationContextJsunit.test.ets | 46 - .../ets/test/getHapModuleInfoJsunit.test.ets | 233 --- .../main/resources/base/element/string.json | 56 - .../main/ets/SecondAbility/SecondAbility.ts | 125 -- .../src/main/ets/ThirdAbility/ThirdAbility.ts | 116 -- .../main/ets/SecondAbility/SecondAbility.ts | 126 -- .../src/main/ets/ThirdAbility/ThirdAbility.ts | 125 -- .../main/ets/SecondAbility/SecondAbility.ts | 253 --- .../src/main/ets/FifthAbility/FifthAbility.ts | 124 -- .../src/main/ets/ForthAbility/ForthAbility.ts | 124 -- .../main/ets/SecondAbility/SecondAbility.ts | 124 -- .../src/main/ets/ThirdAbility/ThirdAbility.ts | 124 -- .../src/main/ets/TestDataAbility/data.ts | 253 --- .../src/main/ets/TestDataAbility2/data.ts | 253 --- .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 49 - .../src/main/ets/Application/AbilityStage.ts | 24 - .../src/main/ets/MainAbility/MainAbility.ts | 51 - .../src/main/ets/MainAbility2/MainAbility2.ts | 58 - .../main/ets/ServiceAbility/ServiceAbility.ts | 207 --- .../ets/ServiceAbility2/ServiceAbility2.ts | 57 - .../entry/src/main/ets/test/Ability.test.ets | 833 --------- .../entry/src/main/ets/test/List.test.ets | 23 - .../entry/src/main/module.json | 131 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 67 - .../src/main/ets/Application/AbilityStage.ts | 24 - .../src/main/ets/MainAbility/MainAbility.ts | 51 - .../src/main/ets/MainAbility2/MainAbility2.ts | 58 - .../main/ets/ServiceAbility/ServiceAbility.ts | 125 -- .../ets/ServiceAbility2/ServiceAbility2.ts | 49 - .../entry/src/main/ets/test/Ability.test.ets | 458 ----- .../entry/src/main/ets/test/List.test.ets | 23 - .../entry/src/main/module.json | 131 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../SpecifiedUserAction_100/AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../SpecifiedUserAction_100/Test.json | 50 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 51 - .../src/main/ets/MainAbility2/MainAbility2.ts | 57 - .../entry/src/main/ets/test/List.test.ets | 22 - .../entry/src/main/ets/test/abilityTest.ets | 935 ---------- .../entry/src/main/module.json | 122 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../SpecifiedUserAction_101/AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../SpecifiedUserAction_101/Test.json | 63 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 51 - .../src/main/ets/MainAbility2/MainAbility2.ts | 57 - .../entry/src/main/ets/test/List.test.ets | 22 - .../entry/src/main/ets/test/abilityTest.ets | 540 ------ .../entry/src/main/module.json | 110 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../actsusers/ActsAmsUsersApi7AppA/Test.json | 3 - .../entry/src/main/ets/AbilityStage.ts | 21 - .../src/main/ets/MainAbility/MainAbility.ts | 44 - .../main/resources/base/element/string.json | 36 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../src/main/ets/MainAbility2/MainAbility2.ts | 53 - .../entry/src/main/ets/test/Ability.test.ets | 974 ---------- .../entry/src/main/ets/test/List.test.ets | 20 - .../entry/src/main/module.json | 120 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../ActsAmsUsersKillProcessAppA/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 56 - .../entry/src/main/module.json | 38 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../ActsAmsUsersKillProcessAppB/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 58 - .../entry/src/main/module.json | 37 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../ActsAmsUsersKillProcessAppC/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 58 - .../entry/src/main/module.json | 37 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 31 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 42 - .../main/ets/ServiceAbility/ServiceAbility.ts | 255 --- .../ets/ServiceAbility2/ServiceAbility2.ts | 60 - .../entry/src/main/ets/pages/index/index.ets | 51 - .../entry/src/main/ets/test/List.test.ets | 19 - .../ets/test/manyusersabilitytest.test.ets | 814 --------- .../entry/src/main/module.json | 108 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../actsextensionconnectabilitytest/Test.json | 42 - .../src/main/ets/Application/AbilityStage.ts | 25 - .../src/main/ets/MainAbility/MainAbility.ts | 55 - .../main/ets/ServiceAbility/ServiceAbility.ts | 62 - .../ets/ServiceAbility2/ServiceAbility2.ts | 60 - .../entry/src/main/ets/test/List.test.ets | 19 - .../actsextensionconnectabilitytest.test.ets | 291 --- .../entry/src/main/module.json | 100 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../main/ets/ServiceAbility/ServiceAbility.ts | 47 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../actsamsextensionmodulehap/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 99 - .../entry/src/main/module.json | 100 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../actsamsstaticextensioninfohap/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 51 - .../entry/src/main/module.json | 90 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../actsamsstatichapa/AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../actsamsstatichapa/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 83 - .../entry/src/main/module.json | 83 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../actsamsstatichapb/AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../actsamsstatichapb/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 62 - .../entry/src/main/module.json | 83 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../entry/src/main/ets/test/Ability.test.ets | 166 -- .../entry/src/main/ets/test/Ability.test.ets | 162 -- .../SecondMainAbility/SecondMainAbility.ts | 65 - .../actsamsspecifytesthap/AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../actsamsspecifytesthap/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 113 -- .../entry/src/main/module.json | 79 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../src/main/ets/MainAbility2/MainAbility2.ts | 72 - .../entry/src/main/config.json | 105 -- .../entry/src/main/js/default/app.js | 23 - .../js/resources/base/element/string.json | 16 - .../entry/src/main/js/test/List.test.js | 15 - .../scene/defpermission/src/main/config.json | 94 - .../defpermission/src/main/js/default/app.js | 23 - .../js/resources/base/element/string.json | 12 - .../entry/src/main/config.json | 119 -- .../entry/src/main/js/default/app.js | 22 - .../js/resources/base/element/string.json | 16 - .../entry/src/main/js/test/List.test.js | 16 - .../src/main/js/default/app.js | 22 - .../js/resources/base/element/string.json | 12 - .../src/main/js/default/app.js | 22 - .../js/resources/base/element/string.json | 12 - .../src/main/js/default/app.js | 22 - .../js/resources/base/element/string.json | 12 - .../src/main/js/default/app.js | 22 - .../js/resources/base/element/string.json | 12 - .../startability/src/main/js/default/app.js | 22 - .../js/resources/base/element/string.json | 12 - .../src/main/js/default/app.js | 22 - .../js/resources/base/element/string.json | 12 - .../src/main/js/default/app.js | 22 - .../js/resources/base/element/string.json | 12 - aafwk/aafwk_standard/formmanager/fa/BUILD.gn | 70 - .../src/main/ets/MainAbility/pages/index.ets | 304 ---- .../src/main/ets/MainAbility/pages/index.ets | 261 --- .../formhostst_ets/formsystemhostc/BUILD.gn | 32 - .../formhostst_ets/formsystemhostc/Test.json | 3 - .../entry/src/main/config.json | 140 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../main/resources/base/element/string.json | 12 - .../src/main/ets/MainAbility/pages/index.ets | 333 ---- .../src/main/ets/MainAbility/pages/index.ets | 416 ----- .../formhostst_ets/formsystemhostf/BUILD.gn | 32 - .../formhostst_ets/formsystemhostf/Test.json | 3 - .../entry/src/main/config.json | 132 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 427 ----- .../main/resources/base/element/string.json | 12 - .../formhostst_ets/formsystemhostg/BUILD.gn | 32 - .../formhostst_ets/formsystemhostg/Test.json | 3 - .../entry/src/main/config.json | 124 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 502 ------ .../main/resources/base/element/string.json | 12 - .../src/main/ets/MainAbility/pages/index.ets | 290 --- .../src/main/ets/MainAbility/pages/index.ets | 290 --- .../formhostst_ets/formsystemhostk/BUILD.gn | 32 - .../formhostst_ets/formsystemhostk/Test.json | 3 - .../entry/src/main/config.json | 143 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 609 ------- .../main/resources/base/element/string.json | 12 - .../formhostst_ets/formsystemhostl/BUILD.gn | 32 - .../formhostst_ets/formsystemhostl/Test.json | 3 - .../entry/src/main/config.json | 118 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 166 -- .../main/resources/base/element/string.json | 12 - .../formhostst_ets/formsystemhostn/BUILD.gn | 32 - .../formhostst_ets/formsystemhostn/Test.json | 3 - .../entry/src/main/config.json | 124 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 455 ----- .../main/resources/base/element/string.json | 12 - .../formsystemhostnoperm/BUILD.gn | 32 - .../formsystemhostnoperm/Test.json | 3 - .../entry/src/main/config.json | 137 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 335 ---- .../main/resources/base/element/string.json | 12 - .../formhostst_ets/formsystemhosto/BUILD.gn | 32 - .../formhostst_ets/formsystemhosto/Test.json | 3 - .../entry/src/main/config.json | 124 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 432 ----- .../main/resources/base/element/string.json | 12 - .../formhostst_ets/formsystemhostp/BUILD.gn | 32 - .../formhostst_ets/formsystemhostp/Test.json | 3 - .../entry/src/main/config.json | 124 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 422 ----- .../main/resources/base/element/string.json | 12 - .../formsupplyapplicationA/Test.json | 3 - .../entry/src/main/config.json | 141 -- .../entry/src/main/ets/FormAbility/form.ts | 88 - .../main/js/Form_Js001/pages/index/index.css | 19 - .../main/js/Form_Js001/pages/index/index.hml | 7 - .../main/js/Form_Js001/pages/index/index.json | 6 - .../main/resources/base/element/string.json | 16 - .../formsupplyapplicationB/Test.json | 3 - .../entry/src/main/config.json | 139 -- .../entry/src/main/ets/FormAbility/form.ts | 88 - .../src/main/js/widget/common/img/ic_list.svg | 22 - .../main/js/widget/common/img/ic_vision.svg | 29 - .../main/resources/base/element/string.json | 16 - .../formsupplyapplicationD/Test.json | 3 - .../entry/src/main/config.json | 139 -- .../entry/src/main/ets/FormAbility/form.ts | 89 - .../src/main/js/widget/common/img/ic_list.svg | 22 - .../main/js/widget/common/img/ic_vision.svg | 29 - .../main/resources/base/element/string.json | 16 - .../formsupplyapplicationE/Test.json | 3 - .../entry/src/main/config.json | 141 -- .../entry/src/main/ets/FormAbility/form.ts | 99 - .../src/main/js/widget/common/img/ic_list.svg | 22 - .../main/js/widget/common/img/ic_vision.svg | 29 - .../main/resources/base/element/string.json | 16 - .../formsupplyapplicationF/Test.json | 3 - .../entry/src/main/ets/FormAbility/form.ts | 143 -- .../main/js/Form_Js001/common/img/ic_list.svg | 22 - .../js/Form_Js001/common/img/ic_vision.svg | 29 - .../main/resources/base/element/string.json | 16 - .../formsupplyapplicationG/Test.json | 3 - .../entry/src/main/config.json | 124 -- .../entry/src/main/ets/FormAbility/form.ts | 155 -- .../main/js/Form_Js001/common/img/ic_list.svg | 22 - .../js/Form_Js001/common/img/ic_vision.svg | 29 - .../main/resources/base/element/string.json | 16 - .../formsupplyapplicationH/Test.json | 3 - .../entry/src/main/config.json | 141 -- .../entry/src/main/ets/FormAbility/form.ts | 99 - .../src/main/js/widget/common/img/ic_list.svg | 22 - .../main/js/widget/common/img/ic_vision.svg | 29 - .../main/resources/base/element/string.json | 16 - .../formsupplyapplicationNotSysApp/Test.json | 3 - .../entry/src/main/config.json | 141 -- .../entry/src/main/ets/FormAbility/form.ts | 99 - .../main/js/Form_Js001/pages/index/index.css | 19 - .../main/js/Form_Js001/pages/index/index.hml | 7 - .../main/js/Form_Js001/pages/index/index.json | 6 - .../main/resources/base/element/string.json | 16 - .../formsystemprovidera/BUILD.gn | 32 - .../formsystemprovidera/Test.json | 3 - .../entry/src/main/config.json | 173 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 62 - .../main/resources/base/element/string.json | 12 - .../formsystemproviderb/BUILD.gn | 32 - .../formsystemproviderb/Test.json | 3 - .../entry/src/main/config.json | 144 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 62 - .../main/resources/base/element/string.json | 12 - .../formsystemproviderc/BUILD.gn | 32 - .../formsystemproviderc/Test.json | 3 - .../entry/src/main/config.json | 144 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 62 - .../main/resources/base/element/string.json | 12 - .../formsystemproviderd/BUILD.gn | 32 - .../formsystemproviderd/Test.json | 3 - .../entry/src/main/config.json | 116 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 62 - .../main/resources/base/element/string.json | 12 - .../MainAbility/test/FmsAcquireForm.test.ets | 1565 ---------------- .../formacquiretest2/BUILD.gn | 32 - .../formacquiretest2/Test.json | 23 - .../entry/src/main/config.json | 141 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../MainAbility/test/FmsAcquireForm2.test.ets | 495 ----- .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../MainAbility/test/FmsDeleteForm.test.ets | 1168 ------------ .../test/FmsDynamicRefreshForm.test.ets | 436 ----- .../formsystemtest_ets/formfuzztest/Test.json | 18 - .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 64 - .../test/CastTempFormFuzz.test.ets | 82 - .../MainAbility/test/DeleteFormFuzz.test.ets | 82 - .../test/DisableFormsUpdateFuzz.test.ets | 82 - .../test/EnableFormsUpdateFuzz.test.ets | 82 - .../test/GetFormsInfoFuzz.test.ets | 233 --- .../main/ets/MainAbility/test/List.test.ets | 61 - .../test/NotifyInvisibleFormsFuzz.test.ets | 82 - .../test/NotifyVisibleFormsFuzz.test.ets | 82 - .../MainAbility/test/ReleaseFormFuzz.test.ets | 218 --- .../MainAbility/test/RequestFormFuzz.test.ets | 82 - .../test/SetFormNextRefreshTimeFuzz.test.ets | 168 -- .../MainAbility/test/UpdateFormFuzz.test.ets | 142 -- .../main/ets/MainAbility/test/getParam.ets | 171 -- .../main/resources/base/element/string.json | 12 - .../formsoneandonetest/Test.json | 20 - .../entry/src/main/config.json | 114 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 64 - .../MainAbility/test/GetAllFormsInfo.test.ets | 146 -- .../MainAbility/test/GetFormsInfo.test.ets | 521 ------ .../main/ets/MainAbility/test/List.test.ets | 30 - .../main/resources/base/element/string.json | 12 - .../formsoneandtwotest/Test.json | 20 - .../entry/src/main/config.json | 114 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 64 - .../MainAbility/test/GetAllFormsInfo.test.ets | 169 -- .../main/ets/MainAbility/test/List.test.ets | 20 - .../main/resources/base/element/string.json | 12 - .../formsoneandzerotest/Test.json | 20 - .../entry/src/main/config.json | 114 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 64 - .../MainAbility/test/GetAllFormsInfo.test.ets | 125 -- .../main/ets/MainAbility/test/List.test.ets | 20 - .../main/resources/base/element/string.json | 12 - .../formswithoutpermtest/Test.json | 18 - .../entry/src/main/config.json | 110 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 64 - .../MainAbility/test/GetAllFormsInfo.test.ets | 72 - .../MainAbility/test/GetFormsInfo.test.ets | 125 -- .../main/ets/MainAbility/test/List.test.ets | 24 - .../main/resources/base/element/string.json | 12 - .../formszerotest/Test.json | 19 - .../formszerotest/entry/src/main/config.json | 114 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 64 - .../MainAbility/test/GetAllFormsInfo.test.ets | 84 - .../main/ets/MainAbility/test/List.test.ets | 20 - .../main/resources/base/element/string.json | 12 - .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../formperformancetest/Test.json | 20 - .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../test/FmsPerformanceTest.test.ets | 940 ---------- .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../MainAbility/test/FmsReleaseForm.test.ets | 574 ------ .../formstatetest_disable/Test.json | 25 - .../entry/src/main/config.json | 150 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../test/FmsFormStateDisable.test.ets | 783 -------- .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../formstatetest_enable/Test.json | 25 - .../entry/src/main/config.json | 150 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../test/FmsFormStateEnable.test.ets | 898 ---------- .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../formstatetest_notifyinvisible/Test.json | 23 - .../entry/src/main/config.json | 150 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../test/FmsFormStateNotifyInvisible.test.ets | 538 ------ .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../formstatetest_notifyinvisible2/BUILD.gn | 32 - .../formstatetest_notifyinvisible2/Test.json | 24 - .../entry/src/main/config.json | 150 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../FmsFormStateNotifyInvisible2.test.ets | 817 --------- .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../formstatetest_notifyvisible/Test.json | 29 - .../entry/src/main/config.json | 150 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../test/FmsFormStateNotifyVisible.test.ets | 1376 -------------- .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../formstresstest/Test.json | 21 - .../formstresstest/entry/src/main/config.json | 169 -- .../entry/src/main/ets/MainAbility/app.ets | 23 - .../src/main/ets/MainAbility/pages/index.ets | 68 - .../ets/MainAbility/test/FmsStress.test.ets | 670 ------- .../main/ets/MainAbility/test/List.test.ets | 19 - .../main/resources/base/element/string.json | 12 - .../test/FmsUpdateRefreshForm.test.ets | 707 -------- .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 51 - .../entry/src/main/module.json | 37 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../entry/src/main/js/default/app.js | 23 - .../js/resources/base/element/string.json | 12 - .../main/ets/SecondAbility/SecondAbility.ts | 146 -- .../src/main/ets/Application/AbilityStage.ts | 24 - .../entry/src/main/ets/test/Ability.test.ets | 653 ------- .../entry/src/main/ets/test/List.test.ets | 23 - .../acts_systemappa_test/AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../acts_systemappa_test/Test.json | 62 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 51 - .../src/main/ets/MainAbility2/MainAbility2.ts | 57 - .../main/ets/test/AbilityPermission.test.ets | 274 --- .../entry/src/main/ets/test/List.test.ets | 19 - .../entry/src/main/module.json | 121 -- .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../acts_systemappone_rely_test/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 59 - .../entry/src/main/module.json | 48 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 56 - .../entry/src/main/module.json | 37 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 56 - .../entry/src/main/module.json | 38 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 59 - .../entry/src/main/module.json | 37 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 59 - .../entry/src/main/module.json | 37 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 59 - .../entry/src/main/module.json | 38 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 59 - .../entry/src/main/module.json | 38 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 59 - .../entry/src/main/module.json | 38 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 59 - .../entry/src/main/module.json | 38 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - aafwk/aafwk_standard/stage/BUILD.gn | 26 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../stage/actslifecyclemultihap2test/BUILD.gn | 40 - .../actslifecyclemultihap2test/Test.json | 18 - .../ets/Hap2MainAbility1/Hap2MainAbility1.ts | 49 - .../Hap2MainAbility10/Hap2MainAbility10.ts | 49 - .../ets/Hap2MainAbility2/Hap2MainAbility2.ts | 48 - .../ets/Hap2MainAbility3/Hap2MainAbility3.ts | 56 - .../ets/Hap2MainAbility4/Hap2MainAbility4.ts | 56 - .../ets/Hap2MainAbility5/Hap2MainAbility5.ts | 56 - .../ets/Hap2MainAbility6/Hap2MainAbility6.ts | 55 - .../ets/Hap2MainAbility7/Hap2MainAbility7.ts | 56 - .../ets/Hap2MainAbility8/Hap2MainAbility8.ts | 56 - .../ets/Hap2MainAbility9/Hap2MainAbility9.ts | 56 - .../ets/pages/Hap2MainAbility10_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility1_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility2_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility3_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility4_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility5_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility6_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility7_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility8_pages.ets | 31 - .../main/ets/pages/Hap2MainAbility9_pages.ets | 31 - .../entry/src/main/module.json | 121 -- .../main/resources/base/element/string.json | 120 -- .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../stage/actslifecyclemultihap3test/BUILD.gn | 40 - .../actslifecyclemultihap3test/Test.json | 18 - .../ets/Hap3MainAbility1/Hap3MainAbility1.ts | 49 - .../ets/Hap3MainAbility2/Hap3MainAbility2.ts | 56 - .../ets/Hap3MainAbility3/Hap3MainAbility3.ts | 49 - .../main/ets/pages/Hap3MainAbility1_pages.ets | 31 - .../main/ets/pages/Hap3MainAbility2_pages.ets | 31 - .../main/ets/pages/Hap3MainAbility3_pages.ets | 31 - .../entry/src/main/module.json | 70 - .../main/resources/base/element/string.json | 64 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../stage/actslifecyclemultihaptest/BUILD.gn | 40 - .../stage/actslifecyclemultihaptest/Test.json | 20 - .../src/main/ets/MainAbility/MainAbility.ts | 49 - .../src/main/ets/MainAbility1/MainAbility1.ts | 116 -- .../src/main/ets/MainAbility2/MainAbility2.ts | 104 -- .../src/main/ets/MainAbility3/MainAbility3.ts | 132 -- .../src/main/ets/MainAbility4/MainAbility4.ts | 97 - .../src/main/ets/MainAbility5/MainAbility5.ts | 104 -- .../src/main/ets/MainAbility6/MainAbility6.ts | 97 - .../src/main/ets/pages/MainAbility1_pages.ets | 32 - .../src/main/ets/pages/MainAbility2_pages.ets | 32 - .../src/main/ets/pages/MainAbility3_pages.ets | 31 - .../src/main/ets/pages/MainAbility4_pages.ets | 32 - .../src/main/ets/pages/MainAbility5_pages.ets | 32 - .../src/main/ets/pages/MainAbility6_pages.ets | 32 - .../src/main/ets/pages/MainAbility_pages.ets | 57 - .../entry/src/main/ets/test/LifecycleTest.ets | 793 -------- .../entry/src/main/ets/test/ListTest.ets | 21 - .../entry/src/main/module.json | 99 - .../main/resources/base/element/string.json | 84 - .../ets/Hap4MainAbility1/Hap4MainAbility1.ts | 57 - .../main/ets/pages/Hap4MainAbility1_pages.ets | 32 - .../hap4/src/main/module.json | 57 - .../main/resources/base/element/string.json | 48 - .../AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../stage/actslifecyclesinglehaptest/BUILD.gn | 40 - .../actslifecyclesinglehaptest/Test.json | 18 - .../ets/Hap1MainAbility1/Hap1MainAbility1.ts | 55 - .../ets/Hap1MainAbility2/Hap1MainAbility2.ts | 56 - .../src/main/ets/MainAbility/MainAbility.ts | 48 - .../src/main/ets/MainAbility1/MainAbility1.ts | 131 -- .../main/ets/MainAbility10/MainAbility10.ts | 116 -- .../main/ets/MainAbility11/MainAbility11.ts | 110 -- .../main/ets/MainAbility12/MainAbility12.ts | 109 -- .../src/main/ets/MainAbility2/MainAbility2.ts | 56 - .../src/main/ets/MainAbility3/MainAbility3.ts | 132 -- .../src/main/ets/MainAbility4/MainAbility4.ts | 140 -- .../src/main/ets/MainAbility5/MainAbility5.ts | 56 - .../src/main/ets/MainAbility6/MainAbility6.ts | 130 -- .../src/main/ets/MainAbility7/MainAbility7.ts | 130 -- .../src/main/ets/MainAbility8/MainAbility8.ts | 130 -- .../src/main/ets/MainAbility9/MainAbility9.ts | 98 - .../entry/src/main/ets/pages/index.ets | 55 - .../entry/src/main/ets/pages/index1.ets | 27 - .../entry/src/main/ets/pages/index10.ets | 27 - .../entry/src/main/ets/pages/index11.ets | 27 - .../entry/src/main/ets/pages/index12.ets | 27 - .../entry/src/main/ets/pages/index2.ets | 27 - .../entry/src/main/ets/pages/index3.ets | 27 - .../entry/src/main/ets/pages/index4.ets | 27 - .../entry/src/main/ets/pages/index5.ets | 27 - .../entry/src/main/ets/pages/index6.ets | 27 - .../entry/src/main/ets/pages/index7.ets | 27 - .../entry/src/main/ets/pages/index8.ets | 27 - .../entry/src/main/ets/pages/index9.ets | 27 - .../entry/src/main/ets/pages/indexh1a1.ets | 27 - .../entry/src/main/ets/pages/indexh1a2.ets | 27 - .../entry/src/main/ets/test/LifeCycleTest.ets | 1593 ---------------- .../entry/src/main/ets/test/ListTest.ets | 19 - .../entry/src/main/module.json | 136 -- .../main/resources/base/element/string.json | 160 -- .../entry/src/main/js/default/app.js | 23 - .../js/resources/base/element/string.json | 12 - .../entry/src/main/js/test/List.test.js | 16 - .../src/main/js/default/app.js | 23 - .../js/resources/base/element/string.json | 12 - .../interfaceDeclare/i_interface_declare.ts | 21 - .../interface_declare_proxy.ts | 44 - .../interface_declare_stub.ts | 47 - .../zidlTool/my_sequenceable.ts | 28 - ..._interface_attribute_declaratoin_oneway.ts | 25 - ...rface_attribute_declaratoin_oneway_stub.ts | 64 - .../interfaceDeclare/i_interface_declare.ts | 21 - .../interface_declare_proxy.ts | 44 - .../interface_declare_stub.ts | 47 - .../src/main/ets/zidlTool/my_sequenceable.ts | 28 - ..._interface_attribute_declaratoin_oneway.ts | 25 - .../actsamszidlservice/AppScope/app.json | 21 - .../resources/base/element/string.json | 8 - .../zidltest/actsamszidlservice/Test.json | 3 - .../src/main/ets/Application/AbilityStage.ts | 23 - .../src/main/ets/MainAbility/MainAbility.ts | 51 - .../interfaceDeclare/i_interface_declare.ts | 21 - .../interface_declare_proxy.ts | 44 - .../interface_declare_stub.ts | 47 - .../zidlTool/my_sequenceable.ts | 28 - ..._interface_attribute_declaratoin_oneway.ts | 25 - ...rface_attribute_declaratoin_oneway_stub.ts | 64 - .../entry/src/main/module.json | 99 - .../main/resources/base/element/string.json | 32 - .../resources/base/profile/main_pages.json | 6 - ability/BUILD.gn | 21 + ability/ability_runtime/BUILD.gn | 48 + .../ability_runtime}/abilitymanager/BUILD.gn | 0 .../actsamscallbackfifthscene/BUILD.gn | 0 .../actsamscallbackfifthscene/Test.json | 0 .../entry/src/main/config.json | 83 + .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 144 ++ .../signature/openharmony_sx.p7b | Bin .../actsamscallbackfirstscene/BUILD.gn | 0 .../actsamscallbackfirstscene/Test.json | 0 .../entry/src/main/config.json | 87 + .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 87 + .../signature/openharmony_sx.p7b | Bin .../actsamscallbackfourthscene/BUILD.gn | 0 .../actsamscallbackfourthscene/Test.json | 0 .../entry/src/main/config.json | 87 + .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 138 ++ .../signature/openharmony_sx.p7b | Bin .../actsamscallbacksecondscene/BUILD.gn | 0 .../actsamscallbacksecondscene/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 104 ++ .../signature/openharmony_sx.p7b | Bin .../actsamscallbackthirdscene/BUILD.gn | 0 .../actsamscallbackthirdscene/Test.json | 0 .../entry/src/main/config.json | 87 + .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 98 + .../signature/openharmony_sx.p7b | Bin .../actsamstestfifthscene/BUILD.gn | 0 .../actsamstestfifthscene/Test.json | 0 .../entry/src/main/config.json | 87 + .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 154 ++ .../signature/openharmony_sx.p7b | Bin .../actsamstestfirstscene/BUILD.gn | 0 .../actsamstestfirstscene/Test.json | 0 .../entry/src/main/config.json | 96 + .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 88 + .../signature/openharmony_sx.p7b | Bin .../actsamstestfourthscene/BUILD.gn | 0 .../actsamstestfourthscene/Test.json | 0 .../entry/src/main/config.json | 87 + .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 154 ++ .../signature/openharmony_sx.p7b | Bin .../actsamstestsecondscene/BUILD.gn | 0 .../actsamstestsecondscene/Test.json | 0 .../entry/src/main/config.json | 87 + .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 110 ++ .../signature/openharmony_sx.p7b | Bin .../actsamstestthirdscene/BUILD.gn | 0 .../actsamstestthirdscene/Test.json | 0 .../entry/src/main/config.json | 87 + .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../main/js/test/MangerAbilityJsunit.test.js | 112 ++ .../signature/openharmony_sx.p7b | Bin .../sceneProject/simulateEAbility/BUILD.gn | 0 .../sceneProject/simulateEAbility/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../simulateEAbility/src/main/config.json | 74 + .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../sceneProject/simulateFAbilityFir/BUILD.gn | 0 .../simulateFAbilityFir/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../simulateFAbilityFir/src/main/config.json | 74 + .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../sceneProject/simulateFAbilitySed/BUILD.gn | 0 .../simulateFAbilitySed/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../simulateFAbilitySed/src/main/config.json | 74 + .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../sceneProject/verifyAAbility/BUILD.gn | 0 .../sceneProject/verifyAAbility/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../verifyAAbility/src/main/config.json | 74 + .../verifyAAbility/src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../sceneProject/verifyIAbility/BUILD.gn | 0 .../sceneProject/verifyIAbility/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../verifyIAbility/src/main/config.json | 74 + .../verifyIAbility/src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../abilitymultiinstance/BUILD.gn | 0 .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../amsabilitymultiinstanceappa/BUILD.gn | 0 .../amsabilitymultiinstanceappa}/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 51 + .../src/main/ets/MainAbility/MainAbility.ts | 141 ++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 80 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../amsabilitymultiinstanceappb/BUILD.gn | 0 .../amsabilitymultiinstanceappb}/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 137 ++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 80 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../amsabilitymultiinstanceappc/BUILD.gn | 0 .../amsabilitymultiinstanceappc}/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 135 ++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 80 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../amsabilitymultiinstanceappd/BUILD.gn | 0 .../amsabilitymultiinstanceappd}/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 37 + .../src/main/ets/MainAbility/MainAbility.ts | 137 ++ .../main/ets/SecondAbility/SecondAbility.ts | 137 ++ .../src/main/ets/ThirdAbility/ThirdAbility.ts | 133 ++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 120 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../amsabilitymultiinstanceappe/BUILD.gn | 0 .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 0 .../src/main/js/default/app.js | 0 .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../amsabilitymultiinstancetest/BUILD.gn | 0 .../amsabilitymultiinstancetest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index.ets | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../entry/src/main/ets/pages/second.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../actsabilitydelegatorcase/BUILD.gn | 0 .../actsabilitydelegatorcase/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../test/ActsAbilityDelegatorCaseTest.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../actsabilitylifecyclestatenew/BUILD.gn | 0 .../actsabilitylifecyclestatenew/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../ActsAbilityLifecycleStateNewTest.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../actsabilitymanageretstest/BUILD.gn | 36 + .../actsabilitymanageretstest/Test.json | 19 + .../entry/src/main/config.json | 192 ++ .../entry/src/main/ets/MainAbility/app.ets | 22 + .../src/main/ets/MainAbility/pages/index.ets | 40 + .../src/main/ets/ServiceAbility/service.ts | 52 + .../src/main/ets/ServiceAbility2/service.ts | 132 ++ .../src/main/ets/ServiceAbility3/service.ts | 133 ++ .../src/main/ets/ServiceAbility4/service.ts | 132 ++ .../src/main/ets/ServiceAbility5/service.ts | 147 ++ .../src/main/ets/ServiceAbility6/service.ts | 108 ++ .../src/main/ets/ServiceAbility7/service.ts | 135 ++ .../entry/src/main/ets/TestAbility/app.ets | 32 + .../src/main/ets/TestAbility/pages/index.ets | 49 + .../ets/TestRunner/OpenHarmonyTestRunner.ts | 77 + .../src/main/ets/test/ContextJsunit.test.ets | 249 +++ .../entry/src/main/ets/test/List.test.ets | 30 + .../entry/src/main/ets/test/Utils.ets | 47 + .../test/addContextAndAbilityJsunit.test.ets | 301 ++++ .../ets/test/getAbilityInfoJsunit.test.ets | 333 ++++ .../ets/test/getAppVersionInfoJsunit.test.ets | 92 + .../test/getApplicationContextJsunit.test.ets | 46 + .../ets/test/getHapModuleInfoJsunit.test.ets | 233 +++ .../main/resources/base/element/string.json | 56 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../ability_runtime}/actscalltest/BUILD.gn | 0 .../systemappcalleea/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actscalltest/systemappcalleea/BUILD.gn | 0 .../actscalltest/systemappcalleea/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../main/ets/SecondAbility/SecondAbility.ts | 125 ++ .../src/main/ets/ThirdAbility/ThirdAbility.ts | 116 ++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../systemappcallera/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actscalltest/systemappcallera/BUILD.gn | 0 .../actscalltest/systemappcallera/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../main/ets/SecondAbility/SecondAbility.ts | 126 ++ .../src/main/ets/ThirdAbility/ThirdAbility.ts | 125 ++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../systemappcallerb/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actscalltest/systemappcallerb/BUILD.gn | 0 .../actscalltest/systemappcallerb/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../systemappcallerc/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actscalltest/systemappcallerc/BUILD.gn | 0 .../actscalltest/systemappcallerc/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../systemcallentrytest/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actscalltest/systemcallentrytest/BUILD.gn | 0 .../systemcallentrytest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../main/ets/SecondAbility/SecondAbility.ts | 253 +++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../systemcallfeature/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actscalltest/systemcallfeature/BUILD.gn | 0 .../actscalltest/systemcallfeature/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../actscalltest/thirdappa/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actscalltest/thirdappa/BUILD.gn | 0 .../actscalltest/thirdappa/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../thirdappa/entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../thirdappa/signature/openharmony_sx.p7b | Bin .../thirdcalltest/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actscalltest/thirdcalltest/BUILD.gn | 0 .../actscalltest/thirdcalltest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/FifthAbility/FifthAbility.ts | 124 ++ .../src/main/ets/ForthAbility/ForthAbility.ts | 124 ++ .../src/main/ets/MainAbility/MainAbility.ts | 0 .../main/ets/SecondAbility/SecondAbility.ts | 124 ++ .../src/main/ets/ThirdAbility/ThirdAbility.ts | 124 ++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../thirdcalltest/entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../actsfwkdataaccessortest/BUILD.gn | 0 .../actsdataabilityrelyhap/BUILD.gn | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../src/main/ets/TestDataAbility/data.ts | 254 +++ .../src/main/ets/TestDataAbility2/data.ts | 254 +++ .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../actsfwkdataaccessortest/BUILD.gn | 0 .../actsfwkdataaccessortest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../js/test/DataAbilityHelperJsSt.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../actsserviceabilityclienttest/BUILD.gn | 0 .../actsserviceabilityclienttest/BUILD.gn | 0 .../actsserviceabilityclienttest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/List.test.js | 0 .../js/test/StServiceAbilityClient.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../actsserviceabilityserverrelyhap/BUILD.gn | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../BUILD.gn | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../actsstartcomponenttest/BUILD.gn | 0 .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../SpecifiedUserActionExtension_100/BUILD.gn | 0 .../Test.json | 49 + .../src/main/ets/Application/AbilityStage.ts | 24 + .../src/main/ets/MainAbility/MainAbility.ts | 51 + .../src/main/ets/MainAbility2/MainAbility2.ts | 58 + .../main/ets/ServiceAbility/ServiceAbility.ts | 230 +++ .../src/main/ets/ServiceAbility/service.ts | 0 .../ets/ServiceAbility2/ServiceAbility2.ts | 60 + .../src/main/ets/ServiceAbility2/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 833 +++++++++ .../entry/src/main/ets/test/List.test.ets | 23 + .../entry/src/main/module.json | 131 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../SpecifiedUserActionExtension_101/BUILD.gn | 0 .../Test.json | 67 + .../src/main/ets/Application/AbilityStage.ts | 24 + .../src/main/ets/MainAbility/MainAbility.ts | 51 + .../src/main/ets/MainAbility2/MainAbility2.ts | 58 + .../main/ets/ServiceAbility/ServiceAbility.ts | 144 ++ .../src/main/ets/ServiceAbility/service.ts | 0 .../ets/ServiceAbility2/ServiceAbility2.ts | 52 + .../src/main/ets/ServiceAbility2/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 458 +++++ .../entry/src/main/ets/test/List.test.ets | 23 + .../entry/src/main/module.json | 131 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../SpecifiedUserAction_100/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../SpecifiedUserAction_100/BUILD.gn | 0 .../SpecifiedUserAction_100/Test.json | 50 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 51 + .../src/main/ets/MainAbility2/MainAbility2.ts | 57 + .../ets/ServiceAbility2/ServiceAbility2.ts | 0 .../src/main/ets/ServiceAbility2/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/List.test.ets | 22 + .../entry/src/main/ets/test/abilityTest.ets | 935 ++++++++++ .../entry/src/main/module.json | 122 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../SpecifiedUserAction_101/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../SpecifiedUserAction_101/BUILD.gn | 0 .../SpecifiedUserAction_101/Test.json | 63 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 51 + .../src/main/ets/MainAbility2/MainAbility2.ts | 57 + .../ets/ServiceAbility2/ServiceAbility2.ts | 0 .../src/main/ets/ServiceAbility2/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/List.test.ets | 22 + .../entry/src/main/ets/test/abilityTest.ets | 540 ++++++ .../entry/src/main/module.json | 110 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../actsstserviceabilityclientcase/BUILD.gn | 0 .../actsstserviceabilityclientcase/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin ...ActsStServiceAbilityClientCaseTest.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../actsusers/ActsAmsUsersApi7AppA/BUILD.gn | 0 .../actsusers/ActsAmsUsersApi7AppA}/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/AbilityStage.ts | 21 + .../src/main/ets/MainAbility/MainAbility.ts | 44 + .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../main/resources/base/element/string.json | 36 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../ActsAmsUsersExtensionSystemTest/BUILD.gn | 0 .../ActsAmsUsersExtensionSystemTest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../src/main/ets/MainAbility2/MainAbility2.ts | 53 + .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../ets/ServiceAbility2/ServiceAbility2.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 974 ++++++++++ .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 120 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../ActsAmsUsersKillProcessAppA/BUILD.gn | 0 .../ActsAmsUsersKillProcessAppA}/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 56 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 38 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../ActsAmsUsersKillProcessAppB/BUILD.gn | 0 .../ActsAmsUsersKillProcessAppB}/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 58 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 37 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../ActsAmsUsersKillProcessAppC/BUILD.gn | 0 .../ActsAmsUsersKillProcessAppC}/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 58 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 37 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../ActsAmsUsersSystemTest/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actsusers/ActsAmsUsersSystemTest/BUILD.gn | 0 .../ActsAmsUsersSystemTest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../src/main/ets/MainAbility2/MainAbility2.ts | 0 .../src/main/ets/MainAbility3/MainAbility3.ts | 0 .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 20 + .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../ability_runtime}/actsusers/BUILD.gn | 0 .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 31 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 42 + .../main/ets/ServiceAbility/ServiceAbility.ts | 256 +++ .../src/main/ets/ServiceAbility/service.ts | 0 .../ets/ServiceAbility2/ServiceAbility2.ts | 63 + .../src/main/ets/ServiceAbility2/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 28 + .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/List.test.ets | 19 + .../ets/test/manyusersabilitytest.test.ets | 814 +++++++++ .../entry/src/main/module.json | 108 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../actsextensionconnectabilitytest/BUILD.gn | 0 .../actsextensionconnectabilitytest/Test.json | 42 + .../src/main/ets/Application/AbilityStage.ts | 25 + .../src/main/ets/MainAbility/MainAbility.ts | 55 + .../main/ets/ServiceAbility/ServiceAbility.ts | 81 + .../src/main/ets/ServiceAbility/service.ts | 0 .../ets/ServiceAbility2/ServiceAbility2.ts | 77 + .../src/main/ets/ServiceAbility2/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/List.test.ets | 19 + .../actsextensionconnectabilitytest.test.ets | 291 +++ .../entry/src/main/module.json | 100 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actsserviceabilityrelytest/BUILD.gn | 0 .../actsserviceabilityrelytest}/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../main/ets/ServiceAbility/ServiceAbility.ts | 50 + .../src/main/ets/ServiceAbility/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../amscontextualinforquery/BUILD.gn | 0 .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../actsamsextensionmodulehap/BUILD.gn | 0 .../actsamsextensionmodulehap/Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 99 + .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 100 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../actsamsstaticextensioninfohap/BUILD.gn | 0 .../actsamsstaticextensioninfohap/Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 51 + .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 90 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actsamsstaticextensioninfotest/BUILD.gn | 0 .../actsamsstaticextensioninfotest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../actsamsstatichapa/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../actsamsstatichapa/BUILD.gn | 0 .../actsamsstatichapa/Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 83 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 83 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../actsamsstatichapb/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../actsamsstatichapb/BUILD.gn | 0 .../actsamsstatichapb/Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 62 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 83 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actsamsstaticinfomationquerytest/BUILD.gn | 0 .../Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 94 + .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 94 + .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actsamsstaticquerytesttwohap/BUILD.gn | 0 .../actsamsstaticquerytesttwohap/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../SecondMainAbility/SecondMainAbility.ts | 65 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../ability_runtime}/amsdatauriutils/BUILD.gn | 0 .../amsdatauriutils/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../src/main/js/test/DataUriUtilsJsSt.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../amsdisplayIdtest/BUILD.gn | 0 .../actsamsspecifytesthap/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../actsamsspecifytesthap/BUILD.gn | 0 .../actsamsspecifytesthap/Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 113 ++ .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 79 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actsamsstartabilityforresulttest/BUILD.gn | 0 .../Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../src/main/ets/MainAbility2/MainAbility2.ts | 72 + .../entry/src/main/ets/MainAbility2/app.ets | 0 .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../actsamsstartabilitytest/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actsamsstartabilitytest/BUILD.gn | 0 .../actsamsstartabilitytest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../amsgetabilityprocessinfo/BUILD.gn | 0 .../actsgetabilityprocessinfotest/BUILD.gn | 0 .../actsgetabilityprocessinfotest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 0 .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../js/test/ActsProcessManageJsTest.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../ability_runtime}/context/BUILD.gn | 0 .../context/actscontexttest/BUILD.gn | 0 .../context/actscontexttest/Test.json | 0 .../entry/src/main/config.json | 105 ++ .../entry/src/main/js/default/app.js | 23 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 16 + .../src/main/js/resources/base/media/icon.png | Bin .../src/main/js/test/ContextJsunit.test.js | 0 .../entry/src/main/js/test/List.test.js | 15 + .../signature/openharmony_sx.p7b | Bin .../context/scene/defpermission/BUILD.gn | 0 .../context/scene/defpermission/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../scene/defpermission/src/main/config.json | 94 + .../defpermission/src/main/js/default/app.js | 23 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../ability_runtime}/fa/BUILD.gn | 0 .../fa/faapplicationinfo/BUILD.gn | 0 .../fa/faapplicationinfo/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../entry/src/main/js/MainAbility2/app.js | 0 .../src/main/js/MainAbility2/i18n/en-US.json | 0 .../src/main/js/MainAbility2/i18n/zh-CN.json | 0 .../js/MainAbility2/pages/index/index.css | 0 .../js/MainAbility2/pages/index/index.hml | 0 .../main/js/MainAbility2/pages/index/index.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../js/test/ApplicationInfoJsunit.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../fa/faconfigurationconstant/BUILD.gn | 0 .../fa/faconfigurationconstant/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../src/main/js/test/JsConfiguration.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../ability_runtime}/fa/facoverapi/BUILD.gn | 0 .../ability_runtime}/fa/facoverapi/Test.json | 0 .../fa/facoverapi/entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 38 + .../src/main/js/default/pages/index/index.hml | 21 + .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../entry/src/main/js/test/JsCoverApi.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../facoverapi/signature/openharmony_sx.p7b | Bin .../fa/faequeryabilitybywant/BUILD.gn | 0 .../fa/faequeryabilitybywant/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../js/MainAbility/pages/second/second.css | 0 .../js/MainAbility/pages/second/second.hml | 0 .../js/MainAbility/pages/second/second.js | 0 .../entry/src/main/js/MainAbility2/app.js | 0 .../src/main/js/MainAbility2/i18n/en-US.json | 0 .../src/main/js/MainAbility2/i18n/zh-CN.json | 0 .../js/MainAbility2/pages/index/index.css | 0 .../js/MainAbility2/pages/index/index.hml | 0 .../main/js/MainAbility2/pages/index/index.js | 0 .../js/MainAbility2/pages/second/second.css | 0 .../js/MainAbility2/pages/second/second.hml | 0 .../js/MainAbility2/pages/second/second.js | 0 .../entry/src/main/js/MainAbility3/app.js | 0 .../src/main/js/MainAbility3/i18n/en-US.json | 0 .../src/main/js/MainAbility3/i18n/zh-CN.json | 0 .../js/MainAbility3/pages/index/index.css | 0 .../js/MainAbility3/pages/index/index.hml | 0 .../main/js/MainAbility3/pages/index/index.js | 0 .../js/MainAbility3/pages/second/second.css | 0 .../js/MainAbility3/pages/second/second.hml | 0 .../js/MainAbility3/pages/second/second.js | 0 .../entry/src/main/js/MainAbility4/app.js | 0 .../src/main/js/MainAbility4/i18n/en-US.json | 0 .../src/main/js/MainAbility4/i18n/zh-CN.json | 0 .../js/MainAbility4/pages/index/index.css | 0 .../js/MainAbility4/pages/index/index.hml | 0 .../main/js/MainAbility4/pages/index/index.js | 0 .../js/MainAbility4/pages/second/second.css | 0 .../js/MainAbility4/pages/second/second.hml | 0 .../js/MainAbility4/pages/second/second.js | 0 .../src/main/js/ServiceAbility/service.js | 0 .../js/resources/base/element/string.json | 0 .../src/main/js/resources/base/media/icon.png | Bin .../src/main/js/test/JsAbilityDisable.test.js | 0 .../entry/src/main/js/test/List.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../ability_runtime}/featureability/BUILD.gn | 0 .../actsfeatureabilitytest/BUILD.gn | 0 .../actsfeatureabilitytest/Test.json | 0 .../entry/src/main/config.json | 119 ++ .../entry/src/main/js/default/app.js | 22 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 16 + .../src/main/js/resources/base/media/icon.png | Bin .../main/js/test/FeatureAbilityJsunit.test.js | 0 .../entry/src/main/js/test/List.test.js | 16 + .../main/js/test/StartAbilityJsunit.test.js | 0 .../signature/openharmony_sx.p7b | Bin .../finishwithresultemptytest/BUILD.gn | 0 .../finishwithresultemptytest/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 0 .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../BUILD.gn | 0 .../Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 0 .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../finishwithresulttest/BUILD.gn | 0 .../finishwithresulttest/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../finishwithresulttest/src/main/config.json | 0 .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../getcallingbundletest/BUILD.gn | 0 .../getcallingbundletest/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../getcallingbundletest/src/main/config.json | 0 .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../sceneproject/startability/BUILD.gn | 0 .../sceneproject/startability/Test.json | 0 .../startability/signature/openharmony_sx.p7b | Bin .../startability/src/main/config.json | 0 .../startability/src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../startabilityforresult/BUILD.gn | 0 .../startabilityforresult/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 0 .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../terminateabilitytest/BUILD.gn | 0 .../terminateabilitytest/Test.json | 0 .../signature/openharmony_sx.p7b | Bin .../terminateabilitytest/src/main/config.json | 0 .../src/main/js/default/app.js | 22 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../ability_runtime}/formmanager/BUILD.gn | 0 .../ability_runtime/formmanager/fa/BUILD.gn | 70 + .../fa/formhostst_ets/formsystemhost/BUILD.gn | 0 .../formhostst_ets/formsystemhost/Test.json | 3 + .../formsystemhost/entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 304 ++++ .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostb/BUILD.gn | 0 .../formhostst_ets/formsystemhostb/Test.json | 3 + .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 261 +++ .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostc/BUILD.gn | 32 + .../formhostst_ets/formsystemhostc/Test.json | 3 + .../entry/src/main/config.json | 140 ++ .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostd/BUILD.gn | 0 .../formhostst_ets/formsystemhostd/Test.json | 3 + .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 333 ++++ .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhoste/BUILD.gn | 0 .../formhostst_ets/formsystemhoste/Test.json | 3 + .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 416 +++++ .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostf/BUILD.gn | 32 + .../formhostst_ets/formsystemhostf/Test.json | 3 + .../entry/src/main/config.json | 132 ++ .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 439 +++++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostg/BUILD.gn | 32 + .../formhostst_ets/formsystemhostg/Test.json | 3 + .../entry/src/main/config.json | 124 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 502 ++++++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhosti/BUILD.gn | 0 .../formhostst_ets/formsystemhosti/Test.json | 3 + .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 290 +++ .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostj/BUILD.gn | 0 .../formhostst_ets/formsystemhostj/Test.json | 3 + .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 290 +++ .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostk/BUILD.gn | 32 + .../formhostst_ets/formsystemhostk/Test.json | 3 + .../entry/src/main/config.json | 143 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 610 +++++++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostl/BUILD.gn | 32 + .../formhostst_ets/formsystemhostl/Test.json | 3 + .../entry/src/main/config.json | 118 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 166 ++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostn/BUILD.gn | 32 + .../formhostst_ets/formsystemhostn/Test.json | 3 + .../entry/src/main/config.json | 124 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 455 +++++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsystemhostnoperm/BUILD.gn | 32 + .../formsystemhostnoperm/Test.json | 3 + .../entry/src/main/config.json | 137 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 333 ++++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhosto/BUILD.gn | 32 + .../formhostst_ets/formsystemhosto/Test.json | 3 + .../entry/src/main/config.json | 124 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 432 +++++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostst_ets/formsystemhostp/BUILD.gn | 32 + .../formhostst_ets/formsystemhostp/Test.json | 3 + .../entry/src/main/config.json | 124 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 422 +++++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationA/BUILD.gn | 0 .../formsupplyapplicationA/Test.json | 3 + .../entry/src/main/config.json | 141 ++ .../entry/src/main/ets/FormAbility/form.ts | 88 + .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../main/js/Form_Js001/pages/index/index.css | 19 + .../main/js/Form_Js001/pages/index/index.hml | 7 + .../main/js/Form_Js001/pages/index/index.json | 6 + .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationB/BUILD.gn | 0 .../formsupplyapplicationB/Test.json | 3 + .../entry/src/main/config.json | 139 ++ .../entry/src/main/ets/FormAbility/form.ts | 88 + .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/js/widget/common/image_1.png | Bin .../src/main/js/widget/common/image_2.png | Bin .../src/main/js/widget/common/img/close.svg | 0 .../src/main/js/widget/common/img/ic_HD1.png | Bin .../src/main/js/widget/common/img/ic_box.svg | 0 .../src/main/js/widget/common/img/ic_box1.png | Bin .../js/widget/common/img/ic_default_image.png | Bin .../widget/common/img/ic_default_image@3x.png | Bin .../js/widget/common/img/ic_default_white.png | Bin .../img/ic_device_earphone_hero_filled.svg | 0 .../img/ic_device_earphone_hero_filled1.png | Bin .../src/main/js/widget/common/img/ic_list.svg | 0 .../src/main/js/widget/common/img/ic_pad.svg | 0 .../src/main/js/widget/common/img/ic_pad1.png | Bin .../src/main/js/widget/common/img/ic_pc.svg | 0 .../src/main/js/widget/common/img/ic_pc1.png | Bin .../js/widget/common/img/ic_public_search.svg | 0 .../main/js/widget/common/img/ic_selfie.png | Bin .../src/main/js/widget/common/img/ic_tv.svg | 0 .../main/js/widget/common/img/ic_vision.svg | 0 .../src/main/js/widget/common/img/search.svg | 0 .../main/js/widget/common/img/superdevice.svg | 0 .../main/js/widget/common/img/template.png | Bin .../entry/src/main/js/widget/manifest.json | 0 .../src/main/js/widget/pages/index/index.json | 0 .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationC/BUILD.gn | 0 .../formsupplyapplicationC/Test.json | 3 + .../entry/src/main/config.json | 0 .../entry/src/main/ets/FormAbility/form.ts | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/js/widget/common/image_1.png | Bin .../src/main/js/widget/common/image_2.png | Bin .../src/main/js/widget/common/img/close.svg | 0 .../src/main/js/widget/common/img/ic_HD1.png | Bin .../src/main/js/widget/common/img/ic_box.svg | 0 .../src/main/js/widget/common/img/ic_box1.png | Bin .../js/widget/common/img/ic_default_image.png | Bin .../widget/common/img/ic_default_image@3x.png | Bin .../js/widget/common/img/ic_default_white.png | Bin .../img/ic_device_earphone_hero_filled.svg | 0 .../img/ic_device_earphone_hero_filled1.png | Bin .../src/main/js/widget/common/img/ic_list.svg | 22 + .../src/main/js/widget/common/img/ic_pad.svg | 0 .../src/main/js/widget/common/img/ic_pad1.png | Bin .../src/main/js/widget/common/img/ic_pc.svg | 0 .../src/main/js/widget/common/img/ic_pc1.png | Bin .../js/widget/common/img/ic_public_search.svg | 0 .../main/js/widget/common/img/ic_selfie.png | Bin .../src/main/js/widget/common/img/ic_tv.svg | 0 .../main/js/widget/common/img/ic_vision.svg | 29 + .../src/main/js/widget/common/img/search.svg | 0 .../main/js/widget/common/img/superdevice.svg | 0 .../main/js/widget/common/img/template.png | Bin .../entry/src/main/js/widget/manifest.json | 0 .../src/main/js/widget/pages/index/index.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationD/BUILD.gn | 0 .../formsupplyapplicationD/Test.json | 3 + .../entry/src/main/config.json | 139 ++ .../entry/src/main/ets/FormAbility/form.ts | 89 + .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/js/widget/common/image_1.png | Bin .../src/main/js/widget/common/image_2.png | Bin .../src/main/js/widget/common/img/close.svg | 0 .../src/main/js/widget/common/img/ic_HD1.png | Bin .../src/main/js/widget/common/img/ic_box.svg | 0 .../src/main/js/widget/common/img/ic_box1.png | Bin .../js/widget/common/img/ic_default_image.png | Bin .../widget/common/img/ic_default_image@3x.png | Bin .../js/widget/common/img/ic_default_white.png | Bin .../img/ic_device_earphone_hero_filled.svg | 0 .../img/ic_device_earphone_hero_filled1.png | Bin .../src/main/js/widget/common/img/ic_list.svg | 22 + .../src/main/js/widget/common/img/ic_pad.svg | 0 .../src/main/js/widget/common/img/ic_pad1.png | Bin .../src/main/js/widget/common/img/ic_pc.svg | 0 .../src/main/js/widget/common/img/ic_pc1.png | Bin .../js/widget/common/img/ic_public_search.svg | 0 .../main/js/widget/common/img/ic_selfie.png | Bin .../src/main/js/widget/common/img/ic_tv.svg | 0 .../main/js/widget/common/img/ic_vision.svg | 29 + .../src/main/js/widget/common/img/search.svg | 0 .../main/js/widget/common/img/superdevice.svg | 0 .../main/js/widget/common/img/template.png | Bin .../entry/src/main/js/widget/manifest.json | 0 .../src/main/js/widget/pages/index/index.json | 0 .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationE/BUILD.gn | 0 .../formsupplyapplicationE/Test.json | 3 + .../entry/src/main/config.json | 141 ++ .../entry/src/main/ets/FormAbility/form.ts | 99 + .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../src/main/js/widget/common/image_1.png | Bin .../src/main/js/widget/common/image_2.png | Bin .../src/main/js/widget/common/img/close.svg | 0 .../src/main/js/widget/common/img/ic_HD1.png | Bin .../src/main/js/widget/common/img/ic_box.svg | 0 .../src/main/js/widget/common/img/ic_box1.png | Bin .../js/widget/common/img/ic_default_image.png | Bin .../widget/common/img/ic_default_image@3x.png | Bin .../js/widget/common/img/ic_default_white.png | Bin .../img/ic_device_earphone_hero_filled.svg | 0 .../img/ic_device_earphone_hero_filled1.png | Bin .../src/main/js/widget/common/img/ic_list.svg | 22 + .../src/main/js/widget/common/img/ic_pad.svg | 0 .../src/main/js/widget/common/img/ic_pad1.png | Bin .../src/main/js/widget/common/img/ic_pc.svg | 0 .../src/main/js/widget/common/img/ic_pc1.png | Bin .../js/widget/common/img/ic_public_search.svg | 0 .../main/js/widget/common/img/ic_selfie.png | Bin .../src/main/js/widget/common/img/ic_tv.svg | 0 .../main/js/widget/common/img/ic_vision.svg | 29 + .../src/main/js/widget/common/img/search.svg | 0 .../main/js/widget/common/img/superdevice.svg | 0 .../main/js/widget/common/img/template.png | Bin .../entry/src/main/js/widget/manifest.json | 0 .../src/main/js/widget/pages/index/index.json | 0 .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationF/BUILD.gn | 0 .../formsupplyapplicationF/Test.json | 3 + .../entry/src/main/config.json | 0 .../entry/src/main/ets/FormAbility/form.ts | 143 ++ .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../src/main/js/Form_Js001/common/image_1.png | Bin .../src/main/js/Form_Js001/common/image_2.png | Bin .../main/js/Form_Js001/common/img/close.svg | 0 .../main/js/Form_Js001/common/img/ic_HD1.png | Bin .../main/js/Form_Js001/common/img/ic_box.svg | 0 .../main/js/Form_Js001/common/img/ic_box1.png | Bin .../common/img/ic_default_image.png | Bin .../common/img/ic_default_image@3x.png | Bin .../common/img/ic_default_white.png | Bin .../img/ic_device_earphone_hero_filled.svg | 0 .../img/ic_device_earphone_hero_filled1.png | Bin .../main/js/Form_Js001/common/img/ic_list.svg | 22 + .../main/js/Form_Js001/common/img/ic_pad.svg | 0 .../main/js/Form_Js001/common/img/ic_pad1.png | Bin .../main/js/Form_Js001/common/img/ic_pc.svg | 0 .../main/js/Form_Js001/common/img/ic_pc1.png | Bin .../common/img/ic_public_search.svg | 0 .../js/Form_Js001/common/img/ic_selfie.png | Bin .../main/js/Form_Js001/common/img/ic_tv.svg | 0 .../js/Form_Js001/common/img/ic_vision.svg | 29 + .../main/js/Form_Js001/common/img/search.svg | 0 .../js/Form_Js001/common/img/superdevice.svg | 0 .../js/Form_Js001/common/img/template.png | Bin .../src/main/js/Form_Js001/manifest.json | 0 .../main/js/Form_Js001/pages/index/index.json | 0 .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationG/BUILD.gn | 0 .../formsupplyapplicationG/Test.json | 3 + .../entry/src/main/config.json | 124 ++ .../entry/src/main/ets/FormAbility/form.ts | 155 ++ .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../src/main/js/Form_Js001/common/image_1.png | Bin .../src/main/js/Form_Js001/common/image_2.png | Bin .../main/js/Form_Js001/common/img/close.svg | 0 .../main/js/Form_Js001/common/img/ic_HD1.png | Bin .../main/js/Form_Js001/common/img/ic_box.svg | 0 .../main/js/Form_Js001/common/img/ic_box1.png | Bin .../common/img/ic_default_image.png | Bin .../common/img/ic_default_image@3x.png | Bin .../common/img/ic_default_white.png | Bin .../img/ic_device_earphone_hero_filled.svg | 0 .../img/ic_device_earphone_hero_filled1.png | Bin .../main/js/Form_Js001/common/img/ic_list.svg | 22 + .../main/js/Form_Js001/common/img/ic_pad.svg | 0 .../main/js/Form_Js001/common/img/ic_pad1.png | Bin .../main/js/Form_Js001/common/img/ic_pc.svg | 0 .../main/js/Form_Js001/common/img/ic_pc1.png | Bin .../common/img/ic_public_search.svg | 0 .../js/Form_Js001/common/img/ic_selfie.png | Bin .../main/js/Form_Js001/common/img/ic_tv.svg | 0 .../js/Form_Js001/common/img/ic_vision.svg | 29 + .../main/js/Form_Js001/common/img/search.svg | 0 .../js/Form_Js001/common/img/superdevice.svg | 0 .../js/Form_Js001/common/img/template.png | Bin .../src/main/js/Form_Js001/manifest.json | 0 .../main/js/Form_Js001/pages/index/index.json | 0 .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationH/BUILD.gn | 0 .../formsupplyapplicationH/Test.json | 3 + .../entry/src/main/config.json | 141 ++ .../entry/src/main/ets/FormAbility/form.ts | 99 + .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../src/main/js/widget/common/image_1.png | Bin .../src/main/js/widget/common/image_2.png | Bin .../src/main/js/widget/common/img/close.svg | 0 .../src/main/js/widget/common/img/ic_HD1.png | Bin .../src/main/js/widget/common/img/ic_box.svg | 0 .../src/main/js/widget/common/img/ic_box1.png | Bin .../js/widget/common/img/ic_default_image.png | Bin .../widget/common/img/ic_default_image@3x.png | Bin .../js/widget/common/img/ic_default_white.png | Bin .../img/ic_device_earphone_hero_filled.svg | 0 .../img/ic_device_earphone_hero_filled1.png | Bin .../src/main/js/widget/common/img/ic_list.svg | 22 + .../src/main/js/widget/common/img/ic_pad.svg | 0 .../src/main/js/widget/common/img/ic_pad1.png | Bin .../src/main/js/widget/common/img/ic_pc.svg | 0 .../src/main/js/widget/common/img/ic_pc1.png | Bin .../js/widget/common/img/ic_public_search.svg | 0 .../main/js/widget/common/img/ic_selfie.png | Bin .../src/main/js/widget/common/img/ic_tv.svg | 0 .../main/js/widget/common/img/ic_vision.svg | 29 + .../src/main/js/widget/common/img/search.svg | 0 .../main/js/widget/common/img/superdevice.svg | 0 .../main/js/widget/common/img/template.png | Bin .../entry/src/main/js/widget/manifest.json | 0 .../src/main/js/widget/pages/index/index.json | 0 .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsupplyapplicationNotSysApp/BUILD.gn | 0 .../formsupplyapplicationNotSysApp/Test.json | 3 + .../entry/src/main/config.json | 141 ++ .../entry/src/main/ets/FormAbility/form.ts | 99 + .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../src/main/ets/MainAbility/pages/second.ets | 0 .../main/js/Form_Js001/pages/index/index.css | 19 + .../main/js/Form_Js001/pages/index/index.hml | 7 + .../main/js/Form_Js001/pages/index/index.json | 6 + .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsystemprovidera/BUILD.gn | 32 + .../formsystemprovidera/Test.json | 3 + .../entry/src/main/config.json | 173 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 62 + .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsystemproviderb/BUILD.gn | 32 + .../formsystemproviderb/Test.json | 3 + .../entry/src/main/config.json | 144 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 62 + .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsystemproviderc/BUILD.gn | 32 + .../formsystemproviderc/Test.json | 3 + .../entry/src/main/config.json | 144 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 62 + .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsystemproviderd/BUILD.gn | 32 + .../formsystemproviderd/Test.json | 3 + .../entry/src/main/config.json | 116 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 62 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formacquiretest/BUILD.gn | 0 .../formacquiretest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../MainAbility/test/FmsAcquireForm.test.ets | 1594 +++++++++++++++++ .../main/ets/MainAbility/test/List.test.ets | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formacquiretest2/BUILD.gn | 32 + .../formacquiretest2/Test.json | 23 + .../entry/src/main/config.json | 141 ++ .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 68 + .../MainAbility/test/FmsAcquireForm2.test.ets | 501 ++++++ .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formdeletetest/BUILD.gn | 0 .../formdeletetest/Test.json | 0 .../formdeletetest/entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../MainAbility/test/FmsDeleteForm.test.ets | 1178 ++++++++++++ .../main/ets/MainAbility/test/List.test.ets | 0 .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formdynamicrefreshtest/BUILD.gn | 0 .../formdynamicrefreshtest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 0 .../test/FmsDynamicRefreshForm.test.ets | 448 +++++ .../main/ets/MainAbility/test/List.test.ets | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsystemtest_ets/formfuzztest/BUILD.gn | 0 .../formsystemtest_ets/formfuzztest/Test.json | 18 + .../formfuzztest/entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 64 + .../test/CastTempFormFuzz.test.ets | 82 + .../MainAbility/test/DeleteFormFuzz.test.ets | 82 + .../test/DisableFormsUpdateFuzz.test.ets | 82 + .../test/EnableFormsUpdateFuzz.test.ets | 82 + .../test/GetFormsInfoFuzz.test.ets | 233 +++ .../main/ets/MainAbility/test/List.test.ets | 61 + .../test/NotifyInvisibleFormsFuzz.test.ets | 82 + .../test/NotifyVisibleFormsFuzz.test.ets | 82 + .../MainAbility/test/ReleaseFormFuzz.test.ets | 218 +++ .../MainAbility/test/RequestFormFuzz.test.ets | 82 + .../test/SetFormNextRefreshTimeFuzz.test.ets | 168 ++ .../MainAbility/test/UpdateFormFuzz.test.ets | 142 ++ .../main/ets/MainAbility/test/getParam.ets | 171 ++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../formfuzztest/signature/openharmony_sx.p7b | Bin .../formsoneandonetest/BUILD.gn | 0 .../formsoneandonetest/Test.json | 20 + .../entry/src/main/config.json | 114 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 64 + .../MainAbility/test/GetAllFormsInfo.test.ets | 146 ++ .../MainAbility/test/GetFormsInfo.test.ets | 521 ++++++ .../main/ets/MainAbility/test/List.test.ets | 30 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsoneandtwotest/BUILD.gn | 0 .../formsoneandtwotest/Test.json | 20 + .../entry/src/main/config.json | 114 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 64 + .../MainAbility/test/GetAllFormsInfo.test.ets | 169 ++ .../main/ets/MainAbility/test/List.test.ets | 20 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formsoneandzerotest/BUILD.gn | 0 .../formsoneandzerotest/Test.json | 20 + .../entry/src/main/config.json | 114 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 64 + .../MainAbility/test/GetAllFormsInfo.test.ets | 125 ++ .../main/ets/MainAbility/test/List.test.ets | 20 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formswithoutpermtest/BUILD.gn | 0 .../formswithoutpermtest/Test.json | 18 + .../entry/src/main/config.json | 110 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 64 + .../MainAbility/test/GetAllFormsInfo.test.ets | 72 + .../MainAbility/test/GetFormsInfo.test.ets | 125 ++ .../main/ets/MainAbility/test/List.test.ets | 24 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formszerotest/BUILD.gn | 0 .../formszerotest/Test.json | 19 + .../formszerotest/entry/src/main/config.json | 114 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 64 + .../MainAbility/test/GetAllFormsInfo.test.ets | 84 + .../main/ets/MainAbility/test/List.test.ets | 20 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formhostdeathrecipienttest/BUILD.gn | 0 .../formhostdeathrecipienttest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 0 .../src/main/ets/MainAbility/pages/index.ets | 68 + .../test/FmsHostDeathRecipient.test.ets | 0 .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formperformancetest/BUILD.gn | 0 .../formperformancetest/Test.json | 20 + .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 68 + .../test/FmsPerformanceTest.test.ets | 940 ++++++++++ .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formreleasetest/BUILD.gn | 0 .../formreleasetest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 0 .../MainAbility/test/FmsReleaseForm.test.ets | 580 ++++++ .../main/ets/MainAbility/test/List.test.ets | 0 .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formstatetest_disable/BUILD.gn | 0 .../formstatetest_disable/Test.json | 25 + .../entry/src/main/config.json | 150 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 68 + .../test/FmsFormStateDisable.test.ets | 793 ++++++++ .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formstatetest_enable/BUILD.gn | 0 .../formstatetest_enable/Test.json | 25 + .../entry/src/main/config.json | 150 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 68 + .../test/FmsFormStateEnable.test.ets | 904 ++++++++++ .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formstatetest_notifyinvisible/BUILD.gn | 0 .../formstatetest_notifyinvisible/Test.json | 23 + .../entry/src/main/config.json | 150 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 68 + .../test/FmsFormStateNotifyInvisible.test.ets | 544 ++++++ .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formstatetest_notifyinvisible2/BUILD.gn | 32 + .../formstatetest_notifyinvisible2/Test.json | 24 + .../entry/src/main/config.json | 150 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 68 + .../FmsFormStateNotifyInvisible2.test.ets | 821 +++++++++ .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formstatetest_notifyvisible/BUILD.gn | 0 .../formstatetest_notifyvisible/Test.json | 29 + .../entry/src/main/config.json | 150 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 68 + .../test/FmsFormStateNotifyVisible.test.ets | 1383 ++++++++++++++ .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formstresstest/BUILD.gn | 0 .../formstresstest/Test.json | 21 + .../formstresstest/entry/src/main/config.json | 169 ++ .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 68 + .../ets/MainAbility/test/FmsStress.test.ets | 601 +++++++ .../main/ets/MainAbility/test/List.test.ets | 19 + .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../formupdatefreshtest/BUILD.gn | 0 .../formupdatefreshtest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/ets/MainAbility/app.ets | 23 + .../src/main/ets/MainAbility/pages/index.ets | 0 .../test/FmsUpdateRefreshForm.test.ets | 720 ++++++++ .../main/ets/MainAbility/test/List.test.ets | 0 .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 51 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 37 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../ActsKillProcessWithAccountTest/BUILD.gn | 0 .../ActsKillProcessWithAccountTest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../killprocesswithaccountstage/BUILD.gn | 0 .../ability_runtime}/newwant/BUILD.gn | 0 .../newwant/actsnewwantapi7relyhap/BUILD.gn | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 23 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../actsnewwantarelyhap/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../newwant/actsnewwantarelyhap/BUILD.gn | 0 .../newwant/actsnewwantarelyhap/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../actsnewwantbrelyhap/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../newwant/actsnewwantbrelyhap/BUILD.gn | 0 .../newwant/actsnewwantbrelyhap/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../actsnewwantrelyhap/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../newwant/actsnewwantrelyhap/BUILD.gn | 0 .../newwant/actsnewwantrelyhap/Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../main/ets/SecondAbility/SecondAbility.ts | 146 ++ .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../newwant/actsnewwanttest/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../newwant/actsnewwanttest/BUILD.gn | 0 .../newwant/actsnewwanttest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 24 + .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 653 +++++++ .../entry/src/main/ets/test/List.test.ets | 23 + .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../ability_runtime}/non_concurrent/BUILD.gn | 0 .../acts_systemappa_test/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../acts_systemappa_test/BUILD.gn | 0 .../acts_systemappa_test/Test.json | 62 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 51 + .../src/main/ets/MainAbility2/MainAbility2.ts | 57 + .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../entry/src/main/ets/pages/index/index2.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../main/ets/test/AbilityPermission.test.ets | 274 +++ .../entry/src/main/ets/test/List.test.ets | 19 + .../entry/src/main/module.json | 121 ++ .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../acts_systemappone_rely_test/BUILD.gn | 0 .../acts_systemappone_rely_test/Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 59 + .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../src/main/ets/ServiceAbility/service.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 48 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../processmultiinstance/BUILD.gn | 0 .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 56 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 37 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 56 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 38 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 59 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 37 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 59 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 37 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 59 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 38 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 59 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 38 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 59 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 38 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../BUILD.gn | 0 .../Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 59 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 38 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../actsamsprocessmultiinstancetest/BUILD.gn | 0 .../actsamsprocessmultiinstancetest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin ability/ability_runtime/stage/BUILD.gn | 26 + .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../stage/actslifecyclemultihap2test/BUILD.gn | 40 + .../actslifecyclemultihap2test/Test.json | 18 + .../src/main/ets/Application/AbilityStage.ts | 0 .../ets/Hap2MainAbility1/Hap2MainAbility1.ts | 49 + .../Hap2MainAbility10/Hap2MainAbility10.ts | 49 + .../ets/Hap2MainAbility2/Hap2MainAbility2.ts | 48 + .../ets/Hap2MainAbility3/Hap2MainAbility3.ts | 56 + .../ets/Hap2MainAbility4/Hap2MainAbility4.ts | 56 + .../ets/Hap2MainAbility5/Hap2MainAbility5.ts | 56 + .../ets/Hap2MainAbility6/Hap2MainAbility6.ts | 55 + .../ets/Hap2MainAbility7/Hap2MainAbility7.ts | 56 + .../ets/Hap2MainAbility8/Hap2MainAbility8.ts | 56 + .../ets/Hap2MainAbility9/Hap2MainAbility9.ts | 56 + .../ets/pages/Hap2MainAbility10_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility1_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility2_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility3_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility4_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility5_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility6_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility7_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility8_pages.ets | 31 + .../main/ets/pages/Hap2MainAbility9_pages.ets | 31 + .../entry/src/main/module.json | 121 ++ .../main/resources/base/element/string.json | 120 ++ .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../stage/actslifecyclemultihap3test/BUILD.gn | 40 + .../actslifecyclemultihap3test/Test.json | 18 + .../src/main/ets/Application/AbilityStage.ts | 0 .../ets/Hap3MainAbility1/Hap3MainAbility1.ts | 49 + .../ets/Hap3MainAbility2/Hap3MainAbility2.ts | 56 + .../ets/Hap3MainAbility3/Hap3MainAbility3.ts | 49 + .../main/ets/pages/Hap3MainAbility1_pages.ets | 31 + .../main/ets/pages/Hap3MainAbility2_pages.ets | 31 + .../main/ets/pages/Hap3MainAbility3_pages.ets | 31 + .../entry/src/main/module.json | 70 + .../main/resources/base/element/string.json | 64 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../stage/actslifecyclemultihaptest/BUILD.gn | 40 + .../stage/actslifecyclemultihaptest/Test.json | 20 + .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 49 + .../src/main/ets/MainAbility1/MainAbility1.ts | 116 ++ .../src/main/ets/MainAbility2/MainAbility2.ts | 104 ++ .../src/main/ets/MainAbility3/MainAbility3.ts | 132 ++ .../src/main/ets/MainAbility4/MainAbility4.ts | 97 + .../src/main/ets/MainAbility5/MainAbility5.ts | 104 ++ .../src/main/ets/MainAbility6/MainAbility6.ts | 97 + .../src/main/ets/pages/MainAbility1_pages.ets | 32 + .../src/main/ets/pages/MainAbility2_pages.ets | 32 + .../src/main/ets/pages/MainAbility3_pages.ets | 31 + .../src/main/ets/pages/MainAbility4_pages.ets | 32 + .../src/main/ets/pages/MainAbility5_pages.ets | 32 + .../src/main/ets/pages/MainAbility6_pages.ets | 32 + .../src/main/ets/pages/MainAbility_pages.ets | 57 + .../entry/src/main/ets/test/LifecycleTest.ets | 793 ++++++++ .../entry/src/main/ets/test/ListTest.ets | 21 + .../entry/src/main/module.json | 99 + .../main/resources/base/element/string.json | 84 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../ets/Hap4MainAbility1/Hap4MainAbility1.ts | 57 + .../main/ets/pages/Hap4MainAbility1_pages.ets | 32 + .../hap4/src/main/module.json | 57 + .../main/resources/base/element/string.json | 48 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../stage/actslifecyclesinglehaptest/BUILD.gn | 40 + .../actslifecyclesinglehaptest/Test.json | 18 + .../src/main/ets/Application/AbilityStage.ts | 0 .../ets/Hap1MainAbility1/Hap1MainAbility1.ts | 55 + .../ets/Hap1MainAbility2/Hap1MainAbility2.ts | 56 + .../src/main/ets/MainAbility/MainAbility.ts | 48 + .../src/main/ets/MainAbility1/MainAbility1.ts | 131 ++ .../main/ets/MainAbility10/MainAbility10.ts | 116 ++ .../main/ets/MainAbility11/MainAbility11.ts | 110 ++ .../main/ets/MainAbility12/MainAbility12.ts | 109 ++ .../src/main/ets/MainAbility2/MainAbility2.ts | 56 + .../src/main/ets/MainAbility3/MainAbility3.ts | 132 ++ .../src/main/ets/MainAbility4/MainAbility4.ts | 140 ++ .../src/main/ets/MainAbility5/MainAbility5.ts | 56 + .../src/main/ets/MainAbility6/MainAbility6.ts | 130 ++ .../src/main/ets/MainAbility7/MainAbility7.ts | 130 ++ .../src/main/ets/MainAbility8/MainAbility8.ts | 130 ++ .../src/main/ets/MainAbility9/MainAbility9.ts | 98 + .../entry/src/main/ets/pages/index.ets | 55 + .../entry/src/main/ets/pages/index1.ets | 27 + .../entry/src/main/ets/pages/index10.ets | 27 + .../entry/src/main/ets/pages/index11.ets | 27 + .../entry/src/main/ets/pages/index12.ets | 27 + .../entry/src/main/ets/pages/index2.ets | 27 + .../entry/src/main/ets/pages/index3.ets | 27 + .../entry/src/main/ets/pages/index4.ets | 27 + .../entry/src/main/ets/pages/index5.ets | 27 + .../entry/src/main/ets/pages/index6.ets | 27 + .../entry/src/main/ets/pages/index7.ets | 27 + .../entry/src/main/ets/pages/index8.ets | 27 + .../entry/src/main/ets/pages/index9.ets | 27 + .../entry/src/main/ets/pages/indexh1a1.ets | 27 + .../entry/src/main/ets/pages/indexh1a2.ets | 27 + .../entry/src/main/ets/test/LifeCycleTest.ets | 1593 ++++++++++++++++ .../entry/src/main/ets/test/ListTest.ets | 19 + .../entry/src/main/module.json | 136 ++ .../main/resources/base/element/string.json | 160 ++ .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 0 .../signature/openharmony_sx.p7b | Bin .../ability_runtime}/want/BUILD.gn | 0 .../want/actsgetwantalltest/BUILD.gn | 0 .../want/actsgetwantalltest/Test.json | 0 .../entry/src/main/config.json | 0 .../entry/src/main/js/default/app.js | 23 + .../entry/src/main/js/default/i18n/en-US.json | 0 .../entry/src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../src/main/js/test/ActsGetWantAllTest.js | 0 .../entry/src/main/js/test/List.test.js | 16 + .../signature/openharmony_sx.p7b | Bin .../actsgetwantalltesthap/BUILD.gn | 0 .../signature/openharmony_sx.p7b | Bin .../src/main/config.json | 0 .../src/main/js/default/app.js | 23 + .../src/main/js/default/i18n/en-US.json | 0 .../src/main/js/default/i18n/zh-CN.json | 0 .../src/main/js/default/pages/index/index.css | 0 .../src/main/js/default/pages/index/index.hml | 0 .../src/main/js/default/pages/index/index.js | 0 .../js/resources/base/element/string.json | 12 + .../src/main/js/resources/base/media/icon.png | Bin .../ability_runtime}/zidltest/BUILD.gn | 0 .../actsamszidlclienttest/AppScope/app.json | 0 .../resources/base/element/string.json | 0 .../resources/base/media/app_icon.png | Bin .../zidltest/actsamszidlclienttest/BUILD.gn | 0 .../zidltest/actsamszidlclienttest/Test.json | 0 .../src/main/ets/Application/AbilityStage.ts | 0 .../src/main/ets/MainAbility/MainAbility.ts | 0 .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../interfaceDeclare/i_interface_declare.ts | 21 + .../interface_declare_proxy.ts | 44 + .../interface_declare_stub.ts | 47 + .../src/main/ets/ServiceAbility/service.ts | 0 .../zidlTool/i_zidl_tool_test.ts | 0 .../zidlTool/my_sequenceable.ts | 28 + .../zidlTool/zidl_tool_test_stub.ts | 0 .../ets/ServiceAbility2/ServiceAbility2.ts | 0 .../src/main/ets/ServiceAbility2/service.ts | 0 ..._interface_attribute_declaratoin_oneway.ts | 25 + ...rface_attribute_declaratoin_oneway_stub.ts | 64 + .../interfaceDeclare/i_interface_declare.ts | 21 + .../interface_declare_proxy.ts | 44 + .../interface_declare_stub.ts | 47 + .../entry/src/main/ets/pages/index.ets | 0 .../entry/src/main/ets/pages/index/index.ets | 0 .../entry/src/main/ets/pages/second.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/ets/test/Ability.test.ets | 0 .../entry/src/main/ets/test/List.test.ets | 0 .../src/main/ets/zidlTool/i_zidl_tool_test.ts | 0 .../src/main/ets/zidlTool/my_sequenceable.ts | 28 + .../main/ets/zidlTool/zidl_tool_test_proxy.ts | 0 ..._interface_attribute_declaratoin_oneway.ts | 25 + ...face_attribute_declaratoin_oneway_proxy.ts | 0 .../entry/src/main/module.json | 0 .../main/resources/base/element/string.json | 0 .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin .../actsamszidlservice/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin .../zidltest/actsamszidlservice/BUILD.gn | 0 .../zidltest/actsamszidlservice/Test.json | 3 + .../src/main/ets/Application/AbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 51 + .../main/ets/ServiceAbility/ServiceAbility.ts | 0 .../interfaceDeclare/i_interface_declare.ts | 21 + .../interface_declare_proxy.ts | 44 + .../interface_declare_stub.ts | 47 + .../src/main/ets/ServiceAbility/service.ts | 0 .../zidlTool/i_zidl_tool_test.ts | 0 .../zidlTool/my_sequenceable.ts | 28 + .../zidlTool/zidl_tool_test_stub.ts | 0 .../ets/ServiceAbility2/ServiceAbility2.ts | 0 .../src/main/ets/ServiceAbility2/service.ts | 0 ..._interface_attribute_declaratoin_oneway.ts | 25 + ...rface_attribute_declaratoin_oneway_stub.ts | 64 + .../entry/src/main/ets/pages/index/index.ets | 0 .../src/main/ets/pages/second/second.ets | 0 .../entry/src/main/module.json | 99 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin .../resources/base/profile/main_pages.json | 6 + .../signature/openharmony_sx.p7b | Bin test_packages.gni | 2 +- 3178 files changed, 61609 insertions(+), 61628 deletions(-) delete mode 100644 aafwk/BUILD.gn delete mode 100755 aafwk/aafwk_standard/BUILD.gn delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/config.json delete mode 100644 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.css delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.hml delete mode 100755 aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/Test.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/Test.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/Test.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/Test.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/SecondAbility/SecondAbility.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/ThirdAbility/ThirdAbility.ts delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/BUILD.gn delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/Test.json delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility/service.ts delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility2/service.ts delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility3/service.ts delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility4/service.ts delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility5/service.ts delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility6/service.ts delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility7/service.ts delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/Utils.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets delete mode 100644 aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/SecondAbility/SecondAbility.ts delete mode 100755 aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/ThirdAbility/ThirdAbility.ts delete mode 100755 aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/SecondAbility/SecondAbility.ts delete mode 100755 aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/ThirdAbility/ThirdAbility.ts delete mode 100755 aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/SecondAbility/SecondAbility.ts delete mode 100755 aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/FifthAbility/FifthAbility.ts delete mode 100755 aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/ForthAbility/ForthAbility.ts delete mode 100755 aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/SecondAbility/SecondAbility.ts delete mode 100755 aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/ThirdAbility/ThirdAbility.ts delete mode 100644 aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts delete mode 100644 aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/Test.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/Test.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/Test.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/Test.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/Test.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/Test.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/Test.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/index/index.ets delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/Test.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/Test.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/Test.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/Test.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/Test.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets delete mode 100644 aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/SecondMainAbility/SecondMainAbility.ts delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/Test.json delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100755 aafwk/aafwk_standard/context/actscontexttest/entry/src/main/config.json delete mode 100755 aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/List.test.js delete mode 100755 aafwk/aafwk_standard/context/scene/defpermission/src/main/config.json delete mode 100755 aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/context/scene/defpermission/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js delete mode 100755 aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/FormAbility/form.ts delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.css delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.hml delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/FormAbility/form.ts delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_list.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_vision.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/FormAbility/form.ts delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_list.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_vision.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/FormAbility/form.ts delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_list.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_vision.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/FormAbility/form.ts delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_list.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_vision.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/FormAbility/form.ts delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_list.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_vision.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/FormAbility/form.ts delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_list.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_vision.svg delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/FormAbility/form.ts delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.css delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.hml delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/CastTempFormFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DeleteFormFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DisableFormsUpdateFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/EnableFormsUpdateFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/GetFormsInfoFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyInvisibleFormsFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyVisibleFormsFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/ReleaseFormFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/RequestFormFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/SetFormNextRefreshTimeFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/UpdateFormFuzz.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/getParam.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/BUILD.gn delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/Test.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/app.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/pages/index.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/List.test.ets delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets delete mode 100755 aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/Test.json delete mode 100755 aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/app.js delete mode 100755 aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts delete mode 100755 aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets delete mode 100755 aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/test/List.test.ets delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/Test.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/List.test.ets delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/Test.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/Test.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/Test.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/Test.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/Test.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/Test.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/Test.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/Test.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/Test.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/profile/main_pages.json delete mode 100644 aafwk/aafwk_standard/stage/BUILD.gn delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/BUILD.gn delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/Test.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility1/Hap2MainAbility1.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility10/Hap2MainAbility10.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility2/Hap2MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility3/Hap2MainAbility3.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility4/Hap2MainAbility4.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility5/Hap2MainAbility5.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility6/Hap2MainAbility6.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility7/Hap2MainAbility7.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility8/Hap2MainAbility8.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility9/Hap2MainAbility9.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility10_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility1_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility2_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility3_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility4_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility5_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility6_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility7_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility8_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility9_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/BUILD.gn delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/Test.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility1/Hap3MainAbility1.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility2/Hap3MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility3/Hap3MainAbility3.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility1_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility2_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility3_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/BUILD.gn delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/Test.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility1_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility2_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility3_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility4_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility5_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility6_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/test/ListTest.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/Hap4MainAbility1/Hap4MainAbility1.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/pages/Hap4MainAbility1_pages.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/module.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/app.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/BUILD.gn delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/Test.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility10/MainAbility10.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility11/MainAbility11.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility12/MainAbility12.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility7/MainAbility7.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility8/MainAbility8.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility9/MainAbility9.ts delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index1.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index10.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index11.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index12.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index2.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index3.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index4.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index5.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index6.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index7.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index8.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index9.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a1.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a2.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/ListTest.ets delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/module.json delete mode 100644 aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/resources/base/element/string.json delete mode 100644 aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/List.test.js delete mode 100644 aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/app.js delete mode 100644 aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/app.json delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/Test.json delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/module.json delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json delete mode 100755 aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json create mode 100644 ability/BUILD.gn create mode 100644 ability/ability_runtime/BUILD.gn rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfifthscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfifthscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/config.json rename {aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest => ability/ability_runtime/abilitymanager/actsamscallbackfifthscene}/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard/fa/faconfigurationconstant => ability/ability_runtime/abilitymanager/actsamscallbackfifthscene}/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard/fa/faconfigurationconstant => ability/ability_runtime/abilitymanager/actsamscallbackfifthscene}/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard/fa/faconfigurationconstant => ability/ability_runtime/abilitymanager/actsamscallbackfifthscene}/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfifthscene/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfirstscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfirstscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/config.json rename {aafwk/aafwk_standard/amsdatauriutils => ability/ability_runtime/abilitymanager/actsamscallbackfirstscene}/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard/fa/facoverapi => ability/ability_runtime/abilitymanager/actsamscallbackfirstscene}/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard/fa/facoverapi => ability/ability_runtime/abilitymanager/actsamscallbackfirstscene}/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard/fa/facoverapi => ability/ability_runtime/abilitymanager/actsamscallbackfirstscene}/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfirstscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfourthscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfourthscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/config.json rename {aafwk/aafwk_standard/fa/faconfigurationconstant => ability/ability_runtime/abilitymanager/actsamscallbackfourthscene}/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackfourthscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard/fa/facoverapi => ability/ability_runtime/abilitymanager/actsamscallbacksecondscene}/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbacksecondscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackthirdscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackthirdscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamscallbackthirdscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfifthscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfifthscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfifthscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfirstscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfirstscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfirstscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfourthscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfourthscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestfourthscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestsecondscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestsecondscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestsecondscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestthirdscene/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestthirdscene/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/List.test.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/actsamstestthirdscene/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateEAbility/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateEAbility/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateEAbility/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilityFir/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilityFir/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilityFir/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilitySed/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilitySed/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilitySed/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyAAbility/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyAAbility/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyAAbility/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyIAbility/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyIAbility/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyIAbility/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/config.json create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/app.json create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappa/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa}/Test.json (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappa/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/app.json create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappb/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb}/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actscalltest/systemappcalleea => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappb/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/app.json create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappc/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc}/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actscalltest/systemappcallera => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappc/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/app.json create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappd/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd}/Test.json (100%) create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/SecondAbility/SecondAbility.ts create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/ThirdAbility/ThirdAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json create mode 100644 ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actscalltest/systemappcallerb => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappd/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/app.js (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/en-US.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/zh-CN.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.css (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.hml (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/List.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actscalltest/systemappcallerc => ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/abilitymultiinstance/amsabilitymultiinstancetest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/test/ActsAbilityDelegatorCaseTest.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitydelegatorcase/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/test/ActsAbilityLifecycleStateNewTest.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitylifecyclestatenew/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/actsabilitymanageretstest/BUILD.gn create mode 100644 ability/ability_runtime/actsabilitymanageretstest/Test.json create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/config.json create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility/service.ts create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility2/service.ts create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility3/service.ts create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility4/service.ts create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility5/service.ts create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility6/service.ts create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility7/service.ts create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/Utils.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets create mode 100644 ability/ability_runtime/actsabilitymanageretstest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitymanageretstest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsabilitymanageretstest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/SecondAbility/SecondAbility.ts create mode 100644 ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/ThirdAbility/ThirdAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actscalltest/systemcallentrytest => ability/ability_runtime/actscalltest/systemappcalleea}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcalleea/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/SecondAbility/SecondAbility.ts create mode 100644 ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/ThirdAbility/ThirdAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actscalltest/systemcallfeature => ability/ability_runtime/actscalltest/systemappcallera}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallera/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actscalltest/thirdappa => ability/ability_runtime/actscalltest/systemappcallerb}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerb/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actscalltest/thirdcalltest => ability/ability_runtime/actscalltest/systemappcallerc}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemappcallerc/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/SecondAbility/SecondAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest => ability/ability_runtime/actscalltest/systemcallentrytest}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallentrytest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest => ability/ability_runtime/actscalltest/systemcallfeature}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/systemcallfeature/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest => ability/ability_runtime/actscalltest/thirdappa}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdappa/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/FifthAbility/FifthAbility.ts create mode 100644 ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/ForthAbility/ForthAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/SecondAbility/SecondAbility.ts create mode 100644 ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/ThirdAbility/ThirdAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/ets/test/List.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest => ability/ability_runtime/actscalltest/thirdcalltest}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actscalltest/thirdcalltest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets (100%) create mode 100644 ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts create mode 100644 ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsdataabilityrelyhap/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsfwkdataaccessortest/actsfwkdataaccessortest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/StServiceAbilityClient.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityclienttest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_100/BUILD.gn (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/service.ts (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest => ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_100/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_101/BUILD.gn (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/service.ts (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest => ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserActionExtension_101/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_100/BUILD.gn (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/Test.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest => ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_100/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_101/BUILD.gn (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/Test.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap => ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstartcomponenttest/SpecifiedUserAction_101/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsstserviceabilityclientcase/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersApi7AppA/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste => ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA}/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/AbilityStage.ts create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/app.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets rename {aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest => ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest}/entry/src/main/ets/test/List.test.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest => ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersExtensionSystemTest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/app.json create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti => ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA}/Test.json (100%) create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest => ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/app.json create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj => ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB}/Test.json (100%) create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest => ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/app.json create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC => ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC}/Test.json (100%) create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/newwant/actsnewwantarelyhap => ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility3/MainAbility3.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/List.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/newwant/actsnewwantbrelyhap => ability/ability_runtime/actsusers/ActsAmsUsersSystemTest}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsconnectabilitysystemabilitytest/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/Test.json create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/service.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/index/index.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/newwant/actsnewwantrelyhap => ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsconnectabilitysystemabilitytest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsextensionconnectabilitytest/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/newwant/actsnewwanttest => ability/ability_runtime/actsusers/actsextensionconnectabilitytest}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/newwant/actsnewwantrelyhap => ability/ability_runtime/actsusers/actsserviceabilityrelytest}/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest => ability/ability_runtime/actsusers/actsserviceabilityrelytest}/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/BUILD.gn (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/Test.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard/zidltest/actsamszidlclienttest => ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap}/entry/src/main/resources/base/profile/main_pages.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsextensionmodulehap/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/second/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/Test.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfohap/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/second/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticextensioninfotest/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/app.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapa/BUILD.gn (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/Test.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/app.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapb/BUILD.gn (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/Test.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/second/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/SecondMainAbility/SecondMainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/second/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdatauriutils/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/app.json create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsspecifytesthap/BUILD.gn (100%) create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/Test.json create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/second/second.ets (100%) create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsspecifytesthap/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/service.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/second/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilityforresulttest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/second/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/amsdisplayIdtest/actsamsstartabilitytest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/ActsProcessManageJsTest.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/Test.json (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/context/actscontexttest/entry/src/main/config.json create mode 100644 ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/entry/src/main/js/default/i18n/en-US.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/entry/src/main/js/default/i18n/zh-CN.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/entry/src/main/js/default/pages/index/index.css (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/entry/src/main/js/default/pages/index/index.hml (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/entry/src/main/js/default/pages/index/index.js (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/context/actscontexttest/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js (100%) create mode 100644 ability/ability_runtime/context/actscontexttest/entry/src/main/js/test/List.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/context/actscontexttest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/context/scene/defpermission/src/main/config.json create mode 100644 ability/ability_runtime/context/scene/defpermission/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/src/main/js/default/i18n/en-US.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/src/main/js/default/i18n/zh-CN.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/src/main/js/default/pages/index/index.css (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/src/main/js/default/pages/index/index.hml (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/src/main/js/default/pages/index/index.js (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/context/scene/defpermission/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/context/scene/defpermission/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility2/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/test/ApplicationInfoJsunit.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faapplicationinfo/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/entry/src/main/js/test/JsConfiguration.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faconfigurationconstant/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/entry/src/main/js/default/i18n/zh-CN.json (100%) create mode 100644 ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.css create mode 100644 ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/fa/facoverapi/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/entry/src/main/js/test/JsCoverApi.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/facoverapi/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/app.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/ServiceAbility/service.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/test/JsAbilityDisable.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/entry/src/main/js/test/List.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/fa/faequeryabilitybywant/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/Test.json (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json create mode 100644 ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/src/main/config.json (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/src/main/config.json (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/src/main/config.json (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/src/main/config.json (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/startability/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startability/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/src/main/config.json (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/src/main/config.json (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/BUILD.gn rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhost/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/app.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhost/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostb/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/app.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostb/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd => ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc}/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostc/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostd/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste => ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd}/entry/src/main/ets/MainAbility/app.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostd/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhoste/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti => ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste}/entry/src/main/ets/MainAbility/app.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhoste/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json rename {aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj => ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf}/entry/src/main/ets/MainAbility/app.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostf/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostg/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhosti/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhosti/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostj/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostj/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostk/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostl/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostn/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostnoperm/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhosto/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formhostst_ets/formsystemhostp/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationA/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/FormAbility/form.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/second.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.css create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.hml create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationA/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/FormAbility/form.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_2.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/close.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_HD1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image@3x.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_white.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png (100%) rename {aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC => ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB}/entry/src/main/js/widget/common/img/ic_list.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_public_search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_selfie.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_tv.svg (100%) rename {aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC => ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB}/entry/src/main/js/widget/common/img/ic_vision.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/superdevice.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/template.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/manifest.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/pages/index/index.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationB/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/FormAbility/form.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_2.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/close.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_HD1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image@3x.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_white.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_list.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_public_search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_selfie.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_tv.svg (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_vision.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/superdevice.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/template.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/manifest.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/pages/index/index.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationC/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/FormAbility/form.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_2.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/close.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_HD1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image@3x.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_white.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_list.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_public_search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_selfie.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_tv.svg (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_vision.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/superdevice.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/template.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/manifest.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/pages/index/index.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationD/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/FormAbility/form.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_2.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/close.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_HD1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image@3x.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_white.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_list.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_public_search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_selfie.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_tv.svg (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_vision.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/superdevice.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/template.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/manifest.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/pages/index/index.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationE/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/FormAbility/form.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_2.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/close.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_HD1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_white.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_list.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_selfie.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_tv.svg (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_vision.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/superdevice.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/template.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/manifest.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/pages/index/index.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationF/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/FormAbility/form.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_2.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/close.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_HD1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_white.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_list.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_selfie.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_tv.svg (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_vision.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/superdevice.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/template.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/manifest.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/pages/index/index.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationG/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/FormAbility/form.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_2.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/close.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_HD1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image@3x.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_white.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_list.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc1.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_public_search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_selfie.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_tv.svg (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_vision.svg rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/search.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/superdevice.svg (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/template.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/manifest.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/pages/index/index.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationH/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/FormAbility/form.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/second.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.css create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.hml create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest => ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera}/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsystemprovidera/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest => ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb}/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsystemproviderb/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest => ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc}/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsystemproviderc/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formproviderst_ets/formsystemproviderd/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/pages/index.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json rename {aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest => ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2}/entry/src/main/ets/MainAbility/app.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formacquiretest2/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdeletetest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdeletetest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest => ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest}/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/List.test.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdeletetest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest => ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest}/entry/src/main/ets/MainAbility/app.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/pages/index.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formfuzztest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/CastTempFormFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DeleteFormFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DisableFormsUpdateFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/EnableFormsUpdateFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/GetFormsInfoFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyInvisibleFormsFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyVisibleFormsFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/ReleaseFormFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/RequestFormFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/SetFormNextRefreshTimeFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/UpdateFormFuzz.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/getParam.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formfuzztest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json (100%) rename {aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest => ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest}/entry/src/main/ets/MainAbility/app.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/pages/index.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/FmsHostDeathRecipient.test.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formperformancetest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formperformancetest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formreleasetest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formreleasetest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/app.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/pages/index.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/List.test.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formreleasetest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_disable/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_disable/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_enable/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_enable/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/BUILD.gn create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstresstest/BUILD.gn (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/Test.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/app.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/List.test.ets create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formstresstest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formupdatefreshtest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formupdatefreshtest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/app.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/pages/index.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets (100%) create mode 100644 ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/formmanager/fa/formsystemtest_ets/formupdatefreshtest/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/app.json create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/Test.json create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/List.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/ActsKillProcessWithAccountTest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/killprocesswithaccountstage/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/entry/src/main/config.json (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/en-US.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/zh-CN.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.css (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.hml (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/media/icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwantrelyhap/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/Test.json (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/Application/AbilityStage.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets create mode 100644 ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/List.test.ets rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/newwant/actsnewwanttest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/app.json create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/Test.json create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility2/MainAbility2.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index2.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/app.json create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappone_rely_test/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/Test.json create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/app.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/Test.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/app.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/Test.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/app.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/Test.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/app.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/Test.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/app.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/Test.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/app.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/Test.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/app.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/Test.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/app.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/Test.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/app.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/media/app_icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/index/index.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/second/second.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/List.test.ets (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/element/string.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/processmultiinstance/actsamsprocessmultiinstancetest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/stage/BUILD.gn create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/app.json create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap2test/AppScope/resources/base/media/app_icon.png (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/BUILD.gn create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap2test/entry/src/main/ets/Application/AbilityStage.ts (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility1/Hap2MainAbility1.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility10/Hap2MainAbility10.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility2/Hap2MainAbility2.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility3/Hap2MainAbility3.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility4/Hap2MainAbility4.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility5/Hap2MainAbility5.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility6/Hap2MainAbility6.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility7/Hap2MainAbility7.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility8/Hap2MainAbility8.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility9/Hap2MainAbility9.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility10_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility1_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility2_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility3_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility4_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility5_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility6_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility7_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility8_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility9_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/module.json create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap2test/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap2test/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap2test/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/app.json create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap3test/AppScope/resources/base/media/app_icon.png (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/BUILD.gn create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap3test/entry/src/main/ets/Application/AbilityStage.ts (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility1/Hap3MainAbility1.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility2/Hap3MainAbility2.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility3/Hap3MainAbility3.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility1_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility2_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility3_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/module.json create mode 100644 ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap3test/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap3test/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihap3test/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/app.json create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihaptest/AppScope/resources/base/media/app_icon.png (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/BUILD.gn create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihaptest/entry/src/main/ets/Application/AbilityStage.ts (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility1_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility2_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility3_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility4_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility5_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility6_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/ListTest.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/module.json create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihaptest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihaptest/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihaptest/hap4/src/main/ets/Application/AbilityStage.ts (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/Hap4MainAbility1/Hap4MainAbility1.ts create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/pages/Hap4MainAbility1_pages.ets create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/module.json create mode 100644 ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclemultihaptest/signature/openharmony_sx.p7b (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/app.json create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclesinglehaptest/AppScope/resources/base/media/app_icon.png (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/BUILD.gn create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/Test.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclesinglehaptest/entry/src/main/ets/Application/AbilityStage.ts (100%) create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility10/MainAbility10.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility11/MainAbility11.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility12/MainAbility12.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility7/MainAbility7.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility8/MainAbility8.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility9/MainAbility9.ts create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index1.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index10.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index11.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index12.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index2.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index3.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index4.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index5.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index6.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index7.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index8.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index9.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a1.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a2.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/ListTest.ets create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/module.json create mode 100644 ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/profile/main_pages.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/stage/actslifecyclesinglehaptest/signature/openharmony_sx.p7b (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/Test.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/entry/src/main/config.json (100%) create mode 100644 ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/entry/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/entry/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js (100%) create mode 100644 ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/entry/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/test/List.test.js rename {aafwk/aafwk_standard => ability/ability_runtime}/want/actsgetwantalltest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/BUILD.gn (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/src/main/config.json (100%) create mode 100644 ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/app.js rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/en-US.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/zh-CN.json (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.css (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.hml (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.js (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/media/icon.png (100%) rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/AppScope/app.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/AppScope/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/BUILD.gn (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/Test.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/Application/AbilityStage.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/MainAbility/MainAbility.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/service.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/test/Ability.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/test/List.test.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/i_zidl_tool_test.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/zidl_tool_test_proxy.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/module.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/resources/base/element/string.json (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlclienttest/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/AppScope/app.json create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/AppScope/resources/base/media/app_icon.png (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/BUILD.gn (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/Test.json create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/service.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/service.ts (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/ets/pages/index/index.ets (100%) mode change 100755 => 100644 rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/ets/pages/second/second.ets (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/entry/src/main/resources/base/media/icon.png (100%) mode change 100755 => 100644 create mode 100644 ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json rename {aafwk/aafwk_standard => ability/ability_runtime}/zidltest/actsamszidlservice/signature/openharmony_sx.p7b (100%) mode change 100755 => 100644 diff --git a/aafwk/BUILD.gn b/aafwk/BUILD.gn deleted file mode 100644 index 6caaa7fc8..000000000 --- a/aafwk/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos_var.gni") - -group("aafwk") { - testonly = true - if (is_standard_system) { - deps = [ "aafwk_standard:aafwk_standard" ] - } -} diff --git a/aafwk/aafwk_standard/BUILD.gn b/aafwk/aafwk_standard/BUILD.gn deleted file mode 100755 index 53c9167e1..000000000 --- a/aafwk/aafwk_standard/BUILD.gn +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos_var.gni") - -group("aafwk_standard") { - testonly = true - if (is_standard_system) { - deps = [ - "abilitymanager:actsabilitymanagertest", - "abilitymultiinstance:abilitymultiinstance", - "actsabilitydelegatorcase:ActsAbilityDelegatorCaseTest", - "actsabilitylifecyclestatenew:ActsAbilityLifecycleStateNewTest", - "actsabilitymanageretstest:ActsAbilityManagerEtsTest", - "actscalltest:actscalltest", - "actsfwkdataaccessortest:dataability", - "actsserviceabilityclienttest:serviceability", - "actsstartcomponenttest:actsstartcomponenttest", - "actsstserviceabilityclientcase:ActsStServiceAbilityClientCaseTest", - "actsusers:actsusers", - "amscontextualinforquery:amscontextualinforquery", - "amsdatauriutils:ActsAmsDataUriUtilsTest", - "amsdisplayIdtest:amsdisplayIdtest", - "amsgetabilityprocessinfo:amsgetabilityprocessinfo", - "context:context", - "fa:fa", - "featureability:featureability", - "formmanager:formmanager", - "killprocesswithaccountstage:killprocesswithaccountstage", - "newwant:newwant", - "non_concurrent:non_concurrent", - "processmultiinstance:processmultiinstance", - "stage:stage", - "want:want", - "zidltest:zidltest", - ] - } -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/config.json deleted file mode 100644 index 587d73eda..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/config.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamscallbackfifthscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamscallbackfifthscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.actsamscallbackfifthscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index 29545cd42..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -let abilityNameList = [ - "com.ohos.launcher.MainAbility", - "com.ohos.callui.ServiceAbility", - "com.example.SimulateFeatureAbilityFir", - "com.example.VerifyIoThirdAbility", - "com.example.SimulateFeatureAbilitySed", - "com.example.actsamscallbackfifthscene.MainAbility" -] - -let bundleNameList = [ - "com.ohos.launcher", - "com.ohos.systemui", - "com.ohos.callui", - "com.ohos.contacts", - "com.ohos.mms", - "com.ohos.telephonydataability", - "com.ohos.contactsdataability", - "com.ix.simulate.feature", - "com.ix.verify.io", - "com.example.actsamscallbackfifthscene" -] - -describe('ActsAmsCallBackFifthScene', function () { - console.info('----ActsAmsCallBackFifthScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackFifthScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.io", - abilityName: "com.example.VerifyIoThirdAbility", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackFifthScene VerifyIoThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilitySed", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackFifthScene SimulateFeatureAbilitySed start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - setTimeout(done, 5000); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - let start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_6600 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by CallBack) - */ - it('Acts_Ams_test_6600', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - appManager.getProcessRunningInfos( - (error, info) => { - console.info('Acts_Ams_test_6600 getProcessRunningInfos error.code \ - ' + error.code + ', data length [' + info.length + ']'); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (let i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_6600 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - } - ); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/config.json deleted file mode 100644 index 93d37f5c9..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamscallbackfirstscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamscallbackfirstscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.actsamscallbackfirstscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index 6af877763..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit' - -describe('ActsAmsCallBackFirstScene', function () { - console.info('----ActsAmsCallBackFirstScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackFirstScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_0200 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by CallBack) - */ - it('Acts_Ams_test_0200', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - appManager.getProcessRunningInfos( - (error, info) => { - console.info('Acts_Ams_test_0200 getProcessRunningInfos error.code \ - ' + error.code + ', data length [' + info.length + ']'); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (var i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_0200 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/config.json deleted file mode 100644 index 91ea088ce..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamscallbackfourthscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamscallbackfourthscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.actsamscallbackfourthscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index 04db982eb..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -describe('ActsAmsCallBackFourthScene', function () { - console.info('----ActsAmsCallBackFourthScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.io", - abilityName: "com.example.VerifyIoThirdAbility", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackFourthScene VerifyIoThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackFourthScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.act", - abilityName: "com.example.VerifyActThirdAbility", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackFourthScene VerifyActThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.entry", - abilityName: "com.example.SimulateEntryAbilityFir", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackFourthScene SimulateEntryAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - let start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_5000 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by CallBack) - */ - it('Acts_Ams_test_5000', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - appManager.getProcessRunningInfos( - (error, info) => { - console.info('Acts_Ams_test_5000 getProcessRunningInfos error.code \ - ' + error.code + ', data length [' + info.length + ']'); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (let i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_5000 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index d02336b79..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit' - -describe('ActsAmsCallBackSecondScene', function () { - console.info('----ActsAmsCallBackSecondScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.io", - abilityName: "com.example.VerifyIoThirdAbility", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackSecondScene VerifyIoThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackSecondScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - let start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_1800 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by CallBack) - */ - it('Acts_Ams_test_1800', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - appManager.getProcessRunningInfos( - (error, info) => { - console.info('Acts_Ams_test_1800 getProcessRunningInfos error.code \ - ' + error.code + ', data length [' + info.length + ']'); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (let i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_1800 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/config.json deleted file mode 100644 index 5d5e565d9..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamscallbackthirdscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamscallbackthirdscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.actsamscallbackthirdscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index 0936beac7..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -describe('ActsAmsCallBackThirdScene', function () { - console.info('----ActsAmsCallBackThirdScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackThirdScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.io", - abilityName: "com.example.VerifyIoThirdAbility", - action: "action1", - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsCallBackThirdScene VerifyIoThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function sleep(delay) { - let start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_3400 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by CallBack) - */ - it('Acts_Ams_test_3400', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - appManager.getProcessRunningInfos( - (error, info) => { - console.info('Acts_Ams_test_3400 getProcessRunningInfos error.code \ - ' + error.code + ', data length [' + info.length + ']'); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (let i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_3400 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/config.json deleted file mode 100644 index 93a4f79a2..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamstestfifthscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamstestfifthscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.actsamstestfifthscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index 29fa22e2d..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -let abilityNameList = [ - "com.ohos.launcher.MainAbility", - "com.ohos.callui.ServiceAbility", - "com.example.SimulateFeatureAbilityFir", - "com.example.SimulateFeatureAbilitySed", - "com.example.VerifyIoThirdAbility", - "com.example.actsamstestfifthscene.MainAbility" -] - -let bundleNameList = [ - "com.ohos.launcher", - "com.ohos.systemui", - "com.ohos.callui", - "com.ohos.contacts", - "com.ohos.mms", - "com.ohos.telephonydataability", - "com.ohos.contactsdataability", - "com.ix.simulate.feature", - "com.ix.verify.io", - "com.example.actsamstestfifthscene" -] - -describe('ActsAmsTestFifthScene', function () { - console.info('----ActsAmsTestFifthScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestFifthScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.io", - abilityName: "com.example.VerifyIoThirdAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestFifthScene VerifyIoThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilitySed", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestFifthScene SimulateFeatureAbilitySed start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - let start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_0100 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by Promise) - */ - it('Acts_Ams_test_0100', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - let info = await appManager.getProcessRunningInfos(); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (let i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_0100 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/config.json deleted file mode 100644 index 2a7d87623..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/config.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamstestfirstscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamstestfirstscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.example.actsamstestfirstscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index c89e93b6b..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -describe('ActsAmsTestFirstScene', function () { - console.info('----ActsAmsTestFirstScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestFirstScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_0100 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by Promise) - */ - it('Acts_Ams_test_0100', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - var info = await appManager.getProcessRunningInfos(); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (var i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_0100 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/config.json deleted file mode 100644 index bd83460fe..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamstestfourthscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamstestfourthscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.actsamstestfourthscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index e1ab4f621..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -describe('ActsAmsTestFourthScene', function () { - console.info('----ActsAmsTestFourthScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.io", - abilityName: "com.example.VerifyIoThirdAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestFourthScene VerifyIoThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestFourthScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.act", - abilityName: "com.example.VerifyActThirdAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestFourthScene VerifyActThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.entry", - abilityName: "com.example.SimulateEntryAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestFourthScene SimulateEntryAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_1700 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by Promise) - */ - it('Acts_Ams_test_1700', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - var info = await appManager.getProcessRunningInfos(); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (var i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_1700 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/config.json deleted file mode 100644 index b877c7d21..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamstestsecondscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamstestsecondscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.actsamstestsecondscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index 180cc28d5..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -describe('ActsAmsTestSecondScene', function () { - console.info('----ActsAmsTestSecondScene----'); - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.io", - abilityName: "com.example.VerifyIoThirdAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestSecondScene VerifyIoThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestSecondScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_1700 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by Promise) - */ - it('Acts_Ams_test_1700', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - var info = await appManager.getProcessRunningInfos(); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (var i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_1700 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/config.json deleted file mode 100644 index bfa361843..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsamstestthirdscene", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsamstestthirdscene", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.actsamstestthirdscene.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js deleted file mode 100644 index c6a9e51fa..000000000 --- a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import featureAbility from '@ohos.ability.featureAbility' -import appManager from "@ohos.application.appManager" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' - -describe('ActsAmsTestThirdScene', function () { - console.info('----ActsAmsTestThirdScene----'); - - beforeAll(async function (done) { - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.simulate.feature", - abilityName: "com.example.SimulateFeatureAbilityFir", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestThirdScene SimulateFeatureAbilityFir start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - - await featureAbility.startAbility( - { - want: - { - deviceId: "", - bundleName: "com.ix.verify.io", - abilityName: "com.example.VerifyIoThirdAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - options: - {}, - parameters: - {}, - }, - }, (error, data) => { - console.info('ActsAmsTestThirdScene VerifyIoThirdAbility start, error.code \ - ' + error.code + ', data length [' + data.length + ']'); - } - ); - done(); - }); - - function timeout(done) { - expect().assertFail(); - console.debug('Acts_Ams_test=========timeout========'); - done(); - } - - function sleep(delay) { - var start = new Date().getTime(); - while (true) { - if (new Date().getTime() - start > delay) { - break; - } - } - } - - /* - * @tc.number : Acts_Ams_test_3300 - * @tc.name : getProcessRunningInfos : Get All Running Processes Info - * @tc.desc : Get All Running Processes Info(by Promise) - */ - it('Acts_Ams_test_3300', 0, async function (done) { - console.info("sleep begin"); - sleep(5000); - console.info("sleep end"); - var info = await appManager.getProcessRunningInfos(); - console.info('Acts_Ams_test_3300 getProcessRunningInfos JSON String: ' + JSON.stringify(info)); - expect(Array.isArray(info)).assertEqual(true); - expect(info.length).assertLarger(0); - for (var i = 0; i < info.length; i++) { - console.info('Acts_Ams_test_3300 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); - expect(typeof (info[i].pid)).assertEqual("number"); - expect(info[i].pid).assertLarger(0); - - expect(typeof (info[i].processName)).assertEqual("string"); - expect(info[i].processName.length).assertLarger(0); - expect(Array.isArray(info[i].bundleNames)).assertEqual(true); - expect(info[i].bundleNames.length).assertEqual(0); - - expect(typeof (info[i].uid)).assertEqual("number"); - expect(info[i].uid).assertLarger(0); - } - done(); - }) -}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/config.json deleted file mode 100644 index 863cea8c0..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "app": { - "bundleName": "com.ix.simulate.entry", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.simulateeability", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "simulateEAbility", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.SimulateEntryAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json deleted file mode 100644 index ba0166b87..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "app": { - "bundleName": "com.ix.simulate.feature", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.simulatefabilityfir", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "simulateFAbilityFir", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.SimulateFeatureAbilityFir", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json deleted file mode 100644 index 19d4fdde5..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "app": { - "bundleName": "com.ix.simulate.feature", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.simulatefabilitysed", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "simulateFAbilitySed", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.SimulateFeatureAbilitySed", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/config.json deleted file mode 100644 index 101baeb97..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "app": { - "bundleName": "com.ix.verify.act", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.verifyaability", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "verifyAAbility", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.VerifyActThirdAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/config.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/config.json deleted file mode 100644 index 657b60b37..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "app": { - "bundleName": "com.ix.verify.io", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.verifyiability", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "verifyIAbility", - "moduleType": "feature", - "installationFree": true - }, - "abilities": [ - { - "visible": true, - "name": "com.example.VerifyIoThirdAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "singleton" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/app.js b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.css deleted file mode 100755 index caf729946..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.hml deleted file mode 100755 index 61ea59d93..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{title}} - - -
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/element/string.json deleted file mode 100755 index f94ce7e64..000000000 --- a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "JsHelloWorld" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/app.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/app.json deleted file mode 100755 index d67e483bd..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.amsabilitymultiinstanceappa", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/Test.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 3e374f119..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -const ONACCEPTWANT_KEY_NOTSET_ID = -1; -const ONACCEPTWANT_KEY_UNDEFINED_ID = -2; -var onAcceptWantCalledSeq; - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("AbilityMultiInstanceAppA MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } - - onAcceptWant(want) { - console.log("AbilityMultiInstanceAppA onAcceptWant called want:" + JSON.stringify(want)); - if ((want.parameters == undefined) || (want.parameters.startId == undefined)) { - console.log("AbilityMultiInstanceAppA specified param err"); - return; - } - - var abilityId = want.parameters.startId.toString(); - onAcceptWantCalledSeq = "onAcceptWantCalled"; - onAcceptWantCalledSeq += "Id"; - onAcceptWantCalledSeq += abilityId; - globalThis.onAcceptWantCalledSeq = onAcceptWantCalledSeq; - - if (want.parameters.startId == ONACCEPTWANT_KEY_NOTSET_ID) { - return; - } else if (want.parameters.startId == ONACCEPTWANT_KEY_UNDEFINED_ID) { - return undefined; - } - - globalThis.abilityWant = want; - console.log("AbilityMultiInstanceAppA set globalThis result :" + globalThis.onAcceptWantCalledSeq); - return abilityId; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 43ebe70e0..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -var callBackSeq = ""; - -function publishCallBack() { - console.debug("====>Publish CallBack ====>"); -} - -async function startAbilityProcess(abilityContext, parameters) { - let bundleName = "com.example.amsabilitymultiinstanceappa"; - let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; - - let idx = parameters.nextStep; - switch (parameters.step[idx]) { - case "StartA1": - parameters.startId = 1; - break; - case "StartA2": - parameters.startId = 2; - break; - case "StartB": - bundleName = "com.example.amsabilitymultiinstanceappb"; - abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; - break; - case "StartC": - bundleName = "com.example.amsabilitymultiinstanceappc"; - abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; - break; - case "StartDMain1": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 1; - break; - case "StartDMain2": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 2; - break; - case "StartDSec": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; - break; - case "StartDThd": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; - break; - case "StartE": - bundleName = "com.example.amsabilitymultiinstanceappe"; - abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; - break; - - default: - break; - } - parameters.nextStep = ++idx; - abilityContext.startAbility({ - bundleName: bundleName, - abilityName: abilityName, - parameters: parameters - }, (error, data) => { - console.log('AppA startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) -} - -async function onShowProcess() { - var abilityWant = globalThis.abilityWant; - var callBackData = "AppA:" - callBackSeq += globalThis.onAcceptWantCalledSeq; - callBackData += callBackSeq; - - var commonEventPublishData = { - data: callBackData, - parameters: abilityWant.parameters - }; - - console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify(abilityWant)); - if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { - commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); - callBackSeq = ""; - globalThis.onAcceptWantCalledSeq = ""; - } else { - commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { - callBackSeq = ""; - globalThis.onAcceptWantCalledSeq = ""; - startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); - }); - } -} - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceAppA onCreate") - callBackSeq += "onCreate"; - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceAppA onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceAppA onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceAppA onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceAppA onForeground") - callBackSeq += "onForeground"; - onShowProcess(); - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceAppA onBackground") - } -}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json deleted file mode 100755 index 1295ce09e..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "module": { - "name": "com.example.amsabilitymultiinstanceappa", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.amsabilitymultiinstanceappa.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "launchType": "specified", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/app.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/app.json deleted file mode 100755 index 3a8cafbac..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.amsabilitymultiinstanceappb", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/Test.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index f85fcf92b..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 6079a2ac3..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -var callBackSeq = ""; - -function publishCallBack() { - console.debug("====>AbilityMultiInstanceAppB Publish CallBack ====>"); -} - -async function startAbilityProcess(abilityContext, parameters) { - let bundleName = "com.example.amsabilitymultiinstanceappa"; - let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; - - let idx = parameters.nextStep; - switch (parameters.step[idx]) { - case "StartA1": - parameters.startId = 1; - break; - case "StartA2": - parameters.startId = 2; - break; - case "StartB": - bundleName = "com.example.amsabilitymultiinstanceappb"; - abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; - break; - case "StartC": - bundleName = "com.example.amsabilitymultiinstanceappc"; - abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; - break; - case "StartDMain1": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 1; - break; - case "StartDMain2": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 2; - break; - case "StartDSec": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; - break; - case "StartDThd": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; - break; - case "StartE": - bundleName = "com.example.amsabilitymultiinstanceappe"; - abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; - break; - - default: - break; - } - parameters.nextStep = ++idx; - abilityContext.startAbility({ - bundleName: bundleName, - abilityName: abilityName, - parameters: parameters - }, (error, data) => { - console.log('AppB startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) -} - -async function onShowProcess() { - var abilityWant = globalThis.abilityWant; - var callBackData = "AppB:" - callBackData += callBackSeq; - - var commonEventPublishData = { - data: callBackData, - parameters: abilityWant.parameters - }; - console.log("AbilityMultiInstanceAppB onShowProcess") - if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { - commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); - callBackSeq = ""; - } else { - commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { - callBackSeq = ""; - startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); - }); - } -} - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceAppB MainAbility onCreate") - callBackSeq += "onCreate"; - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceAppB MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceAppB MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceAppB MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceAppB MainAbility onForeground") - callBackSeq += "onForeground"; - onShowProcess(); - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceAppB MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json deleted file mode 100755 index 75e3babd5..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "module": { - "name": "com.example.amsabilitymultiinstanceappb", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.amsabilitymultiinstanceappb.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "launchType": "standard", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/app.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/app.json deleted file mode 100755 index 9aba06314..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.amsabilitymultiinstanceappc", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/Test.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index f85fcf92b..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 51045c97e..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -var callBackSeq = ""; - -function publishCallBack() { - console.debug("====>AbilityMultiInstanceAppC Publish CallBack ====>"); -} - -async function onShowProcess() { - var abilityWant = globalThis.abilityWant; - var callBackData = "AppC:"; - callBackData += callBackSeq; - var commonEventPublishData = { - data: callBackData, - parameters: abilityWant.parameters - }; - console.log("AbilityMultiInstanceAppC onShowProcess") - if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { - commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); - } else { - commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { - startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); - }); - } - callBackSeq = ""; -} - -async function startAbilityProcess(abilityContext, parameters) { - let bundleName = "com.example.amsabilitymultiinstanceappa"; - let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; - - let idx = parameters.nextStep; - switch (parameters.step[idx]) { - case "StartA1": - parameters.startId = 1; - break; - case "StartA2": - parameters.startId = 2; - break; - case "StartB": - bundleName = "com.example.amsabilitymultiinstanceappb"; - abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; - break; - case "StartC": - bundleName = "com.example.amsabilitymultiinstanceappc"; - abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; - break; - case "StartDMain1": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 1; - break; - case "StartDMain2": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 2; - break; - case "StartDSec": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; - break; - case "StartDThd": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; - break; - case "StartE": - bundleName = "com.example.amsabilitymultiinstanceappe"; - abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; - break; - - default: - break; - } - parameters.nextStep = ++idx; - abilityContext.startAbility({ - bundleName: bundleName, - abilityName: abilityName, - parameters: parameters - }, (error, data) => { - console.log('AppC startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) -} - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - callBackSeq += "onCreate"; - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - callBackSeq += "onForeground"; - onShowProcess(); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json deleted file mode 100755 index e057d5560..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "module": { - "name": "com.example.amsabilitymultiinstanceappc", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.amsabilitymultiinstanceappc.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "launchType": "singleton", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/app.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/app.json deleted file mode 100755 index 8392e2281..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.amsabilitymultiinstanceappd", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/Test.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 89ebbd7d6..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -var onAcceptWantCalledSeq; - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("AbilityMultiInstanceAppD MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } - - onAcceptWant(want) { - console.log("AbilityMultiInstanceAppD onAcceptWant called want:" + JSON.stringify(want)); - var abilityId = want.parameters.startId.toString(); - onAcceptWantCalledSeq = "onAcceptWantCalled"; - onAcceptWantCalledSeq += "Id"; - onAcceptWantCalledSeq += abilityId; - globalThis.onAcceptWantCalledSeq = onAcceptWantCalledSeq; - globalThis.abilityWant = want; - console.log("AbilityMultiInstanceAppD set globalThis result :" + globalThis.onAcceptWantCalledSeq); - return abilityId; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 8576046e9..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -var callBackSeq = ""; -function publishCallBack() { - console.debug("====>AbilityMultiInstanceAppD Publish CallBack ====>"); -} -async function onShowProcess() { - var abilityWant = globalThis.abilityWant; - var callBackData = "AppD:"; - callBackSeq += globalThis.onAcceptWantCalledSeq; - callBackData += callBackSeq; - var commonEventPublishData = { - data: callBackData, - parameters: abilityWant.parameters - }; - - console.log("AbilityMultiInstanceAppD abilityWant = " + JSON.stringify(abilityWant)); - if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { - commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); - } else { - commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { - startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); - }); - } - globalThis.onAcceptWantCalledSeq = ""; - callBackSeq = ""; -} - -async function startAbilityProcess(abilityContext, parameters) { - let bundleName = "com.example.amsabilitymultiinstanceappa"; - let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; - - let idx = parameters.nextStep; - switch (parameters.step[idx]) { - case "StartA1": - parameters.startId = 1; - break; - case "StartA2": - parameters.startId = 2; - break; - case "StartB": - bundleName = "com.example.amsabilitymultiinstanceappb"; - abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; - break; - case "StartC": - bundleName = "com.example.amsabilitymultiinstanceappc"; - abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; - break; - case "StartDMain1": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 1; - break; - case "StartDMain2": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 2; - break; - case "StartDSec": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; - break; - case "StartDThd": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; - break; - case "StartE": - bundleName = "com.example.amsabilitymultiinstanceappe"; - abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; - break; - - default: - break; - } - parameters.nextStep = ++idx; - abilityContext.startAbility({ - bundleName: bundleName, - abilityName: abilityName, - parameters: parameters - }, (error, data) => { - console.log('AppD startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceAppD onCreate") - callBackSeq += "onCreate"; - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceAppD onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceAppD onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceAppD onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceAppD onForeground") - callBackSeq += "onForeground"; - onShowProcess(); - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceAppD onBackground") - } -}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/SecondAbility/SecondAbility.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/SecondAbility/SecondAbility.ts deleted file mode 100755 index 1542e0cad..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/SecondAbility/SecondAbility.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -var callBackSeq = ""; -function publishCallBack() { - console.debug("====>AbilityMultiInstanceAppD Sec Publish CallBack ====>"); -} -async function onShowProcess() { - var abilityWant = globalThis.abilityWant; - var callBackData = "AppD:"; - callBackSeq += globalThis.onAcceptWantCalledSeq; - callBackData += callBackSeq; - var commonEventPublishData = { - data: callBackData, - parameters: abilityWant.parameters - }; - - console.log("AbilityMultiInstanceAppD Sec abilityWant = " + JSON.stringify(abilityWant)); - if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { - commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); - } else { - commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { - startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); - }); - } - globalThis.onAcceptWantCalledSeq = ""; - callBackSeq = ""; -} - -async function startAbilityProcess(abilityContext, parameters) { - let bundleName = "com.example.amsabilitymultiinstanceappa"; - let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; - - let idx = parameters.nextStep; - switch (parameters.step[idx]) { - case "StartA1": - parameters.startId = 1; - break; - case "StartA2": - parameters.startId = 2; - break; - case "StartB": - bundleName = "com.example.amsabilitymultiinstanceappb"; - abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; - break; - case "StartC": - bundleName = "com.example.amsabilitymultiinstanceappc"; - abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; - break; - case "StartDMain1": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 1; - break; - case "StartDMain2": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 2; - break; - case "StartDSec": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; - break; - case "StartDThd": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; - break; - case "StartE": - bundleName = "com.example.amsabilitymultiinstanceappe"; - abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; - break; - - default: - break; - } - parameters.nextStep = ++idx; - abilityContext.startAbility({ - bundleName: bundleName, - abilityName: abilityName, - parameters: parameters - }, (error, data) => { - console.log('AppD startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) -} - -export default class SecondAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceAppD Sec onCreate") - callBackSeq += "onCreate"; - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceAppD Sec onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceAppD Sec onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceAppD Sec onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceAppD Sec onForeground") - callBackSeq += "onForeground"; - onShowProcess(); - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceAppD Sec onBackground") - } -}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/ThirdAbility/ThirdAbility.ts b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/ThirdAbility/ThirdAbility.ts deleted file mode 100755 index 1e9537a68..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/ThirdAbility/ThirdAbility.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -var callBackSeq = ""; -function publishCallBack() { - console.debug("====>AbilityMultiInstanceAppD Third Publish CallBack ====>"); -} -async function onShowProcess() { - var abilityWant = globalThis.abilityWant; - var callBackData = "AppD:"; - callBackSeq += globalThis.onAcceptWantCalledSeq; - callBackData += callBackSeq; - var commonEventPublishData = { - data: callBackData, - parameters: abilityWant.parameters - }; - - console.log("AbilityMultiInstanceAppD Third abilityWant = " + JSON.stringify(abilityWant)); - if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { - commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); - } else { - commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { - startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); - }); - } - globalThis.onAcceptWantCalledSeq = ""; - callBackSeq = ""; -} - -async function startAbilityProcess(abilityContext, parameters) { - let bundleName = "com.example.amsabilitymultiinstanceappa"; - let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; - - let idx = parameters.nextStep; - switch (parameters.step[idx]) { - case "StartA1": - parameters.startId = 1; - break; - case "StartA2": - parameters.startId = 2; - break; - case "StartB": - bundleName = "com.example.amsabilitymultiinstanceappb"; - abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; - break; - case "StartC": - bundleName = "com.example.amsabilitymultiinstanceappc"; - abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; - break; - case "StartDMain1": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 1; - break; - case "StartDMain2": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; - parameters.startId = 2; - break; - case "StartDSec": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; - break; - case "StartDThd": - bundleName = "com.example.amsabilitymultiinstanceappd"; - abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; - break; - - default: - break; - } - parameters.nextStep = ++idx; - abilityContext.startAbility({ - bundleName: bundleName, - abilityName: abilityName, - parameters: parameters - }, (error, data) => { - console.log('AppD startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) -} - -export default class ThirdAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceAppD Third onCreate") - callBackSeq += "onCreate"; - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceAppD Third onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceAppD Third onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceAppD Third onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceAppD Third onForeground") - callBackSeq += "onForeground"; - onShowProcess(); - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceAppD Third onBackground") - } -}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json deleted file mode 100755 index 87d984d90..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "module": { - "name": "com.example.amsabilitymultiinstanceappd", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.amsabilitymultiinstanceappd.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "launchType": "specified", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "com.example.amsabilitymultiinstanceappd.SecondAbility", - "srcEntrance": "./ets/SecondAbility/SecondAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "launchType": "standard", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "com.example.amsabilitymultiinstanceappd.ThirdAbility", - "srcEntrance": "./ets/ThirdAbility/ThirdAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "launchType": "singleton", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/BUILD.gn b/aafwk/aafwk_standard/actsabilitymanageretstest/BUILD.gn deleted file mode 100644 index 082b2b6c6..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/BUILD.gn +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAbilityManagerEtsTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_ets_assets", - ":hjs_demo_ets_resources", - ":hjs_demo_ets_test_assets", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAbilityManagerEtsTest" -} -ohos_js_assets("hjs_demo_ets_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_js_assets("hjs_demo_ets_test_assets") { - source_dir = "./entry/src/main/ets/TestAbility" -} -ohos_resources("hjs_demo_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/Test.json b/aafwk/aafwk_standard/actsabilitymanageretstest/Test.json deleted file mode 100644 index 612f4ad6c..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for aceceshi Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "600000", - "bundle-name": "com.ohos.acecollaboration", - "package-name": "com.ohos.acecollaboration", - "shell-timeout": "600000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAbilityManagerEtsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/config.json b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/config.json deleted file mode 100644 index 9ce6b05e5..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/config.json +++ /dev/null @@ -1,192 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.acecollaboration", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.acecollaboration", - "name": ".MyApplication", - "srcPath": "", - "mainAbility": "com.ohos.acecollaboration.MainAbility", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "srcPath": "MainAbility", - "srcLanguage": "ets", - "name": "com.ohos.acecollaboration.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "visible": true, - "srcPath": "TestAbility", - "name": ".TestAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "formsEnabled": false, - "label": "$string:TestAbility_label", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility2", - "name": ".MainAbility2", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability2", - "formsEnabled": false, - "label": "$string:entry_MainAbility2", - "type": "page", - "launchType": "standard" - }, - { - "srcPath": "ServiceAbility", - "name": ".ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_serviceability", - "type": "service" - }, - { - "srcPath": "ServiceAbility2", - "name": ".ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_serviceability2", - "type": "service" - }, - { - "srcPath": "ServiceAbility3", - "name": ".ServiceAbility3", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_serviceability3", - "type": "service" - }, - { - "srcPath": "ServiceAbility4", - "name": ".ServiceAbility4", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_serviceability4", - "type": "service" - }, - { - "srcPath": "ServiceAbility5", - "name": ".ServiceAbility5", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_serviceability5", - "type": "service" - }, - { - "srcPath": "ServiceAbility6", - "name": ".ServiceAbility6", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_serviceability6", - "type": "service" - }, - { - "srcPath": "ServiceAbility7", - "name": ".ServiceAbility7", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_serviceability7", - "type": "service" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": "MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "name": "com.ohos.acecollaboration.DataAbilityShellProvider.PROVIDER" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 5d603333c..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 5b8a8cc1e..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct MyComponent { - aboutToAppear() { - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility/service.ts b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index bc342fe34..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility/service.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import rpc from '@ohos.rpc'; - -class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility op1:' + op1 + ' op2:' + op2); - } - return true; - } -} - -export default { - onStart() { - console.info('ServiceAbility onStart'); - }, - onStop() { - console.info('ServiceAbility onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility onCommand'); - }, - onConnect(want) { - console.info('ServiceAbility onConnect'); - return new StubTest("test"); - }, - onDisConnect(want) { - console.info('ServiceAbility onDisConnect'); - }, -}; diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility2/service.ts b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index fb96c3af1..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility2/service.ts +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import particleAbility from '@ohos.ability.particleAbility'; -import rpc from '@ohos.rpc' - -class StubTest2 extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility2 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility2 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} - -function getNowTime() { - return new Date().getTime(); -} - -function getDurationTime(msg, startTime, endTime) { - console.info(msg + 'Get Interface startTime: ' + startTime); - console.info(msg + 'Get Interface endTime: ' + endTime); - var duration = (endTime - startTime) - console.info(msg + 'Get Interface Duration: ' + duration); - return duration; -} - -async function sleep(time: any) { - var now = new Date(); - var exitTime = now.getTime() + time; - while (true) { - now = new Date(); - if (now.getTime() > exitTime) - break; - } - console.info(`sleep ${time} over...`); -} - -export default { - onStart() { - console.info('ServiceAbility2 onStart'); - }, - onStop() { - console.info('ServiceAbility2 onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility2 onCommand'); - let request = { - "bundleName": "com.ohos.acecollaboration", - "abilityName": "com.ohos.acecollaboration.ServiceAbility", - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.deviceId : ' - + JSON.stringify(element.deviceId)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.bundleName : ' - + JSON.stringify(element.bundleName)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.abilityName : ' - + JSON.stringify(element.abilityName)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.uri : ' - + JSON.stringify(element.uri)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.shortName : ' - + JSON.stringify(element.shortName)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect proxy : ' - + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.deviceId : ' - + JSON.stringify(element1.deviceId)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.bundleName : ' - + JSON.stringify(element1.bundleName)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.abilityName: ' - + JSON.stringify(element1.abilityName)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.uri : ' - + JSON.stringify(element1.uri)); - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.shortName : ' - + JSON.stringify(element1.shortName)); - }, - onFailed: async function (code: any) { - console.log('particleAbility_connectAbility_test_0100 ConnectAbility onFailed errCode : ' + code); - }, - } - - let connection_succeeded: any; - console.info('particleAbility_connectAbility_test_0100 start '); - var timeOldStamp = getNowTime(); - var connection = particleAbility.connectAbility(request, options); - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0100 connectability', timeOldStamp, timeNewStamp); - connection_succeeded = connection; - console.info('particleAbility_connectAbility_test_0100 service request is:' + JSON.stringify(request)); - console.info('particleAbility_connectAbility_test_0100 options is:' + JSON.stringify(options)); - console.info('particleAbility_connectAbility_test_0100 data is: ' + JSON.stringify(connection)); - console.info('particleAbility_connectAbility_test_0100 connection=: ' + connection); - sleep(5000); - console.info('particleAbility_connectAbility_test_0100 disconnectability start '); - var timeOldStamp = getNowTime(); - particleAbility.disconnectAbility(connection_succeeded).then((data: any) => { - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0100 disconnectability', timeOldStamp, timeNewStamp); - console.info('particleAbility_connectAbility_test_0100 disconnectability succeeded: ' + - JSON.stringify(data)); - }).catch((error: any) => { - console.error('particleAbility_connectAbility_test_0100 disconnectability failed. Cause: ' + - JSON.stringify(error)); - }) - }, - onConnect(want) { - console.info('ServiceAbility2 onConnect'); - return new StubTest2("test"); - }, -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility3/service.ts b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility3/service.ts deleted file mode 100644 index 4c669dfbd..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility3/service.ts +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import particleAbility from '@ohos.ability.particleAbility'; -import rpc from '@ohos.rpc'; - -class StubTest3 extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility3 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility3 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} - -function getNowTime() { - return new Date().getTime(); -} - -function getDurationTime(msg, startTime, endTime) { - console.info(msg + 'Get Interface startTime: ' + startTime); - console.info(msg + 'Get Interface endTime: ' + endTime); - var duration = (endTime - startTime) - console.info(msg + 'Get Interface Duration: ' + duration); - return duration; -} - -async function sleep(time: any) { - var now = new Date(); - var exitTime = now.getTime() + time; - while (true) { - now = new Date(); - if (now.getTime() > exitTime) - break; - } - console.info(`sleep ${time} over...`); -} - -export default { - onStart() { - console.info('ServiceAbility3 onStart'); - }, - onStop() { - console.info('ServiceAbility3 onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility3 onCommand'); - let request = { - "bundleName": "com.ohos.acecollaboration", - "abilityName": "com.ohos.acecollaboration.ServiceAbility", - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.deviceId : ' - + JSON.stringify(element.deviceId)) - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.bundleName : ' - + JSON.stringify(element.bundleName)) - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.abilityName : ' - + JSON.stringify(element.abilityName)) - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.uri : ' - + JSON.stringify(element.uri)) - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.shortName : ' - + JSON.stringify(element.shortName)) - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect proxy : ' - + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.deviceId :' - + JSON.stringify(element1.deviceId)); - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.bundleName :' - + JSON.stringify(element1.bundleName)); - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.abilityName :' - + JSON.stringify(element1.abilityName)); - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.uri : ' - + JSON.stringify(element1.uri)); - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.shortName : ' - + JSON.stringify(element1.shortName)); - }, - onFailed: function (code: any) { - console.log('particleAbility_connectAbility_test_0200 ConnectAbility onFailed errCode: ' + code) - }, - } - - let connection_succeeded: any; - console.info('particleAbility_connectAbility_test_0200 start '); - var timeOldStamp = getNowTime(); - var connection = particleAbility.connectAbility(request, options); - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0200 connectability', timeOldStamp, timeNewStamp); - connection_succeeded = connection; - console.info('particleAbility_connectAbility_test_0200 service request is:' + JSON.stringify(request)); - console.info('particleAbility_connectAbility_test_0200 options is:' + JSON.stringify(options)); - console.info('particleAbility_connectAbility_test_0200 connection=: ' + connection); - sleep(5000); - console.info('particleAbility_connectAbility_test_0200 disconnectability start '); - try { - var timeOldStamp = getNowTime(); - particleAbility.disconnectAbility(connection_succeeded, (error, data) => { - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0200 disconnectability', timeOldStamp, timeNewStamp); - console.info('particleAbility_connectAbility_test_0200 disconnectability succeeded: ' + JSON.stringify(data)); - }) - } - catch(error: any){ - console.error('particleAbility_connectAbility_test_0200 disconnectability failed. Cause: ' + - JSON.stringify(error)); - } - }, - onConnect(want) { - console.info('ServiceAbility3 onConnect'); - return new StubTest3("test"); - }, -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility4/service.ts b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility4/service.ts deleted file mode 100644 index 8b768feb6..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility4/service.ts +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import particleAbility from '@ohos.ability.particleAbility'; -import rpc from '@ohos.rpc' - -class StubTest4 extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility4 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility4 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} - -function getNowTime() { - return new Date().getTime(); -} - -function getDurationTime(msg, startTime, endTime) { - console.info(msg + 'Get Interface startTime: ' + startTime); - console.info(msg + 'Get Interface endTime: ' + endTime); - var duration = (endTime - startTime) - console.info(msg + 'Get Interface Duration: ' + duration); - return duration; -} - -async function sleep(time: any) { - var now = new Date(); - var exitTime = now.getTime() + time; - while (true) { - now = new Date(); - if (now.getTime() > exitTime) - break; - } - console.info(`sleep ${time} over...`); -} - -export default { - onStart() { - console.info('ServiceAbility4 onStart'); - }, - onStop() { - console.info('ServiceAbility4 onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility4 onCommand'); - let request = { - "bundleName": "com.open.harmony.packagemag", - "abilityName": "com.open.harmony.packagemag.packServiceAbility", - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.deviceId : ' - + JSON.stringify(element.deviceId)) - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.bundleName : ' - + JSON.stringify(element.bundleName)) - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.abilityName : ' - + JSON.stringify(element.abilityName)) - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.uri : ' - + JSON.stringify(element.uri)) - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.shortName : ' - + JSON.stringify(element.shortName)) - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect proxy : ' - + JSON.stringify(proxy)); - }, - onDisconnect: async function (element1: any) { - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.deviceId : ' - + JSON.stringify(element1.deviceId)); - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.bundleName: ' - + JSON.stringify(element1.bundleName)); - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.abilityName:' - + JSON.stringify(element1.abilityName)); - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.uri: ' - + JSON.stringify(element1.uri)); - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.shortName :' - + JSON.stringify(element1.shortName)); - }, - onFailed: function (code: any) { - console.log('particleAbility_connectAbility_test_0300 ConnectAbility onFailed errCode : '+ code); - }, - } - - let connection_succeeded: any; - console.info('particleAbility_connectAbility_test_0300 start '); - var timeOldStamp = getNowTime(); - var connection = particleAbility.connectAbility(request, options); - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0300 connectability', timeOldStamp, timeNewStamp); - connection_succeeded = connection; - console.info('particleAbility_connectAbility_test_0300 service request is:' + JSON.stringify(request)); - console.info('particleAbility_connectAbility_test_0300 options is:' + JSON.stringify(options)); - console.info('particleAbility_connectAbility_test_0300 data is: ' + JSON.stringify(connection)); - console.info('particleAbility_connectAbility_test_0300 connection=: ' + connection); - sleep(5000); - console.info('particleAbility_connectAbility_test_0300 disconnectability start '); - var timeOldStamp = getNowTime(); - particleAbility.disconnectAbility(connection_succeeded).then((data: any) => { - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0300 disconnectability', timeOldStamp, timeNewStamp); - console.info('particleAbility_connectAbility_test_0300 disconnectability succeeded:' - + JSON.stringify(data)); - }).catch ((error: any) =>{ - console.error('particleAbility_connectAbility_test_0300 disconnectability failed. Cause: ' + - JSON.stringify(error)); - }) - }, - onConnect(want) { - console.info('ServiceAbility4 onConnect'); - return new StubTest4("test"); - }, -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility5/service.ts b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility5/service.ts deleted file mode 100644 index 646eb606b..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility5/service.ts +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import particleAbility from '@ohos.ability.particleAbility'; -import rpc from '@ohos.rpc' - -class StubTest5 extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility5 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility5 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} - -function getNowTime() { - return new Date().getTime(); -} - -function getDurationTime(msg, startTime, endTime) { - console.info(msg + 'Get Interface startTime: ' + startTime); - console.info(msg + 'Get Interface endTime: ' + endTime); - var duration = (endTime - startTime) - console.info(msg + 'Get Interface Duration: ' + duration); - return duration; -} - -async function sleep(time: any) { - var now = new Date(); - var exitTime = now.getTime() + time; - while (true) { - now = new Date(); - if (now.getTime() > exitTime) - break; - } - console.info(`sleep ${time} over...`); -} - -export default { - onStart() { - console.info('ServiceAbility5 onStart'); - }, - onStop() { - console.info('ServiceAbility5 onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility5 onCommand'); - let request = { - "bundleName": "", - "abilityName": "", - } - let options = { - onConnect: async function (element: any, proxy: any) { - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.deviceId : ' - + JSON.stringify(element.deviceId)) - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.bundleName : ' - + JSON.stringify(element.bundleName)) - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.abilityName : ' - + JSON.stringify(element.abilityName)) - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.uri : ' - + JSON.stringify(element.uri)) - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.shortName : ' - + JSON.stringify(element.shortName)) - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect proxy : ' - + JSON.stringify(proxy)); - }, - onDisconnect: function (element1: any) { - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.deviceId : ' - + JSON.stringify(element1.deviceId)); - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.bundleName: ' - + JSON.stringify(element1.bundleName)); - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.abilityName:' - + JSON.stringify(element1.abilityName)); - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.uri : ' - + JSON.stringify(element1.uri)); - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.shortName : ' - + JSON.stringify(element1.shortName)); - }, - onFailed: function (code: any) { - console.log('particleAbility_connectAbility_test_0400 ConnectAbility onFailed errCode:' + code); - }, - } - - let connection_succeeded: any; - console.info('particleAbility_connectAbility_test_0400 start '); - var timeOldStamp = getNowTime(); - var connection = particleAbility.connectAbility(request, options); - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0400 connectability', timeOldStamp, timeNewStamp); - connection_succeeded = connection; - console.info('particleAbility_connectAbility_test_0400 service request is:' + JSON.stringify(request)); - console.info('particleAbility_connectAbility_test_0400 options is:' + JSON.stringify(options)); - console.info('particleAbility_connectAbility_test_0400 connection=: ' + connection); - sleep(5000); - console.info('particleAbility_connectAbility_test_0400 disconnectability start '); - var timeOldStamp = getNowTime(); - particleAbility.disconnectAbility(connection_succeeded).then((data: any) => { - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0400 disconnectability', timeOldStamp, timeNewStamp); - console.info('particleAbility_connectAbility_test_0400 disconnectability succeeded: ' + - JSON.stringify(data)); - }).catch((error: any) => { - console.error('particleAbility_connectAbility_test_0400 disconnectability failed. Cause: ' + - JSON.stringify(error)); - }); - sleep(5000); - console.info('particleAbility_connectAbility_test_0400 disconnectability_fail start '); - try { - var timeOldStamp = getNowTime(); - particleAbility.disconnectAbility(-1).then((data: any) => { - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0400 disconnectability_fail', - timeOldStamp, timeNewStamp); - console.info('particleAbility_connectAbility_test_0400 disconnectability_fail succeeded: ' + - JSON.stringify(data)); - }) - } - catch (error: any) { - console.error('particleAbility_connectAbility_test_0400 disconnectability_fail failed. Cause: ' + - JSON.stringify(error)); - } - }, - onConnect(want) { - console.info('ServiceAbility5 onConnect'); - return new StubTest5("test"); - }, -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility6/service.ts b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility6/service.ts deleted file mode 100644 index 5e5f15eb7..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility6/service.ts +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import particleAbility from '@ohos.ability.particleAbility'; -import rpc from '@ohos.rpc' - -class StubTest6 extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility6 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility6 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} -function getNowTime() { - return new Date().getTime(); -} - -function getDurationTime(msg, startTime, endTime) { - console.info(msg + 'Get Interface startTime: ' + startTime); - console.info(msg + 'Get Interface endTime: ' + endTime); - var duration = (endTime - startTime) - console.info(msg + 'Get Interface Duration: ' + duration); - return duration; -} - -export default { - onStart() { - console.info('ServiceAbility onStart'); - }, - onStop() { - console.info('ServiceAbility onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility onCommand'); - - let request = { - "bundleName":"com.ohos.acecollaboration", - "abilityName":"com.ohos.acecollaboration.xxx", - } - let options = { - onConnect:async function (element:any, proxy:any) { - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.deviceId : ' - + JSON.stringify(element.deviceId)) - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.bundleName : ' - + JSON.stringify(element.bundleName)) - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.abilityName : ' - + JSON.stringify(element.abilityName)) - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.uri : ' - + JSON.stringify(element.uri)) - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.shortName : ' - + JSON.stringify(element.shortName)) - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect proxy : ' - + JSON.stringify(proxy)); - }, - onDisconnect:function (element1:any) { - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.deviceId : ' - + JSON.stringify(element1.deviceId)); - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.bundleName: ' - + JSON.stringify(element1.bundleName)); - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.abilityName:' - + JSON.stringify(element1.abilityName)); - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.uri : ' - + JSON.stringify(element1.uri)); - console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.shortName : ' - + JSON.stringify(element1.shortName)); - }, - onFailed:function (code:any) { - console.log('particleAbility_connectAbility_test_0500 ConnectAbility service onFailed errCode:' + code) - }, - } - - console.info('particleAbility_connectAbility_test_0500 errorabilityName start'); - var timeOldStamp = getNowTime(); - var connection = particleAbility.connectAbility(request, options); - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0500 connectability', timeOldStamp, timeNewStamp); - console.info('particleAbility_connectAbility_test_0500 errorabilityName request is:' - + JSON.stringify(request)); - console.info('particleAbility_connectAbility_test_0500 errorabilityName options is:' - + JSON.stringify(options)); - console.info('particleAbility_connectAbility_test_0500 errorabilityName connection=: ' + connection); - }, - onConnect(want) { - console.info('ServiceAbility6 onConnect'); - return new StubTest6("test"); - }, -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility7/service.ts b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility7/service.ts deleted file mode 100644 index a1efccb5c..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility7/service.ts +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import particleAbility from '@ohos.ability.particleAbility'; -import rpc from '@ohos.rpc' - -class StubTest7 extends rpc.RemoteObject { - constructor(des) { - super(des) - } - - onRemoteRequest(code, data, reply, option) { - console.info('ServiceAbility7 onRemoteRequest'); - if (code === 1) { - let op1 = data.readInt(); - let op2 = data.readInt(); - reply.writeInt(op1 + op2); - console.info('ServiceAbility7 op1:' + op1 + ' op2:' + op2); - } - return true; - } -} - -function getNowTime() { - return new Date().getTime(); -} - -function getDurationTime(msg, startTime, endTime) { - console.info(msg + 'Get Interface startTime: ' + startTime); - console.info(msg + 'Get Interface endTime: ' + endTime); - var duration = (endTime - startTime) - console.info(msg + 'Get Interface Duration: ' + duration); - return duration; -} - -async function sleep(time: any) { - var now = new Date(); - var exitTime = now.getTime() + time; - while (true) { - now = new Date(); - if (now.getTime() > exitTime) - break; - } - console.info(`sleep ${time} over...`); -} -export default { - onStart() { - console.info('ServiceAbility7 onStart'); - }, - onStop() { - console.info('ServiceAbility7 onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility7 onCommand'); - - let request = { - "bundleName":"com.example.myapplication", - "abilityName":"com.example.myapplication.ServiceAbility_API8", - } - let options = { - onConnect:async function (element:any, proxy:any) { - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.deviceId : ' - + JSON.stringify(element.deviceId)) - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.bundleName : ' - + JSON.stringify(element.bundleName)) - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.abilityName : ' - + JSON.stringify(element.abilityName)) - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.uri : ' - + JSON.stringify(element.uri)) - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.shortName : ' - + JSON.stringify(element.shortName)) - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect proxy : ' - + JSON.stringify(proxy)); - }, - onDisconnect:async function (element1:any) { - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.deviceId : ' - + JSON.stringify(element1.deviceId)); - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.bundleName: ' - + JSON.stringify(element1.bundleName)); - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.abilityName:' - + JSON.stringify(element1.abilityName)); - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.uri : ' - + JSON.stringify(element1.uri)); - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.shortName : ' - + JSON.stringify(element1.shortName)); - }, - onFailed:function (code:any) { - console.log('particleAbility_connectAbility_test_0600 ConnectAbility onFailed errCode:' + code); - }, - } - - let connection_succeeded:any; - console.info('particleAbility_connectAbility_test_0600 start '); - var timeOldStamp = getNowTime(); - var connection = particleAbility.connectAbility(request, options); - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0600 connectability', timeOldStamp, timeNewStamp); - connection_succeeded = connection; - console.info('particleAbility_connectAbility_test_0600 service request is:' + JSON.stringify(request)); - console.info('particleAbility_connectAbility_test_0600 options is:' + JSON.stringify(options)); - console.info('particleAbility_connectAbility_test_0600 data is: ' + JSON.stringify(connection)); - console.info('particleAbility_connectAbility_test_0600 connection=: ' + connection); - sleep(5000); - console.info('particleAbility_connectAbility_test_0600 disconnectability start '); - var timeOldStamp = getNowTime(); - particleAbility.disconnectAbility(connection_succeeded).then((data: any) => { - var timeNewStamp = getNowTime(); - getDurationTime('particleAbility_connectAbility_test_0600 disconnectability', timeOldStamp, timeNewStamp); - console.info('particleAbility_connectAbility_test_0600 disconnectability succeeded: ' + - JSON.stringify(data)); - }).catch((error: any) =>{ - console.error('particleAbility_connectAbility_test_0600 disconnectability failed. Cause: ' + - JSON.stringify(error)); - }); - }, - onConnect(want) { - console.info('ServiceAbility7 onConnect'); - return new StubTest7("test"); - }, - onDisConnect(want) { - console.info('ServiceAbility7 onDisConnect'); - }, -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets deleted file mode 100644 index 9511bef9a..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index 011878f2b..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@system.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } - - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 143e3ae5c..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', - '-s level', '-s testType', '-s size', '-s timeout', - '-s package' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - } - - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets deleted file mode 100644 index 7cb1ace93..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets +++ /dev/null @@ -1,249 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility' -import {describe, beforeEach, afterEach, it, expect} from 'hypium/index'; -import Utils from './Utils'; - -export default function ContextJsunit() { - describe('appInfoTest_ability_2', function () { - beforeEach(async function (done) { - console.info("context before each called"); - done() - }); - - afterEach(async function () { - await Utils.sleep(2000); - console.info("context after each called"); - }); - - /* - * @tc.number: context_getCacheDir_test_0100 - * @tc.name: getCacheDir : Obtains the Cache directory on internal storage. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it("context_getCacheDir_test_0100", 0, async function (done) { - console.log("------------------start context_getCacheDir_test_0100-------------------"); - try { - var timeOldStamp = await Utils.getNowTime(); - var context = await featureAbility.getContext(); - context.getCacheDir().then((data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getCacheDir_test_0100', timeOldStamp, timeNewStamp) - console.log("context_getCacheDir_test_0100: CacheDir is " + data); - }) - } catch (error) { - console.log("logMessage context_getCacheDir_test_0100: error = " + error); - expect(error).assertEqual("/data/storage/el2/base/haps/entry/cache"); - } - var data1 = await context.getCacheDir(); - expect(typeof (data1)).assertEqual("string"); - expect(data1).assertEqual("/data/storage/el2/base/haps/entry/cache"); - done(); - console.log("------------------end context_getCacheDir_test_0100-------------------"); - }); - - /* - * @tc.number: context_getCacheDir_test_0200 - * @tc.name: getCacheDir : Obtains the Cache directory on internal storage. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it("context_getCacheDir_test_0200", 0, async function (done) { - console.log("------------------start context_getCacheDir_test_0200-------------------"); - try { - var timeOldStamp = await Utils.getNowTime(); - var context = await featureAbility.getContext(); - context.getCacheDir((err, data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getCacheDir_test_0200', timeOldStamp, timeNewStamp) - console.log("context_getCacheDir_test_0200: getCacheDir successful, result = " + data); - }); - } catch (error) { - console.log("logMessage context_getCacheDir_test_0200: error = " + error); - expect(error).assertEqual("/data/storage/el2/base/haps/entry/cache"); - } - var data1 = await context.getCacheDir(); - expect(typeof (data1)).assertEqual("string"); - expect(data1).assertEqual("/data/storage/el2/base/haps/entry/cache"); - done(); - console.log("------------------end context_getCacheDir_test_0200-------------------"); - }); - - /* - * @tc.number: context_getFilesDir_test_0100 - * @tc.name: getFilesDir : Obtains the files directory on internal storage. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it("context_getFilesDir_test_0100", 0, async function (done) { - console.log("------------------start context_getFilesDir_test_0100-------------------"); - try { - var timeOldStamp = await Utils.getNowTime(); - var context = await featureAbility.getContext(); - context.getFilesDir().then((data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getFilesDir_test_0100', timeOldStamp, timeNewStamp) - console.log("context_getFilesDir_test_0100:FilesDir is " + data); - }) - } catch (error) { - console.log("logMessage context_getFilesDir_test_0100: error = " + error); - expect(error).assertEqual("/data/storage/el2/base/haps/entry/files"); - } - var data1 = await context.getFilesDir(); - expect(typeof (data1)).assertEqual("string"); - expect(data1).assertEqual("/data/storage/el2/base/haps/entry/files"); - done(); - console.log("------------------end context_getFilesDir_test_0100-------------------"); - }); - - /* - * @tc.number: context_getFilesDir_test_0200 - * @tc.name: getFilesDir : Obtains the files directory on internal storage. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it("context_getFilesDir_test_0200", 0, async function (done) { - console.log("------------------start context_getFilesDir_test_0200-------------------"); - try { - var timeOldStamp = await Utils.getNowTime(); - var context = await featureAbility.getContext(); - context.getFilesDir((err, data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getFilesDir_test_0200', timeOldStamp, timeNewStamp) - console.log("context_getFilesDir_test_0200: getFilesDir successful, result = " + data); - }); - } catch (error) { - console.log("logMessage context_getFilesDir_test_0200: error = " + error); - expect(error).assertEqual("/data/storage/el2/base/haps/entry/files"); - } - var data1 = await context.getFilesDir(); - expect(typeof (data1)).assertEqual("string"); - expect(data1).assertEqual("/data/storage/el2/base/haps/entry/files"); - done(); - console.log("------------------end context_getFilesDir_test_0200-------------------"); - }); - - - /* - * @tc.number: context_getOrCreateDistributedDir_test_0100 - * @tc.name: getOrCreateDistributedDir : Obtains the directory of Distributed files. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it("context_getOrCreateDistributedDir_0100", 0, async function (done) { - console.log("------------------start context_getOrCreateDistributedDir_0100-------------------"); - try { - var timeOldStamp = await Utils.getNowTime(); - var context = await featureAbility.getContext(); - context.getOrCreateDistributedDir().then((data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getOrCreateDistributedDir_0100', timeOldStamp, timeNewStamp); - console.log("context_getOrCreateDistributedDir_0100: DistributedDir is " + data); - }) - } catch (error) { - console.log("logMessage context_getOrCreateDistributedDir_0100: error = " + error); - expect(error).assertEqual("/data/storage/el2/distributedfiles/entry"); - } - var data1 = await context.getOrCreateDistributedDir(); - expect(typeof (data1)).assertEqual("string"); - expect(data1).assertEqual("/data/storage/el2/distributedfiles"); - done(); - console.log("------------------end context_getOrCreateDistributedDir_0100-------------------"); - }); - - /* - * @tc.number: context_getOrCreateDistributedDir_0200 - * @tc.name: getOrCreateDistributedDir : Obtains the directory of Distributed files. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it("context_getOrCreateDistributedDir_0200", 0, async function (done) { - console.log("------------------start context_getOrCreateDistributedDir_0200-------------------"); - try { - var timeOldStamp = await Utils.getNowTime(); - var context = await featureAbility.getContext(); - context.getOrCreateDistributedDir((err, data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getOrCreateDistributedDir_0200', timeOldStamp, timeNewStamp); - console.log("context_getOrCreateDistributedDir_0200: getOrCreateDistributedDir successful, result = " + data); - }); - } catch (error) { - console.log("logMessage context_getOrCreateDistributedDir_0200: error = " + error); - expect(error).assertEqual("/data/storage/el2/distributedfiles/entry"); - } - var data1 = await context.getOrCreateDistributedDir(); - expect(typeof (data1)).assertEqual("string"); - expect(data1).assertEqual("/data/storage/el2/distributedfiles"); - done(); - console.log("------------------end context_getOrCreateDistributedDir_0200-------------------"); - }); - - /* - * @tc.number: context_getAppType_0100 - * @tc.name: getAppType : Obtains the type of current application. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it("context_getAppType_0100", 0, async function (done) { - console.log("------------------start context_getAppType_0100-------------------"); - try { - var timeOldStamp = await Utils.getNowTime(); - var context = await featureAbility.getContext(); - context.getAppType().then((data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getAppType_0100_0100', timeOldStamp, timeNewStamp); - console.log("context_getAppType_0100: AppType is " + data); - }) - } catch (error) { - console.log("logMessage context_getAppType_0100: error = " + error); - expect(error).assertEqual("system"); - } - var data1 = await context.getAppType(); - expect(typeof (data1)).assertEqual("string"); - expect(data1).assertEqual("system"); - done(); - console.log("------------------end context_getAppType_0100-------------------"); - }); - - /* - * @tc.number: context_getAppType_0200 - * @tc.name: getAppType : Obtains the type of current application. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it("context_getAppType_0200", 0, async function (done) { - console.log("------------------start context_getAppType_0200-------------------"); - try { - var timeOldStamp = await Utils.getNowTime(); - var context = await featureAbility.getContext(); - context.getAppType((err, data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getAppType_0200_0100', timeOldStamp, timeNewStamp); - console.log("context_getAppType_0200: getAppType successful, result = " + data); - }); - } catch (error) { - console.log("logMessage context_getAppType_0200: error = " + error); - expect(error).assertEqual("system"); - } - var data1 = await context.getAppType(); - expect(typeof (data1)).assertEqual("string"); - expect(data1).assertEqual("system"); - done(); - console.log("------------------end context_getAppType_0200-------------------"); - }); - }) -} diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index fea9b5561..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import addContextAndAbilityJsunit from './addContextAndAbilityJsunit.test.ets'; -import getHapModuleInfoJsunit from './getHapModuleInfoJsunit.test.ets'; -import getAbilityInfoJsunit from './getAbilityInfoJsunit.test.ets'; -import getApplicationContext from './getApplicationContextJsunit.test.ets'; -import getAppVersionInfoJsunit from './getAppVersionInfoJsunit.test.ets'; -import ContextJsunit from './ContextJsunit.test.ets'; - -export default function testsuite() { - ContextJsunit(); - addContextAndAbilityJsunit(); - getHapModuleInfoJsunit(); - getAbilityInfoJsunit(); - getApplicationContext(); - getAppVersionInfoJsunit(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/Utils.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/Utils.ets deleted file mode 100644 index d347b0406..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/Utils.ets +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default class Utils { - static sleep(time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(reject) - }, time) - }).then(() => { - console.info(`sleep ${time} over...`) - }) - } - - static getNowTime() { - return new Date().getTime(); - } - - /** - * 接口调用时间 - * @param startTime 接口调用开始时间 - * @param endTime 接口调用结束时间 - */ - static getDurationTime(msg, startTime, endTime) { - console.info(msg + 'Get Interface startTime: ' + startTime); - console.info(msg + 'Get Interface endTime: ' + endTime); - var duration = (endTime - startTime) - console.info(msg + 'Get Interface Duration: ' + duration); - return duration; - } -} - - - - diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets deleted file mode 100644 index 0c166c9ce..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets +++ /dev/null @@ -1,301 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, it, expect} from 'hypium/index'; -import Utils from './Utils'; -import ability_featureAbility from '@ohos.ability.featureAbility'; -import ability_particleAbility from '@ohos.ability.particleAbility'; -import abilityManager from "@ohos.application.appManager" - -const TAG_TEST_0100 = ' context_isUpdatingConfigurations_test_0100 '; -const TAG_TEST_0200 = ' context_isUpdatingConfigurations_test_0200 '; -const TAG_TEST_0300 = ' context_printDrawnCompleted_test_0100 '; -const TAG_TEST_0400 = ' context_printDrawnCompleted_test_0200 '; -const TAG_TEST_0500 = ' context_getAppMemorySize_test_0100 '; -const TAG_TEST_0600 = ' context_getAppMemorySize_test_0200 '; -const TAG_TEST_0700 = ' context_isRamConstrainedDevice_test_0100 '; -const TAG_TEST_0800 = ' context_isRamConstrainedDevice_test_0200 '; -const TAG_TEST_0900 = ' context_featureAbility_test_0100 '; -const TAG_TEST_0010 = ' context_featureAbility_test_0200 '; -const TAG_TEST_0011 = ' context_featureAbility_test_0300 '; -const TAG_TEST_0012 = ' context_featureAbility_test_0400 '; - -export default function addContextAndAbilityJsunit() { - describe('appInfoTest_ability_1', function () { - /* - * @tc.number: context_isUpdatingConfigurations_test_0100 - * @tc.name: isUpdatingConfigurations : Obtains whether the configuration of the current ability is changing. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it(TAG_TEST_0100, 0, async function (done) { - console.info(TAG_TEST_0100 + 'promise START'); - let detailed; - var startTime = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - await context.isUpdatingConfigurations().then((data) => { - var endTime = Utils.getNowTime(); - Utils.getDurationTime(TAG_TEST_0100, startTime, endTime) - console.info(TAG_TEST_0100 + ' promise data is:' + JSON.stringify(data)); - detailed = data; - }).catch((error) => { - console.error(TAG_TEST_0100 + 'promise errors is: ' + JSON.stringify(error)); - }) - expect(typeof (detailed)).assertEqual("boolean"); - expect(detailed).assertEqual(false); - done(); - console.log('------------------ ' + TAG_TEST_0100 + ' end -------------------'); - }); - - /* - * @tc.number: context_isUpdatingConfigurations_test_0200 - * @tc.name: isUpdatingConfigurations : Obtains whether the configuration of the current ability is changing. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it(TAG_TEST_0200, 0, async function (done) { - let detailed; - console.info(TAG_TEST_0200 + 'callBack START'); - try { - var startTime = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - context.isUpdatingConfigurations((error, data) => { - var endTime = Utils.getNowTime(); - Utils.getDurationTime(TAG_TEST_0200, startTime, endTime) - detailed = data; - console.info(TAG_TEST_0200 + ' callBack succeeded. data is:' + JSON.stringify(data)); - }); - } catch (error) { - console.error(TAG_TEST_0200 + 'Operation failed. Cause: ' + JSON.stringify(error)); - } - await Utils.sleep(2000) - expect(typeof (detailed)).assertEqual("boolean"); - expect(detailed).assertEqual(false); - done(); - console.log('------------------ ' + TAG_TEST_0200 + ' end -------------------'); - }); - - /* - * @tc.number: context_printDrawnCompleted_test_0100 - * @tc.name: printDrawnCompleted : Inform the system of the time required to complete the drawing of the page - capability. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it(TAG_TEST_0300, 0, async function (done) { - let detailed; - console.info(TAG_TEST_0300 + 'callBack START'); - var startTime = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - await context.printDrawnCompleted().then((data) => { - var endTime = Utils.getNowTime(); - Utils.getDurationTime(TAG_TEST_0300, startTime, endTime) - console.info(TAG_TEST_0300 + ' promise data is:' + JSON.stringify(data)); - detailed = data; - }).catch((error) => { - console.error(TAG_TEST_0300 + 'promise error is: ' + JSON.stringify(error)); - }); - await Utils.sleep(2000) - expect(detailed).assertEqual(null); - done(); - console.log('------------------ ' + TAG_TEST_0300 + ' end -------------------'); - }) - - - /* - * @tc.number: context_printDrawnCompleted_test_0200 - * @tc.name: printDrawnCompleted : Inform the system of the time required to complete the drawing of the page - capability. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it(TAG_TEST_0400, 0, async function (done) { - let detailed; - console.info(TAG_TEST_0400 + 'callBack START'); - try { - var startTime = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - context.printDrawnCompleted((error, data) => { - var endTime = Utils.getNowTime(); - Utils.getDurationTime(TAG_TEST_0300, startTime, endTime) - detailed = data; - console.info(TAG_TEST_0400 + ' callBack succeeded. data is:' + JSON.stringify(data)); - }); - } catch (error) { - console.error(TAG_TEST_0400 + 'Operation failed. Cause: ' + JSON.stringify(error)); - } - await Utils.sleep(2000) - expect(detailed).assertEqual(null); - done(); - console.log('------------------ ' + TAG_TEST_0400 + ' end -------------------'); - }) - - - /* - * @tc.number: context_getAppMemorySize_test_0100 - * @tc.name: getAppMemorySize : Obtains the memory size of the application. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it(TAG_TEST_0500, 0, async function (done) { - console.info(TAG_TEST_0500 + 'promise START'); - let detailed; - var startTime = await Utils.getNowTime(); - await abilityManager.getAppMemorySize() - .then((data) => { - var endTime = Utils.getNowTime(); - Utils.getDurationTime(TAG_TEST_0500, startTime, endTime) - console.info(TAG_TEST_0500 + ' promise data is:' + JSON.stringify(data)); - detailed = data; - }).catch((error) => { - console.error(TAG_TEST_0500 + 'promise errors is: ' + JSON.stringify(error)); - }) - await Utils.sleep(2000) - expect(typeof (detailed)).assertEqual("number"); - expect(detailed).assertEqual(512); - done(); - console.log('------------------ ' + TAG_TEST_0500 + ' end -------------------'); - }); - - /* - * @tc.number: context_getAppMemorySize_test_0200 - * @tc.name: getAppMemorySize : Obtains the memory size of the application. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it(TAG_TEST_0600, 0, async function (done) { - console.info(TAG_TEST_0600 + 'callBack START'); - var startTime = await Utils.getNowTime(); - abilityManager.getAppMemorySize((error, data) => { - var endTime = Utils.getNowTime(); - Utils.getDurationTime(TAG_TEST_0500, startTime, endTime) - console.info(TAG_TEST_0600 + ' callBack error is: ' + JSON.stringify(error)); - console.info(TAG_TEST_0600 + ' callBack data is:' + JSON.stringify(data)); - expect(typeof (data)).assertEqual("number"); - expect(data).assertEqual(512); - console.log('------------------ ' + TAG_TEST_0600 + ' end -------------------'); - done(); - }) - }); - - /* - * @tc.number: context_isRamConstrainedDevice_test_0100 - * @tc.name: isRamConstrainedDevice : Obtains whether the current device has low ram. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it(TAG_TEST_0700, 0, async function (done) { - let detailed; - console.info(TAG_TEST_0700 + 'promise START'); - var startTime = await Utils.getNowTime(); - await abilityManager.isRamConstrainedDevice().then((data) => { - var endTime = Utils.getNowTime(); - Utils.getDurationTime(TAG_TEST_0500, startTime, endTime) - console.info(TAG_TEST_0700 + ' promise data is:' + JSON.stringify(data)); - detailed = data; - }).catch((error) => { - console.error(TAG_TEST_0700 + 'promise errors is: ' + JSON.stringify(error)); - }) - await Utils.sleep(1000) - expect(typeof (detailed)).assertEqual("boolean"); - expect(detailed).assertEqual(false) - done(); - console.log('------------------ ' + TAG_TEST_0700 + ' end -------------------'); - }); - - /* - * @tc.number: context_isRamConstrainedDevice_test_0200 - * @tc.name: isRamConstrainedDevice : Obtains whether the current device has low ram. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it(TAG_TEST_0800, 0, async function (done) { - console.info(TAG_TEST_0800 + 'callBack START'); - var startTime = await Utils.getNowTime(); - abilityManager.isRamConstrainedDevice((error, data) => { - var endTime = Utils.getNowTime(); - Utils.getDurationTime(TAG_TEST_0500, startTime, endTime) - console.info(TAG_TEST_0800 + ' callBack error is:' + error); - console.info(TAG_TEST_0800 + ' callBack data is:' + JSON.stringify(data)); - expect(typeof (data)).assertEqual("boolean"); - expect(data).assertEqual(false); - done(); - }) - console.log('------------------ ' + TAG_TEST_0800 + ' end -------------------'); - }); - /* - * @tc.number: context_featureAbility_test_0100 - * @tc.name: featureAbility.ErrorCode : featureAbility.ErrorCode - * @tc.desc: Check the featureAbility.ErrorCode.NO_ERROR - * @tc.level 0 - */ - it(TAG_TEST_0900, 0, async function (done) { - console.info(TAG_TEST_0900 + ' NO_ERROR START'); - var no_error = ability_featureAbility.ErrorCode.NO_ERROR - console.info(TAG_TEST_0900 + ' featureAbility no_error is: ' + no_error); - expect(typeof (no_error)).assertEqual("number"); - expect(no_error).assertEqual(0); - done(); - console.log('------------------ ' + TAG_TEST_0900 + ' end -------------------'); - }); - - /* - * @tc.number: context_featureAbility_test_0200 - * @tc.name: featureAbility.ErrorCode : featureAbility.ErrorCode - * @tc.desc: Check the featureAbility.ErrorCode.INVALID_PARAMETER - * @tc.level 0 - */ - it(TAG_TEST_0010, 0, async function (done) { - console.info(TAG_TEST_0010 + ' INVALID_PARAMETER START'); - var invalid_parameter = ability_featureAbility.ErrorCode.INVALID_PARAMETER - console.info(TAG_TEST_0010 + ' featureAbility invalid_parameter is: ' + invalid_parameter); - expect(typeof (invalid_parameter)).assertEqual("number"); - expect(invalid_parameter).assertEqual(-1); - done(); - console.log('------------------ ' + TAG_TEST_0010 + ' end -------------------'); - }); - - /* - * @tc.number: context_featureAbility_test_0300 - * @tc.name: featureAbility.ErrorCode : featureAbility.ErrorCode - * @tc.desc: Check the featureAbility.ErrorCode.ABILITY_NOT_FOUND - * @tc.level 0 - */ - it(TAG_TEST_0011, 0, async function (done) { - console.info(TAG_TEST_0011 + ' ABILITY_NOT_FOUND START'); - var ability_not_found = ability_featureAbility.ErrorCode.ABILITY_NOT_FOUND - console.info(TAG_TEST_0011 + ' featureAbility ability_not_found is: ' + ability_not_found); - expect(typeof (ability_not_found)).assertEqual("number"); - expect(ability_not_found).assertEqual(-2); - done(); - console.log('------------------ ' + TAG_TEST_0011 + ' end -------------------'); - }); - - /* - * @tc.number: context_featureAbility_test_0400 - * @tc.name: featureAbility.ErrorCode : featureAbility.ErrorCode - * @tc.desc: Check the featureAbility.ErrorCode.PERMISSION_DENY - * @tc.level 0 - */ - it(TAG_TEST_0012, 0, async function (done) { - console.info(TAG_TEST_0012 + ' PERMISSION_DENY START'); - var permission_deny = ability_featureAbility.ErrorCode.PERMISSION_DENY - console.info(TAG_TEST_0012 + ' featureAbility permission_deny is: ' + permission_deny); - expect(typeof (permission_deny)).assertEqual("number"); - expect(permission_deny).assertEqual(-3); - done(); - console.log('------------------ ' + TAG_TEST_0012 + ' end -------------------'); - }); - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets deleted file mode 100644 index 7440b324c..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets +++ /dev/null @@ -1,333 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, it, expect} from 'hypium/index'; -import Utils from './Utils'; -import ability_featureAbility from '@ohos.ability.featureAbility'; - -export default function getHapModuleInfoJsunit() { - describe('appInfoTest_ability_3', function () { - - /** - * @tc.number: context_getAbilityInfo_test_0100 - * @tc.name: getAbilityInfo:Query the current attributionability details. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it('context_getAbilityInfo_test_0100', 0, async function (done) { - console.info('[context_getAbilityInfo_test_0100] START'); - await Utils.sleep(1000); - var timeOldStamp = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - await context.getAbilityInfo() - .then((data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getAbilityInfo_test_0100', timeOldStamp, timeNewStamp); - console.info('[context_getAbilityInfo_test_0100] data is:' + JSON.stringify(data)); - expect(typeof (data)).assertEqual("object"); - }).catch((error) => { - console.error('[context_getAbilityInfo_test_0100] failed:' + JSON.stringify(error)); - }) - var promise = await context.getAbilityInfo(); - console.info('--[context_getAbilityInfo_test_0100] check---'); - checkAbilityInfo('context_getAbilityInfo_test_0100', promise); - console.info('[context_getAbilityInfo_test_0100] FINISH'); - done(); - }); - - async function startAbility2() { - var str = { - "want": { - "bundleName": "com.ohos.acecollaboration", - "abilityName": "com.ohos.acecollaboration.MainAbility2", - }, - }; - ability_featureAbility.startAbility(str).then((data) => { - console.info('context_getAbilityInfo_test_0300 startMainAbility2 succeeded: ' + JSON.stringify(data)); - }).catch((error) => { - console.error('context_getAbilityInfo_test_0300 startMainAbility2 failed. Cause: ' + JSON.stringify(error)); - }); - } - - /** - * @tc.number: context_getAbilityInfo_test_0200 - * @tc.name: getAbilityInfo:Query the current attributionability details. - * @tc.desc: Check the return value of the interface (by AsyncCallback) - * @tc.level 0 - */ - it('context_getAbilityInfo_test_0200', 0, async function (done) { - try { - console.info('[context_getAbilityInfo_test_0200] START'); - await Utils.sleep(1000); - var timeOldStamp = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - context.getAbilityInfo((error, data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getAbilityInfo_test_0200', timeOldStamp, timeNewStamp); - console.info('[context_getAbilityInfo_test_0200] data is:' + JSON.stringify(data)); - expect(typeof (data)).assertEqual("object"); - }); - } catch (error) { - console.error('[context_getAbilityInfo_test_0200] failed: ' + JSON.stringify(error)); - } - var callback = await context.getAbilityInfo(); - console.info('---[context_getAbilityInfo_test_0200] check---'); - checkAbilityInfo('context_getAbilityInfo_test_0200', callback); - console.info('[context_getAbilityInfo_test_0200] FINISH'); - done(); - }) - - - /** - * @tc.number: context_getAbilityInfo_test_0300_1 - * @tc.name: getAbilityInfo:Query the current attributionability details. - * @tc.desc: Check the return value of the interface - * @tc.level 0 - */ - it('context_getAbilityInfo_test_0300_1', 0, async function (done) { - console.info('[context_getAbilityInfo_test_0300] STARTability'); - startAbility2(); - done(); - }); - - /** - * @tc.number: context_getAbilityInfo_test_0400 - * @tc.name: getAbilityInfo:Query the current attributionability details. - * @tc.desc: Check the return value of the interface (by promise) - * @tc.level 0 - */ - it('context_getAbilityInfo_test_0400', 0, async function (done) { - console.info('[context_getAbilityInfo_test_0400] START'); - await Utils.sleep(1000); - var timeOldStamp = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - await context.getAbilityInfo() - .then((data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getAbilityInfo_test_0400', timeOldStamp, timeNewStamp); - console.info('[context_getAbilityInfo_test_0400] data is:' + JSON.stringify(data)); - expect(typeof (data)).assertEqual("object"); - }).catch((error) => { - console.error('[context_getAbilityInfo_test_0400] failed:' + JSON.stringify(error)); - }) - var promise = await context.getAbilityInfo(); - console.info('--[context_getAbilityInfo_test_0400] check---'); - checkAbilityInfo('context_getAbilityInfo_test_0400', promise); - console.info('[context_getAbilityInfo_test_0400] FINISH'); - done(); - }); - - function checkAbilityInfo(msg, data) { - console.log(msg + "checkAbilityInfo start " + JSON.stringify(data)); - console.log(msg + "checkAbilityInfo bundleName : " + data.bundleName); - console.log(msg + "checkAbilityInfo name : " + data.name); - console.log(msg + "checkAbilityInfo label : " + data.label); - console.log(msg + "checkAbilityInfo description : " + data.description); - console.log(msg + "checkAbilityInfo icon : " + data.icon); - console.log(msg + "checkAbilityInfo descriptionId : " + data.descriptionId); - console.log(msg + "checkAbilityInfo iconId : " + data.iconId); - console.log(msg + "checkAbilityInfo moduleName : " + data.moduleName); - console.log(msg + "checkAbilityInfo process : " + data.process); - console.log(msg + "checkAbilityInfo targetAbility : " + data.targetAbility); - console.log(msg + "checkAbilityInfo backgroundModes : " + data.backgroundModes); - console.log(msg + "checkAbilityInfo isVisible : " + data.isVisible); - console.log(msg + "checkAbilityInfo formEnabled : " + data.formEnabled); - console.log(msg + "checkAbilityInfo type : " + data.type) - console.log(msg + "checkAbilityInfo orientation : " + data.orientation); - console.log(msg + "checkAbilityInfo launchMode : " + data.launchMode); - console.log(msg + "checkAbilityInfo permissions length : " + data.permissions.length); - for (var j = 0; j < data.permissions.length; j++) { - console.log(msg + "getAbilityInfo data.permissions[" + j + "] : " + data.permissions[j]); - } - console.log(msg + "checkAbilityInfo deviceTypes length : " + data.deviceTypes.length); - for (var k = 0; k < data.deviceTypes.length; k++) { - console.log(msg + "getAbilityInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]); - } - console.log(msg + "checkAbilityInfo deviceCapabilities length : " + data.deviceCapabilities.length); - for (var i = 0; i < data.deviceCapabilities.length; i++) { - console.log(msg + "getAbilityInfo data.deviceCapabilities[" + i + "] : " + data.deviceCapabilities[i]); - } - console.log(msg + "checkAbilityInfo readPermission : " + data.readPermission); - console.log(msg + "checkAbilityInfo writePermission : " + data.writePermission); - console.log(msg + "checkAbilityInfo formEntity : " + data.formEntity); - console.log(msg + "checkAbilityInfo minFormHeight : " + data.minFormHeight); - console.log(msg + "checkAbilityInfo defaultFormHeight : " + data.defaultFormHeight); - console.log(msg + "checkAbilityInfo minFormWidth : " + data.minFormWidth); - console.log(msg + "checkAbilityInfo defaultFormWidth : " + data.defaultFormWidth); - console.log(msg + "checkAbilityInfo uri : " + data.uri); - console.log(msg + "checkAbilityInfo customizeData : " + data.customizeData); - console.log(msg + "checkAbilityInfo labelId : " + data.labelId); - console.log(msg + "checkAbilityInfo subType : " + data.subType); - - expect(typeof (data)).assertEqual("object"); - expect(typeof (data.bundleName)).assertEqual("string"); - expect(typeof (data.name)).assertEqual("string"); - expect(typeof (data.label)).assertEqual("string"); - expect(typeof (data.description)).assertEqual("string"); - expect(typeof (data.icon)).assertEqual("string"); - expect(typeof (data.labelId)).assertEqual("number"); - expect(typeof (data.descriptionId)).assertEqual("number"); - expect(typeof (data.iconId)).assertEqual("number"); - expect(typeof (data.moduleName)).assertEqual("string"); - expect(typeof (data.process)).assertEqual("string"); - expect(typeof (data.targetAbility)).assertEqual("string"); - expect(typeof (data.backgroundModes)).assertEqual("number"); - expect(typeof (data.isVisible)).assertEqual("boolean"); - expect(typeof (data.formEnabled)).assertEqual("boolean"); - expect(typeof (data.type)).assertEqual("number"); - expect(typeof (data.subType)).assertEqual("number"); - expect(typeof (data.orientation)).assertEqual("number"); - expect(typeof (data.launchMode)).assertEqual("number"); - expect(Array.isArray(data.permissions)).assertEqual(true); - expect(Array.isArray(data.deviceTypes)).assertEqual(true); - expect(Array.isArray(data.deviceCapabilities)).assertEqual(true); - expect(typeof (data.readPermission)).assertEqual("string"); - expect(typeof (data.writePermission)).assertEqual("string"); - expect(typeof (data.applicationInfo)).assertEqual("object"); - expect(typeof (data.formEntity)).assertEqual("number"); - expect(typeof (data.minFormHeight)).assertEqual("number"); - expect(typeof (data.defaultFormHeight)).assertEqual("number"); - expect(typeof (data.minFormWidth)).assertEqual("number"); - expect(typeof (data.defaultFormWidth)).assertEqual("number"); - expect(typeof (data.uri)).assertEqual("string"); - - expect(data.bundleName).assertEqual("com.ohos.acecollaboration"); - expect(data.name).assertEqual("com.ohos.acecollaboration.MainAbility"); - expect(data.label).assertEqual("$string:entry_MainAbility"); - expect(data.description).assertEqual("$string:mainability_description"); - expect(data.icon).assertEqual("$media:icon"); - expect(data.descriptionId > 0).assertTrue(); - expect(data.iconId > 0).assertTrue(); - expect(data.moduleName).assertEqual("entry"); - expect(data.process).assertEqual(""); - expect(data.targetAbility).assertEqual(""); - expect(data.backgroundModes).assertEqual(0); - expect(data.isVisible).assertEqual(true); - expect(data.formEnabled).assertEqual(false); - expect(data.type).assertEqual(1); - expect(data.orientation).assertEqual(0); - expect(data.launchMode).assertEqual(1); - expect(data.deviceTypes[0]).assertEqual("phone"); - expect(data.readPermission).assertEqual(""); - expect(data.writePermission).assertEqual(""); - checkApplicationInfo(msg, data.applicationInfo); - expect(data.formEntity).assertEqual(0); - expect(data.minFormHeight).assertEqual(0); - expect(data.defaultFormHeight).assertEqual(0); - expect(data.minFormWidth).assertEqual(0); - expect(data.defaultFormWidth).assertEqual(0); - expect(data.uri).assertEqual(""); - expect(data.labelId > 0).assertTrue(); - expect(data.subType).assertEqual(0); - - console.log(msg + "---checkAbilityInfo End--- "); - } - - function checkApplicationInfo(msg, info) { - console.log(msg + "checkApplicationInfo start : " + JSON.stringify(info)); - console.log(msg + "checkApplicationInfo name : " + info.name); - console.log(msg + "checkApplicationInfo description : " + info.description); - console.log(msg + "checkApplicationInfo descriptionId : " + info.descriptionId); - console.log(msg + "checkApplicationInfo systemApp : " + info.systemApp); - console.log(msg + "checkApplicationInfo enabled : " + info.enabled); - console.log(msg + "checkApplicationInfo label : " + info.label); - console.log(msg + "checkApplicationInfo labelId : " + info.labelId); - console.log(msg + "checkApplicationInfo icon : " + info.icon); - console.log(msg + "checkApplicationInfo iconId : " + info.iconId); - console.log(msg + "checkApplicationInfo process : " + info.process); - console.log(msg + "checkApplicationInfo supportedModes : " + info.supportedModes); - - console.log(msg + "checkApplicationInfo moduleSourceDirs length : " + info.moduleSourceDirs.length); - for (var j = 0; j < info.moduleSourceDirs.length; j++) { - console.log(msg + "checkApplicationInfo info.moduleSourceDirs[" + j + "] : " + info.moduleSourceDirs[j]); - } - console.log(msg + "checkApplicationInfo permissions length : " + info.permissions.length); - for (var k = 0; k < info.permissions.length; k++) { - console.log(msg + "checkApplicationInfo info.permissions[" + k + "] : " + info.permissions[k]); - } - console.log(msg + "checkApplicationInfo moduleInfos length : " + info.moduleInfos.length); - for (var i = 0; i < info.moduleInfos.length; i++) { - console.log(msg + "checkApplicationInfo info.moduleInfos[" + i + "].moduleName : " - + info.moduleInfos[i].moduleName); - console.log(msg + "checkApplicationInfo info.moduleInfos[" + i + "].moduleSourceDir : " - + info.moduleInfos[i].moduleSourceDir); - } - console.log(msg + "checkApplicationInfo entryDir : " + info.entryDir); - - expect(typeof (info)).assertEqual("object"); - expect(typeof (info.name)).assertEqual("string"); - expect(typeof (info.description)).assertEqual("string"); - expect(typeof (info.descriptionId)).assertEqual("number"); - expect(typeof (info.systemApp)).assertEqual("boolean"); - expect(typeof (info.enabled)).assertEqual("boolean"); - expect(typeof (info.label)).assertEqual("string"); - expect(typeof (info.labelId)).assertEqual("string"); - expect(typeof (info.icon)).assertEqual("string"); - expect(typeof (info.iconId)).assertEqual("string"); - expect(typeof (info.process)).assertEqual("string"); - expect(typeof (info.supportedModes)).assertEqual("number"); - expect(Array.isArray(info.moduleSourceDirs)).assertEqual(true); - expect(Array.isArray(info.permissions)).assertEqual(true); - expect(Array.isArray(info.moduleInfos)).assertEqual(true); - expect(typeof (info.entryDir)).assertEqual("string"); - - expect(info.name).assertEqual("com.ohos.acecollaboration"); - expect(info.description).assertEqual("$string:mainability_description"); - expect(info.descriptionId > 0).assertTrue(); - expect(info.systemApp).assertEqual(true); - expect(info.enabled).assertEqual(true); - expect(info.label).assertEqual("$string:entry_MainAbility"); - expect(info.icon).assertEqual("$media:icon"); - expect(info.process).assertEqual(""); - expect(info.supportedModes).assertEqual(0); - expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); - if (info.moduleSourceDirs.length == 1){ - expect(info.moduleInfos[0].moduleName).assertEqual("entry"); - expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); - }else if(info.moduleSourceDirs.length == 2) { - if (info.moduleInfos[0].moduleName == "myapplication1") { - expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1"); - expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.example.myapplication1"); - expect(info.moduleInfos[1].moduleName).assertEqual("entry"); - expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); - }else{ - expect(info.moduleInfos[0].moduleName).assertEqual("myapplication2"); - expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.example.myapplication2"); - expect(info.moduleInfos[1].moduleName).assertEqual("entry"); - expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); - } - }else { - expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1"); - expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.example.myapplication1"); - expect(info.moduleInfos[1].moduleName).assertEqual("myapplication2"); - expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.example.myapplication2"); - expect(info.moduleInfos[2].moduleName).assertEqual("entry"); - expect(info.moduleInfos[2].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.ohos.acecollaboration/com.ohos.acecollaboration"); - } - - console.log(msg + "---checkApplicationInfo End--- "); - - } - - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets deleted file mode 100644 index 590e1e4b2..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, it, expect} from 'hypium/index'; -import Utils from './Utils'; -import ability_featureAbility from '@ohos.ability.featureAbility'; - -export default function getHapModuleInfoJsunit() { - describe('appInfoTest_ability_5', function () { - /** - * @tc.number: context_getAppVersionInfo_test_0100 - * @tc.name: getAppVersionInfo:Gets the version information for the application. - * @tc.desc: Check the return type of the interface (by Promise) - * @tc.level 0 - */ - it('context_getAppVersionInfo_test_0100', 0, async function (done) { - console.info('[context_getAppVersionInfo_test_0100] START'); - await Utils.sleep(1000); - var timeOldStamp = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - context.getAppVersionInfo() - .then((data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getAppVersionInfo_test_0100', timeOldStamp, timeNewStamp); - console.info('[context_getAppVersionInfo_test_0100] data is:' + JSON.stringify(data)); - expect(typeof (data)).assertEqual("object"); - }).catch((error) => { - console.error('[context_getAppVersionInfo_test_0100] failed:' + JSON.stringify(error)); - }) - var promise = await context.getAppVersionInfo(); - console.info('---[context_getAppVersionInfo_test_0100] check---'); - checkAppVersionInfo('context_getAppVersionInfo_test_0100', promise); - console.info('[context_getAppVersionInfo_test_0100] FINISH'); - done(); - }); - - /** - * @tc.number: context_getAppVersionInfo_test_0200 - * @tc.name: getAppVersionInfo:Gets the version information for the application. - * @tc.desc: Check the return type of the interface (by Callback) - * @tc.level 0 - */ - it('context_getAppVersionInfo_test_0200', 0, async function (done) { - try { - console.info('[context_getAppVersionInfo_test_0200] START'); - await Utils.sleep(1000); - var timeOldStamp = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - context.getAppVersionInfo((error, data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getAppVersionInfo_test_0200', timeOldStamp, timeNewStamp); - console.info('[context_getAppVersionInfo_test_0200] data is:' + JSON.stringify(data)); - expect(typeof (data)).assertEqual("object"); - }); - } - catch (error) { - console.error('[context_getAppVersionInfo_test_0200] failed: ' + JSON.stringify(error)); - } - var callback = await context.getAppVersionInfo(); - console.info('---[context_getAppVersionInfo_test_0200] check---'); - checkAppVersionInfo('context_getAppVersionInfo_test_0200', callback); - console.info('[context_getAppVersionInfo_test_0200] FINISH'); - done(); - }); - - function checkAppVersionInfo(msg, data) { - console.log(msg + "checkAppVersionInfo start : " + JSON.stringify(data)); - console.log(msg + "checkAppVersionInfo appName : " + data.appName); - console.log(msg + "checkAppVersionInfo versionCode : " + data.versionCode); - console.log(msg + "checkAppVersionInfo versionName : " + data.versionName); - expect(typeof (data)).assertEqual("object"); - expect(typeof (data.appName)).assertEqual("string"); - expect(typeof (data.versionCode)).assertEqual("number"); - expect(typeof (data.versionName)).assertEqual("string"); - expect(data.appName).assertEqual(""); - expect(data.versionCode).assertEqual(1000000); - expect(data.versionName).assertEqual("1.0.0"); - console.log(msg + "---checkAppVersionInfo End--- "); - } - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets deleted file mode 100644 index c908de87d..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, it, expect} from 'hypium/index'; -import Utils from './Utils'; -import ability_featureAbility from '@ohos.ability.featureAbility'; - -export default function getHapModuleInfoJsunit() { - describe('appInfoTest_ability_4', function () { - /** - * @tc.number: context_getApplicationContext_test_0100 - * @tc.name: getApplicationContext:Gets the application context information. - * @tc.desc: Check the return value of the interface - * @tc.level 0 - */ - it('context_getApplicationContext_test_0100', 0, async function (done) { - try { - console.info('[context_getApplicationContext_test_0100] START'); - await Utils.sleep(1000); - var timeOldStamp = await Utils.getNowTime(); - var context = ability_featureAbility.getContext().getApplicationContext(); - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getApplicationContext_test_0100', timeOldStamp, timeNewStamp); - console.info('[context_getApplicationContext_test_0100] data is:' + JSON.stringify(context)); - } - catch (error) { - console.error('[context_getApplicationContext_test_0100] failed:' + JSON.stringify(error)); - } - expect(typeof (context)).assertEqual("object"); - console.info('[context_getApplicationContext_test_0100] FINISH'); - done(); - }); - - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets deleted file mode 100644 index 41c68c981..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets +++ /dev/null @@ -1,233 +0,0 @@ -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, it, expect} from 'hypium/index'; -import Utils from './Utils'; -import ability_featureAbility from '@ohos.ability.featureAbility'; - -export default function getHapModuleInfoJsunit() { - describe('appInfoTest_ability_6', function () { - /** - * @tc.number: context_getHapModuleInfo_test_0100 - * @tc.name: getHapModuleInfo:Obtains the HapModuleInfo object of the application. - * @tc.desc: Check the return type of the interface (by Promise) - * @tc.level 0 - */ - it('context_getHapModuleInfo_test_0100', 0, async function (done) { - console.info('[context_getHapModuleInfo_test_0100] START'); - await Utils.sleep(1000); - var timeOldStamp = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - context.getHapModuleInfo() - .then((data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getHapModuleInfo_test_0100', timeOldStamp, timeNewStamp); - console.info('[context_getHapModuleInfo_test_0100] data is:' + JSON.stringify(data)); - expect(typeof (data)).assertEqual("object"); - }) - .catch((error) => { - console.error('[context_getHapModuleInfo_test_0100] failed:' + JSON.stringify(error)); - }) - var promise = await context.getHapModuleInfo(); - console.info('---[context_getHapModuleInfo_test_0100] check---'); - checkHapModuleInfo('context_getHapModuleInfo_test_0100', promise); - console.info('[context_getHapModuleInfo_test_0100] FINISH'); - done(); - }); - - /** - * @tc.number: context_getHapModuleInfo_test_0200 - * @tc.name: getHapModuleInfo:Obtains the HapModuleInfo object of the application. - * @tc.desc: Check the return type of the interface (by Callback) - * @tc.level 0 - */ - it('context_getHapModuleInfo_test_0200', 0, async function (done) { - let callback; - try { - console.info('[context_getHapModuleInfo_test_0200] START'); - var timeOldStamp = await Utils.getNowTime(); - var context = ability_featureAbility.getContext(); - context.getHapModuleInfo((error, data) => { - var timeNewStamp = Utils.getNowTime(); - Utils.getDurationTime('context_getHapModuleInfo_test_0200', timeOldStamp, timeNewStamp); - console.info('[context_getHapModuleInfo_test_0200] data is:' + JSON.stringify(data)); - callback = data; - expect(typeof (data)).assertEqual("object"); - }); - } catch (error) { - console.error('[context_getHapModuleInfo_test_0200] failed: ' + JSON.stringify(error)); - } - await Utils.sleep(1000); - console.info('---[context_getHapModuleInfo_test_0200] check---'); - checkHapModuleInfo('context_getHapModuleInfo_test_0200', callback); - console.info('[context_getHapModuleInfo_test_0200] FINISH'); - done(); - }); - - function checkHapModuleInfo(msg, data) { - console.log(msg + "checkHapModuleInfo start " + JSON.stringify(data)); - console.log(msg + "checkHapModuleInfo name : " + data.name); - console.log(msg + "checkHapModuleInfo description : " + data.description); - console.log(msg + "checkHapModuleInfo descriptionId : " + data.descriptionId); - console.log(msg + "checkHapModuleInfo icon : " + data.icon); - console.log(msg + "checkHapModuleInfo label : " + data.label); - console.log(msg + "checkHapModuleInfo labelId : " + data.labelId); - console.log(msg + "checkHapModuleInfo iconId : " + data.iconId); - console.log(msg + "checkHapModuleInfo backgroundImg : " + data.backgroundImg); - console.log(msg + "checkHapModuleInfo supportedModes : " + data.supportedModes); - console.log(msg + "checkHapModuleInfo reqCapabilities length : " + data.reqCapabilities.length); - for (var j = 0; j < data.reqCapabilities.length; j++) { - console.log(msg + "getHapModuleInfo data.reqCapabilities[" + j + "] : " + data.reqCapabilities[j]); - } - console.log(msg + "checkHapModuleInfo deviceTypes length : " + data.deviceTypes.length); - for (var k = 0; k < data.deviceTypes.length; k++) { - console.log(msg + "getHapModuleInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]); - } - console.log(msg + "checkHapModuleInfo abilityInfos length : " + data.abilityInfos.length); - console.log(msg + "checkHapModuleInfo moduleName : " + data.moduleName); - console.log(msg + "checkHapModuleInfo mainAbilityName : " + data.mainAbilityName); - console.log(msg + "checkHapModuleInfo installationFree : " + data.installationFree); - expect(typeof (data)).assertEqual("object"); - expect(typeof (data.name)).assertEqual("string"); - expect(typeof (data.description)).assertEqual("string"); - expect(typeof (data.descriptionId)).assertEqual("number"); - expect(typeof (data.icon)).assertEqual("string"); - expect(typeof (data.label)).assertEqual("string"); - expect(typeof (data.labelId)).assertEqual("number"); - expect(typeof (data.iconId)).assertEqual("number"); - expect(typeof (data.backgroundImg)).assertEqual("string"); - expect(typeof (data.supportedModes)).assertEqual("number"); - expect(Array.isArray(data.reqCapabilities)).assertEqual(true); - expect(Array.isArray(data.deviceTypes)).assertEqual(true); - expect(Array.isArray(data.abilityInfos)).assertEqual(true); - expect(typeof (data.moduleName)).assertEqual("string"); - expect(typeof (data.mainAbilityName)).assertEqual("string"); - expect(typeof (data.installationFree)).assertEqual("boolean"); - expect(data.name).assertEqual("com.ohos.acecollaboration"); - expect(data.description).assertEqual(""); - expect(data.descriptionId).assertEqual(0); - expect(data.icon).assertEqual("$media:icon"); - expect(data.label).assertEqual("$string:entry_MainAbility"); - expect(data.labelId).assertEqual(0); - expect(data.iconId).assertEqual(0); - expect(data.backgroundImg).assertEqual(""); - expect(data.supportedModes).assertEqual(0); - expect(data.deviceTypes[0]).assertEqual("phone"); - checkAbilityInfo(msg,data.abilityInfos[0]); - expect(data.moduleName).assertEqual("entry") - expect(data.mainAbilityName).assertEqual(""); - expect(data.installationFree).assertEqual(false); - console.log(msg + "---checkHapModuleInfo End---"); - } - - function checkAbilityInfo(msg,data) { - console.log(msg+ "checkAbilityInfo start " + JSON.stringify(data)); - console.log(msg+ "checkAbilityInfo bundleName : " + data.bundleName); - console.log(msg+ "checkAbilityInfo name : " + data.name); - console.log(msg+ "checkAbilityInfo label : " + data.label); - console.log(msg+ "checkAbilityInfo description : " + data.description); - console.log(msg+ "checkAbilityInfo icon : " + data.icon); - console.log(msg+ "checkAbilityInfo descriptionId : " + data.descriptionId); - console.log(msg+ "checkAbilityInfo iconId : " + data.iconId); - console.log(msg+ "checkAbilityInfo moduleName : " + data.moduleName); - console.log(msg+ "checkAbilityInfo process : " + data.process); - console.log(msg+ "checkAbilityInfo targetAbility : " + data.targetAbility); - console.log(msg+ "checkAbilityInfo backgroundModes : " + data.backgroundModes); - console.log(msg+ "checkAbilityInfo isVisible : " + data.isVisible); - console.log(msg+ "checkAbilityInfo formEnabled : " + data.formEnabled); - console.log(msg+ "checkAbilityInfo type : " + data.type) - console.log(msg+ "checkAbilityInfo orientation : " + data.orientation); - console.log(msg+ "checkAbilityInfo launchMode : " + data.launchMode); - console.log(msg+ "checkAbilityInfo permissions length : " + data.permissions.length); - for (var j = 0; j < data.permissions.length; j++) { - console.log(msg+ "getAbilityInfo data.permissions[" + j + "] : " + data.permissions[j]); - } - console.log(msg+ "checkAbilityInfo deviceTypes length : " + data.deviceTypes.length); - for (var k = 0; k < data.deviceTypes.length; k++) { - console.log(msg+ "getAbilityInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]); - } - console.log(msg+ "checkAbilityInfo deviceCapabilities length : " + data.deviceCapabilities.length); - for (var i = 0; i < data.deviceCapabilities.length; i++) { - console.log(msg+ "getAbilityInfo data.deviceCapabilities[" + i + "] : " + data.deviceCapabilities[i]); - } - console.log(msg+ "checkAbilityInfo readPermission : " + data.readPermission); - console.log(msg+ "checkAbilityInfo writePermission : " + data.writePermission); - console.log(msg+ "checkAbilityInfo formEntity : " + data.formEntity); - console.log(msg+ "checkAbilityInfo minFormHeight : " + data.minFormHeight); - console.log(msg+ "checkAbilityInfo defaultFormHeight : " + data.defaultFormHeight); - console.log(msg+ "checkAbilityInfo minFormWidth : " + data.minFormWidth); - console.log(msg+ "checkAbilityInfo defaultFormWidth : " + data.defaultFormWidth); - console.log(msg+ "checkAbilityInfo uri : " + data.uri); - console.log(msg+ "checkAbilityInfo labelId : " + data.labelId); - console.log(msg+ "checkAbilityInfo subType : " + data.subType); - expect(typeof (data)).assertEqual("object"); - expect(typeof (data.bundleName)).assertEqual("string"); - expect(typeof (data.name)).assertEqual("string"); - expect(typeof (data.label)).assertEqual("string"); - expect(typeof (data.description)).assertEqual("string"); - expect(typeof (data.icon)).assertEqual("string"); - expect(typeof (data.labelId)).assertEqual("number"); - expect(typeof (data.descriptionId)).assertEqual("number"); - expect(typeof (data.iconId)).assertEqual("number"); - expect(typeof (data.moduleName)).assertEqual("string"); - expect(typeof (data.process)).assertEqual("string"); - expect(typeof (data.targetAbility)).assertEqual("string"); - expect(typeof (data.backgroundModes)).assertEqual("number"); - expect(typeof (data.isVisible)).assertEqual("boolean"); - expect(typeof (data.formEnabled)).assertEqual("boolean"); - expect(typeof (data.type)).assertEqual("number"); - expect(typeof (data.subType)).assertEqual("number"); - expect(typeof (data.orientation)).assertEqual("number"); - expect(typeof (data.launchMode)).assertEqual("number"); - expect(Array.isArray(data.permissions)).assertEqual(true); - expect(Array.isArray(data.deviceTypes)).assertEqual(true); - expect(Array.isArray(data.deviceCapabilities)).assertEqual(true); - expect(typeof (data.readPermission)).assertEqual("string"); - expect(typeof (data.writePermission)).assertEqual("string"); - expect(typeof (data.applicationInfo)).assertEqual("object"); - expect(typeof (data.formEntity)).assertEqual("number"); - expect(typeof (data.minFormHeight)).assertEqual("number"); - expect(typeof (data.defaultFormHeight)).assertEqual("number"); - expect(typeof (data.minFormWidth)).assertEqual("number"); - expect(typeof (data.defaultFormWidth)).assertEqual("number"); - expect(typeof (data.uri)).assertEqual("string"); - expect(data.bundleName).assertEqual("com.ohos.acecollaboration"); - expect(data.name).assertEqual("com.ohos.acecollaboration.MainAbility"); - expect(data.label).assertEqual("$string:entry_MainAbility"); - expect(data.description).assertEqual("$string:mainability_description"); - expect(data.icon).assertEqual("$media:icon"); - expect(data.moduleName).assertEqual("entry"); - expect(data.process).assertEqual(""); - expect(data.targetAbility).assertEqual(""); - expect(data.backgroundModes).assertEqual(0); - expect(data.isVisible).assertEqual(true); - expect(data.formEnabled).assertEqual(false); - expect(data.type).assertEqual(1); - expect(data.orientation).assertEqual(0); - expect(data.launchMode).assertEqual(1); - expect(data.deviceTypes[0]).assertEqual("phone"); - expect(data.readPermission).assertEqual(""); - expect(data.writePermission).assertEqual(""); - expect(data.formEntity).assertEqual(0); - expect(data.minFormHeight).assertEqual(0); - expect(data.defaultFormHeight).assertEqual(0); - expect(data.minFormWidth).assertEqual(0); - expect(data.defaultFormWidth).assertEqual(0); - expect(data.uri).assertEqual(""); - expect(data.subType).assertEqual(0); - console.log(msg+ "---checkAbilityInfo End--- "); - } - - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index febe5eef2..000000000 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "mainability_description", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - }, - { - "name": "description_serviceability2", - "value": "hap sample empty service" - }, - { - "name": "description_serviceability3", - "value": "hap sample empty service" - }, - { - "name": "description_serviceability4", - "value": "hap sample empty service" - }, - { - "name": "description_serviceability5", - "value": "hap sample empty service" - }, - { - "name": "description_mainability2", - "value": "eTS_Empty Ability2" - }, - { - "name": "entry_MainAbility2", - "value": "MainAbility2" - }, - { - "name": "description_serviceability6", - "value": "hap sample empty service" - }, - { - "name": "description_serviceability7", - "value": "hap sample empty service" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/SecondAbility/SecondAbility.ts b/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/SecondAbility/SecondAbility.ts deleted file mode 100755 index d3d4c1daa..000000000 --- a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/SecondAbility/SecondAbility.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemAppCalleeA MainAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA SecondAbility Call_Finish<======') - }) - - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemAppCalleeA MainAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -export default class SecondAbility extends Ability { - test2200(data) { - console.log("SystemAppCalleeA SecondAbility test2200"); - let recvData = new MySequenceable(0, '', ''); - data.readSequenceable(recvData); - let result = new MySequenceable(recvData.num + 1, recvData.str + "SystemAppCalleeA", ''); - return result; - } - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemAppCalleeA SecondAbility onCreate") - globalThis.abilityWant = want; - globalThis.abilityContext2 = this.context; - this.callee.on('test2200', this.test2200); - this.callee.on('testCall', testCall); - this.callee.on('testCallWithResult', testCallWithResult); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemAppCalleeA SecondAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemAppCalleeA SecondAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemAppCalleeA SecondAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemAppCalleeA SecondAbility onForeground"); - } - - onBackground() { - // Ability has back to background - console.log("SystemAppCalleeA SecondAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/ThirdAbility/ThirdAbility.ts b/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/ThirdAbility/ThirdAbility.ts deleted file mode 100755 index 3352e2a3a..000000000 --- a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/ThirdAbility/ThirdAbility.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemAppCallerA MainAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA SecondAbility Call_Finish<======') - }) - - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemAppCallerA MainAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -export default class ThirdAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemAppCalleeA ThirdAbility onCreate") - this.callee.on('testCall', testCall); - this.callee.on('testCallWithResult', testCallWithResult); - globalThis.abilityWant = want; - globalThis.abilityContext3 = this.context; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemAppCalleeA ThirdAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemAppCalleeA ThirdAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemAppCalleeA ThirdAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemAppCalleeA ThirdAbility onForeground"); - } - - onBackground() { - // Ability has back to background - console.log("SystemAppCalleeA ThirdAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/SecondAbility/SecondAbility.ts b/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/SecondAbility/SecondAbility.ts deleted file mode 100755 index b01244eb1..000000000 --- a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/SecondAbility/SecondAbility.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemAppCallerA SecondAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA SecondAbility Call_Finish<======') - }) - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemAppCallerA SecondAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -export default class SecondAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemAppCallerA SecondAbility onCreate") - globalThis.abilityWant = want; - globalThis.abilityContext = this.context; - this.callee.on('testCall', testCall); - this.callee.on('testCallWithResult', testCallWithResult); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemAppCallerA SecondAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemAppCallerA SecondAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemAppCallerA SecondAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemAppCallerA SecondAbility onForeground"); - if ((globalThis.abilityWant.parameters.case_num == "case0700") || - (globalThis.abilityWant.parameters.case_num == "case0800")) { - console.log("SystemAppCallerA SecondAbility special process in"); - var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; - var commonEventData = { - data: publishData, - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>SystemAppCallerA SecondAbility Call_Finish<======') - }) - } - } - - onBackground() { - // Ability has back to background - console.log("SystemAppCallerA SecondAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/ThirdAbility/ThirdAbility.ts b/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/ThirdAbility/ThirdAbility.ts deleted file mode 100755 index fcdb359fc..000000000 --- a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/ThirdAbility/ThirdAbility.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemAppCallerA ThirdAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA ThirdAbility Call_Finish<======') - }) - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemAppCallerA ThirdAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -export default class ThirdAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemAppCallerA ThirdAbility onCreate") - globalThis.abilityWant = want; - globalThis.abilityContext = this.context; - this.callee.on('testCall', testCall); - this.callee.on('testCallWithResult', testCallWithResult); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemAppCallerA ThirdAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemAppCallerA ThirdAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemAppCallerA ThirdAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemAppCallerA ThirdAbility onForeground"); - if ((globalThis.abilityWant.parameters.case_num == "case0700") || - (globalThis.abilityWant.parameters.case_num == "case0800")) { - var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; - var commonEventData = { - data: publishData, - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>SystemAppCallerA ThirdAbility Call_Finish<======') - }) - } - } - - onBackground() { - // Ability has back to background - console.log("SystemAppCallerA ThirdAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/SecondAbility/SecondAbility.ts b/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/SecondAbility/SecondAbility.ts deleted file mode 100755 index cb568532d..000000000 --- a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/SecondAbility/SecondAbility.ts +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -var callerA = "SystemAppCallerA" -var callSeqA= new Array(); -var callerB = "SystemAppCallerB" -var callSeqB= new Array(); -var callerC = "SystemAppCallerC" -var callSeqC= new Array(); -var seq = 0; - -function isArrayEqual(a1, a2) { - return a1.length==a2.length && a1.every(function(value,index) { return value === a2[index]}); -} -function isArrayEqualWithoutOrder(a1, a2) { - if (a1.length != a2.length) { - return false; - } - for (let ind in a1) { - if (a2.indexOf(a1[ind]) == -1) { - return false; - }; - } - return true; -} -var expectStressResult=[0,1,2,3,4,5,6,7,8,9]; - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest SecondAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA SecondAbility Call_Finish<======') - }) - return recvSequence; -} - -function testCall2(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest SecondAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed2'; - var commonEventData = { - code: 0, - data: 'calleeCheckCall2Param', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA SecondAbility Call_Finish<======') - }) - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest SecondAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -function test2100ReleaseCallback(data) { - console.log('SystemCallTest SecondAbility test2100ReleaseCallback:' + data); - test2100ReleaseFlag = data.toString(); -} - -var test2100ReleaseFlag = ''; - -export default class SecondAbility extends Ability { - - test2100(data) { - let recvData = new MySequenceable(0, '', ''); - data.readSequenceable(recvData); - let want = { - bundleName: "com.example.systemcalltest", - abilityName: "com.example.systemcalltest.MainAbility", - }; - console.log("SystemCallTest SecondAbility test2100 before startAbilityByCall"); - let resultData = new MySequenceable(0, '', ''); - globalThis.abilityContext2.startAbilityByCall(want).then((caller) => { - let param = new MySequenceable(recvData.num + 1, recvData.str + "Second", recvData.result); - caller.onRelease(test2100ReleaseCallback); - for (let start=Date.now(); Date.now() - start <= 200;); - caller.callWithResult('test2100', param).then((data2) => { - data2.readSequenceable(resultData); - caller.release(); - for (let start=Date.now(); Date.now() - start <= 200;); - resultData.result = test2100ReleaseFlag; - let commonEventData = { - parameters: { - num: resultData.num, - str: resultData.str, - result: resultData.result, - } - }; - commonEvent.publish('call_case2100_test_result', commonEventData, (err) => { - console.log('SystemCallTest SecondAbility publish call_case2200_test_result event'); - }) - - }); - }); - return resultData; - } - - testOff(data) { - let recvSequence = new MySequenceable(0, '', ''); - data.readSequenceable(recvSequence); - return recvSequence; - } - - stressMethod(data) { - let recvData = new MySequenceable(0, '', ''); - data.readSequenceable(recvData); - console.log('SystemCallTest SecondAbility stressMethod caller ' + recvData.str); - if (recvData.str == callerA) { - callSeqA.push(recvData.num); - } else if (recvData.str == callerB) { - callSeqB.push(recvData.num); - } else if (recvData.str == callerC) { - callSeqC.push(recvData.num); - } - seq++; - if (seq >= 30) { - console.log('SystemCallTest SecondAbility stressMethod SystemAppCallerA ' + callSeqA); - console.log('SystemCallTest SecondAbility stressMethod SystemAppCallerB ' + callSeqB); - console.log('SystemCallTest SecondAbility stressMethod SystemAppCallerC ' + callSeqC); - let stressResult=isArrayEqualWithoutOrder(callSeqA, expectStressResult); - stressResult=stressResult&&isArrayEqualWithoutOrder(callSeqB, expectStressResult); - stressResult=stressResult&&isArrayEqualWithoutOrder(callSeqC, expectStressResult); - console.log('SystemCallTest SecondAbility stressMethod stressResult ' + stressResult); - let commonEventData = { - data: stressResult.toString(), - }; - commonEvent.publish('com.example.systemcalltest.Test5600', commonEventData, (err) => { - console.log('SystemCallTest SecondAbility stress test result event'); - }); - seq=0; - callSeqA = []; - callSeqB = []; - callSeqC = []; - } - return recvData; - } - - loopMethod(data) { - let recvData = new MySequenceable(0, '', ''); - data.readSequenceable(recvData); - return new MySequenceable(recvData.num + 1, recvData.str, ''); - } - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemCallTest SecondAbility onCreate") - globalThis.abilityWant = want; - globalThis.secondCallee = this.callee; - globalThis.abilityContext2 = this.context; - this.callee.on('test2100', this.test2100); - this.callee.on('testOff', this.testOff); - this.callee.on('stressMethod', this.stressMethod); - this.callee.on('loopMethod', this.loopMethod); - this.callee.on('testCall', testCall); - this.callee.on('testCall2', testCall2); - this.callee.on('testCallWithResult', testCallWithResult); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemCallTest SecondAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemCallTest SecondAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/second/second", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemCallTest SecondAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemCallTest SecondAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("SystemCallTest SecondAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/FifthAbility/FifthAbility.ts b/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/FifthAbility/FifthAbility.ts deleted file mode 100755 index 598552ba1..000000000 --- a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/FifthAbility/FifthAbility.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest FifthAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA FifthAbility Call_Finish<======') - }) - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest FifthAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -export default class FifthAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemCallTest FifthAbility onCreate") - globalThis.abilityWant = want; - this.callee.on('testCall', testCall); - this.callee.on('testCallWithResult', testCallWithResult); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemCallTest FifthAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemCallTest FifthAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/second/second", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemCallTest FifthAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemCallTest FifthAbility onForeground") - if ((globalThis.abilityWant.parameters.case_num == "case1300") || - (globalThis.abilityWant.parameters.case_num == "case1400")) { - var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; - var commonEventData = { - data: publishData, - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>SystemAppCallerA FifthAbility Call_Finish<======') - }) - } - } - - onBackground() { - // Ability has back to background - console.log("SystemCallTest FifthAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/ForthAbility/ForthAbility.ts b/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/ForthAbility/ForthAbility.ts deleted file mode 100755 index 325cf4b41..000000000 --- a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/ForthAbility/ForthAbility.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest ForthAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA ForthAbility Call_Finish<======') - }) - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest ForthAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -export default class ForthAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemCallTest ForthAbility onCreate") - globalThis.abilityWant = want; - this.callee.on('testCall', testCall); - this.callee.on('testCallWithResult', testCallWithResult); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemCallTest ForthAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemCallTest ForthAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/second/second", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemCallTest ForthAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemCallTest ForthAbility onForeground") - if ((globalThis.abilityWant.parameters.case_num == "case1300") || - (globalThis.abilityWant.parameters.case_num == "case1400")) { - var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; - var commonEventData = { - data: publishData, - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>SystemAppCallerA ForthAbility Call_Finish<======') - }) - } - } - - onBackground() { - // Ability has back to background - console.log("SystemCallTest ForthAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/SecondAbility/SecondAbility.ts b/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/SecondAbility/SecondAbility.ts deleted file mode 100755 index 8438a2192..000000000 --- a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/SecondAbility/SecondAbility.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest SecondAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA SecondAbility Call_Finish<======') - }) - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest SecondAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -export default class SecondAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemCallTest SecondAbility onCreate") - globalThis.abilityWant = want; - this.callee.on('testCall', testCall); - this.callee.on('testCallWithResult', testCallWithResult); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemCallTest SecondAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemCallTest SecondAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/second/second", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemCallTest SecondAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemCallTest SecondAbility onForeground") - if ((globalThis.abilityWant.parameters.case_num == "case1300") || - (globalThis.abilityWant.parameters.case_num == "case1400")) { - var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; - var commonEventData = { - data: publishData, - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>SystemAppCallerA SecondAbility Call_Finish<======') - }) - } - } - - onBackground() { - // Ability has back to background - console.log("SystemCallTest SecondAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/ThirdAbility/ThirdAbility.ts b/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/ThirdAbility/ThirdAbility.ts deleted file mode 100755 index a6bcec38a..000000000 --- a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/ThirdAbility/ThirdAbility.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -class MySequenceable { - num: number = 0; - str: String = ""; - result: String = ""; - - constructor(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - setMySequence(num, string, result) { - this.num = num; - this.str = string; - this.result = result; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - messageParcel.writeString(this.result); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - this.result = messageParcel.readString(); - return true; - } -} - -function testCall(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest ThirdAbility on testCall <======') - data.readSequenceable(recvSequence); - var result = recvSequence.str + 'processed'; - var commonEventData = { - code: 0, - data: 'calleeCheckCallParam', - parameters: { - num: recvSequence.num, - str: recvSequence.str, - result: result - } - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>CallTestSysA ThirdAbility Call_Finish<======') - }) - return recvSequence; -} - -function testCallWithResult(data) { - let recvSequence = new MySequenceable(0, '', ''); - console.log('======>SystemCallTest ThirdAbility on testCall <======') - data.readSequenceable(recvSequence); - let result = recvSequence.str + 'processed'; - recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); - - return recvSequence; -} - -export default class ThirdAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SystemCallTest ThirdAbility onCreate") - globalThis.abilityWant = want; - this.callee.on('testCall', testCall); - this.callee.on('testCallWithResult', testCallWithResult); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SystemCallTest ThirdAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SystemCallTest ThirdAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/second/second", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SystemCallTest ThirdAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SystemCallTest ThirdAbility onForeground") - if ((globalThis.abilityWant.parameters.case_num == "case1300") || - (globalThis.abilityWant.parameters.case_num == "case1400")) { - var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; - var commonEventData = { - data: publishData, - } - commonEvent.publish('CallTest', commonEventData, (err) => { - console.log('======>SystemAppCallerA ThirdAbility Call_Finish<======') - }) - } - } - - onBackground() { - // Ability has back to background - console.log("SystemCallTest ThirdAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts deleted file mode 100644 index bc472bcb2..000000000 --- a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import dataAbility from '@ohos.data.dataability' -import featureAbility from '@ohos.ability.featureAbility' -import fileio from '@ohos.fileio' -import dataRdb from '@ohos.data.rdb' - -const TABLE_NAME = 'book' -const STORE_CONFIG = { name: 'book.db', encryptKey: new Uint8Array([]) } -const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' + - '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)' -let rdbStore: any = undefined -const TAG = 'ACTS_ DataAbility.data' - -let defaultReturn = 1; -let returnError = 0; -let returnError1 = -1; -let returnError2 = -2; -let returnError3 = -3; -let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility"); - -export default { - - onInitialized(abilityInfo) { - console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName) - dataRdb.getRdbStore(STORE_CONFIG, 1, (err, store) => { - console.debug('ACTS_ [data]getRdbStoreThen') - store.executeSql(SQL_CREATE_TABLE, []) - rdbStore = store - }); - }, - - insert(uri, valueBucket, callback) { - console.debug(TAG + ' insert start 1121') - console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket)) - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) - console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) - console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) - if (valueBucket.age != 24) { - err = "Error age" - callback(err, returnError2); - } - if (valueBucket.name != "ActsDataAbilityHelperTest") { - err = "Error name" - callback(err, returnError2); - } - if (valueBucket.salary != 2024.20) { - err = "Error salary" - callback(err, returnError2); - } - - err = "Error insert" - console.debug(TAG + ' rdbStore.insert ') - rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - - query(uri, columns, predicates, callback) { - console.debug(TAG + ' query start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.query(rdbPredicates, columns, callback) - }, - - update(uri, valueBucket, predicates, callback) { - console.debug(TAG + 'update start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) - console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) - console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) - if (valueBucket.age != 24) { - err = "Error age" - callback(err, returnError2); - } - if (valueBucket.name != "ActsDataAbilityHelperTest") { - err = "Error name" - callback(err, returnError2); - } - if (valueBucket.salary != 2024.20) { - err = "Error salary" - callback(err, returnError2); - } - - err = "Error update" - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - - delete(uri, predicates, callback) { - console.debug(TAG + 'delete start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.delete(rdbPredicates, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - call(uri, method, arg, extras, callback) { - console.debug(TAG + 'call start') - console.debug(TAG + 'uri---->' + uri) - console.debug(TAG + 'method---->' + uri) - }, - - batchInsert(uri, values, callback) { - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - for (var j = 0; j < values.length; j++) { - rdbStore.insert("EMPLOYEE", values[j], function (err, ret) { - console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret)) - }) - } - console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length)) - callback(err, values.length); - }, - - getType(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by getType ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - callback("success", uri); - }, - - getFileTypes(uri, mimeTypeFilter, callback) { - console.info(TAG + '==================== DataAbility test interface by GetFileTypes ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - let type1 = " "; - let type2 = " "; - let type3 = " "; - let types; - if (mimeTypeFilter == "*/*") { - type1 = ("hap"); - type2 = ("jpg"); - type3 = ("image/png"); - types = [type1, type2, type3]; - } else if (mimeTypeFilter == "image/*") { - type1 = ("image/png"); - types = [type1]; - } else if (mimeTypeFilter == "*/jpg") { - type1 = ("jpg"); - types = [type1]; - } - - console.log(TAG + "GetFileTypes callback ret:" + JSON.stringify(types)) - callback("success", types); - }, - - openFile(uri, mode, callback) { - console.info(TAG + '==================== DataAbility test interface by openFile ================'); - let defaultReturn = 1; - let returnError1 = -1; - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") || - mode == ("rw") || mode == ("rwt"))) { - if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) { - defaultReturn = returnError2; - } else - defaultReturn = returnError3; - } - console.info(TAG + " path = /data/test "); - let path = "/data/test" - fileio.stat(path).then(function (stat) { - console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat)); - }).catch(function (err) { - console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err); - defaultReturn = returnError1; - }); - console.info(TAG + " path ==>" + path); - callback("success", defaultReturn); - }, - - normalizeUri(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by normalizeUri ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, ""); - } - callback("success", uri); - }, - - denormalizeUri(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================'); - console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri)); - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, ""); - } - callback("success", uri); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts b/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts deleted file mode 100644 index 1efa7ced1..000000000 --- a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import dataAbility from '@ohos.data.dataability' -import featureAbility from '@ohos.ability.featureAbility' -import fileio from '@ohos.fileio' -import dataRdb from '@ohos.data.rdb' - -const TABLE_NAME = 'book' -const STORE_CONFIG = { name: 'book.db', encryptKey: new Uint8Array([]) } -const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' + - '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)' -let rdbStore: any = undefined -const TAG = 'ACTS_ DataAbility.data' - -let defaultReturn = 1; -let returnError = 0; -let returnError1 = -1; -let returnError2 = -2; -let returnError3 = -3; -let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility2"); - -export default { - - onInitialized(abilityInfo) { - console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName) - dataRdb.getRdbStore(STORE_CONFIG, 1, (err, store) => { - console.debug('ACTS_ [data]getRdbStoreThen') - store.executeSql(SQL_CREATE_TABLE, []) - rdbStore = store - }); - }, - - insert(uri, valueBucket, callback) { - console.debug(TAG + ' insert start 1121') - console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket)) - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) - console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) - console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) - if (valueBucket.age != 24) { - err = "Error age" - callback(err, returnError2); - } - if (valueBucket.name != "ActsDataAbilityHelperTest") { - err = "Error name" - callback(err, returnError2); - } - if (valueBucket.salary != 2024.20) { - err = "Error salary" - callback(err, returnError2); - } - - err = "Error insert" - console.debug(TAG + ' rdbStore.insert ') - rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - - query(uri, columns, predicates, callback) { - console.debug(TAG + ' query start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.query(rdbPredicates, columns, callback) - }, - - update(uri, valueBucket, predicates, callback) { - console.debug(TAG + 'update start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) - console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) - console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) - if (valueBucket.age != 24) { - err = "Error age" - callback(err, returnError2); - } - if (valueBucket.name != "ActsDataAbilityHelperTest") { - err = "Error name" - callback(err, returnError2); - } - if (valueBucket.salary != 2024.20) { - err = "Error salary" - callback(err, returnError2); - } - - err = "Error update" - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - - delete(uri, predicates, callback) { - console.debug(TAG + 'delete start') - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) - rdbStore.delete(rdbPredicates, function (err, resultSet) { - console.log(TAG + "insert callback resultSet:" + resultSet - + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) - callback(err, defaultReturn); - }) - }, - call(uri, method, arg, extras, callback) { - console.debug(TAG + 'call start') - console.debug(TAG + 'uri---->' + uri) - console.debug(TAG + 'method---->' + uri) - }, - - batchInsert(uri, values, callback) { - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - - for (var j = 0; j < values.length; j++) { - rdbStore.insert("EMPLOYEE", values[j], function (err, ret) { - console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret)) - }) - } - console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length)) - callback(err, values.length); - }, - - getType(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by getType ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - callback("success", uri); - }, - - getFileTypes(uri, mimeTypeFilter, callback) { - console.info(TAG + '==================== DataAbility test interface by GetFileTypes ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - let type1 = " "; - let type2 = " "; - let type3 = " "; - let types; - if (mimeTypeFilter == "*/*") { - type1 = ("hap"); - type2 = ("jpg"); - type3 = ("image/png"); - types = [type1, type2, type3]; - } else if (mimeTypeFilter == "image/*") { - type1 = ("image/png"); - types = [type1]; - } else if (mimeTypeFilter == "*/jpg") { - type1 = ("jpg"); - types = [type1]; - } - - console.log(TAG + "GetFileTypes callback ret:" + JSON.stringify(types)) - callback("success", types); - }, - - openFile(uri, mode, callback) { - console.info(TAG + '==================== DataAbility test interface by openFile ================'); - let defaultReturn = 1; - let returnError1 = -1; - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, returnError1); - } - if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") || - mode == ("rw") || mode == ("rwt"))) { - if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) { - defaultReturn = returnError2; - } else - defaultReturn = returnError3; - } - console.info(TAG + " path = /data/test "); - let path = "/data/test" - fileio.stat(path).then(function (stat) { - console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat)); - }).catch(function (err) { - console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err); - defaultReturn = returnError1; - }); - console.info(TAG + " path ==>" + path); - callback("success", defaultReturn); - }, - - normalizeUri(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by normalizeUri ================'); - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, ""); - } - callback("success", uri); - }, - - denormalizeUri(uri, callback) { - console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================'); - console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri)); - - let err = "Error Uri" - if (uri != dataAbilityUri) { - console.debug(TAG + ' uri != dataAbilityUri') - callback(err, ""); - } - callback("success", uri); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json deleted file mode 100644 index 8bb263cd5..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifieduseractionextensionzerotest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json deleted file mode 100644 index 54ddad9da..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json +++ /dev/null @@ -1,49 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "120000", - "package": "com.example.actsspecifieduseractionextensionzerotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsSpecifiedUserActionextensionZeroTest.hap", - "ActsSpecifiedUserActionextensiononeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionextensionZeroTest.hap->/system/app/ActsSpecifiedUserActionextensionZeroTest.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm create -n 102 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101", - "acm delete -i 102" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionextensiononeTest.hap->/system/app/ActsSpecifiedUserActionextensiononeTest.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ] - } - ] -} - diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 2af31f940..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageContext = this.context; - globalThis.startnum = 0 - console.log("MyAbilityStage finish") - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index e2bb24f02..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate"); - globalThis.abilityWant = want; - globalThis.abilityContext = this.context - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy"); - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate"); - windowStage.setUIContent(this.context, "pages/index/index", null); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy"); - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground"); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground"); - } -}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 3b07276d3..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); - console.debug("====>close this context====>") - globalThis.ability2Context.terminateSelf(); -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.ability2Context = this.context - windowStage.setUIContent(this.context, "pages/index", null) - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index d689638e3..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import rpc from '@ohos.rpc'; -import osaccount from '@ohos.account.osAccount' -globalThis.ACCOUNT_ID100; -globalThis.ACCOUNT_ID101; -globalThis.ACCOUNT_ID102; -class Stub extends rpc.RemoteObject { - constructor(des) { - super(des); - } - // process client's request - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate'); - } - onDestory(){ - console.log('ServiceAbility onDestory'); - } - onRequest(want,startId) { - console.log('ServiceAbility onRequest'); - } - - onConnect(want) { - console.log('ServiceAbility onConnect'); - console.log('globalThis.startnum is ' + globalThis.startnum); - - switch (globalThis.startnum) { - case 1: - console.log('ServiceAbility case 1'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' - },globalThis.ACCOUNT_ID100 ,{ - windowMode: 2, - displayId: 1 - }).then(() => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0100 ====>success!") - }) - console.debug("====>case 1 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 2: - console.log('ServiceAbility case 2'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' - },globalThis.ACCOUNT_ID102 ,{ - windowMode: 2, - displayId: 1 - }).then(() => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0300 ====>success!") - }) - console.debug("====>case 2 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 3: - console.log('ServiceAbility case 3'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.MainAbility2' - },globalThis.ACCOUNT_ID101,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0500====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_0500====>sunccess!"+ JSON.stringify(data)) - })) - console.debug("====>case 3 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 4: - console.log('ServiceAbility case 4'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' - },globalThis.ACCOUNT_ID102, { - windowMode: 2, - displayId: 1 - },((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0600====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_0600====>sunccess!"+ JSON.stringify(data)) - })) - console.debug("====>case 4 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 5: - console.log('ServiceAbility case 5'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - },globalThis.ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0700====>success!"+ JSON.stringify(data)) - }) - break; - case 6: - console.log('ServiceAbility case 6'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - },globalThis.ACCOUNT_ID102,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0900====>fail!!!") - console.log("====>end ACTS_StartServiceAbilityWithAccount_0900====>sunccess!") - })) - console.debug("====>case 6 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 7: - console.log('ServiceAbility case 7'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' - }, globalThis.ACCOUNT_ID101,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_1100====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_1100====>sunccess!"+ JSON.stringify(data)) - })) - console.debug("====>case 7 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 8: - console.log('ServiceAbility case 8'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - }, globalThis.ACCOUNT_ID102,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_1200====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_1200====>sunccess!"+ JSON.stringify(data)) - })) - console.debug("====>case 8 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 9: - console.log('ServiceAbility case 9'); - this.context.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - }, globalThis.ACCOUNT_ID100) - break; - case 10: - console.log('ServiceAbility case 10'); - this.context.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - },globalThis.ACCOUNT_ID102) - - console.debug("====>case 10 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - default: - console.log("====> ServiceAbility end default =====>") - break; - } - } - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index 7afc8f5d8..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from "@ohos.commonEvent" - -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility2 onCreate'); - globalThis.abilityWant = want; - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { - console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") - this.context.terminateSelf(); - console.log("====> terminateSelf End=====>") - }); - } - - onConnect(want) { - console.log('ServiceAbility2 onConnect'); - if (want.action == 'StartAbilityPromise') { - console.log('stub StartAbilityPromise OnConnect start '); - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { - console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") - this.context.terminateSelf(); - console.log("====> StartAbilityPromise End=====>") - }); - } - } - - onDisconnect(want) { - console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility2 onDestroy'); - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index c08226f3b..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,833 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' -import osaccount from '@ohos.account.osAccount' - -var ACTS_ABILITYCONTEX = { - events: ["ABILITYCONTEX_Start_CommonEvent"] -}; - -const START_ABILITY_TIMEOUT = 3000; -console.debug("====>in Ability.test====>"); - -export default function abilityTest(abilityContext) { - console.debug("====>in ACTS_InterfaceMultiUsers====>"); - describe('ACTS_StartService', function () { - beforeAll(function(done) { - var osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ - console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); - globalThis.ACCOUNT_ID100 = data1[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ - console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); - globalThis.ACCOUNT_ID101 = data2[0]; - osAccountManager.activateOsAccount(102, (err)=>{ - console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); - osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ - console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); - globalThis.ACCOUNT_ID102 = data3[0]; - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - done(); - }) - }) - }) - }) - },3000) - }) - }) - },3000) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0100 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : In multi-user non-concurrent mode, - * the specified user is equal to the current user and the user's task list exists (promise) - */ - it('ACTS_StartServiceAbilityWithAccount_0100', 0, async function (done) { - let Subscriber - var flag = true; - var startresult = false; - globalThis.startnum = 1; - - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0100 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0100 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0100start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_StartServiceAbilityWithAccount_0100 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_StartServiceAbilityWithAccount_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0300 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist), call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0300', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 2; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0300start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0500 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists, call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_0500', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 3; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - // setTimeout(() => { - - // }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0500 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0500 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0500 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - done(); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0500start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0600 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist), - * call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_0600', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 4; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0600 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0600 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0600 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0600start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0700 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user is equal to the current user, - * and the user's task list exists, call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0700', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 5; - - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0700start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_StartServiceAbilityWithAccount_0700 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_StartServiceAbilityWithAccount_0700 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0900 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist), - * call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0900', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 6; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0900 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0900 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0900 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0900start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_1100 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists, call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_1100', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 7; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_1100 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_1100 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_1100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>1100start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_1200 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist), - * call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_1200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 8; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_1200 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_1200 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_1200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>1200start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0100 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user is equal to the current user and the user's task list exists - */ - it('ACTS_ConnectServiceAbilityWithAccount_0100', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 9; - - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0100 ConnectServiceAbility connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ConnectServiceAbilityWithAccount_0100 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ConnectServiceAbilityWithAccount_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0300 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist) - */ - it('ACTS_ConnectServiceAbilityWithAccount_0300', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 10; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectServiceAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectServiceAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ConnectServiceAbilityWithAccount_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0300 ConnectServiceAbility connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - }) -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 2ff5edb42..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityTest from './Ability.test.ets' - - -export default function testsuite(context) { - - console.debug("====>in list.test====>"); - abilityTest(context) - -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json deleted file mode 100644 index 9c1267922..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifieduseractionextensionzerotest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "com.example.actsspecifieduseractionextensionzerotest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actsspecifieduseractionextensionzerotest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "reason": "ceshi" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "ceshi" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json deleted file mode 100644 index ed8380665..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifieduseractionextensiononetest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json deleted file mode 100644 index 69c870be2..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.example.actsspecifieduseractionextensiononetest", - "shell-timeout": "300000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm create -n 102 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101", - "acm delete -i 102" - ] - }, - { - "test-file-name": [ - "ActsSpecifiedUserActionextensiononeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionextensiononeTest.hap->/system/app/ActsSpecifiedUserActionextensiononeTest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ] - }, - - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionextensionZeroTest.hap->/system/app/ActsSpecifiedUserActionextensionZeroTest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 101" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/*.hap" - ] - } - ] -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 77b702155..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageContext = this.context; - globalThis.startnum = 0 - console.log("MyAbilityStage finish") - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index a9110ed3e..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate"); - globalThis.abilityWant = want; - globalThis.abilityContext = this.context - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy"); - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate"); - windowStage.setUIContent(this.context, "pages/index/index", null); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy"); - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground"); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground"); - } -}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 00ee54cb7..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); - console.debug("====>close this context====>") - globalThis.ability2Context.terminateSelf(); -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.ability2Context = this.context - windowStage.setUIContent(this.context, "pages/index", null) - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index cdb745d7c..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import rpc from '@ohos.rpc'; -class Stub extends rpc.RemoteObject { - constructor(des) { - super(des); - } - // process client's request - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate'); - } - onDestory(){ - console.log('ServiceAbility onDestory'); - } - onRequest(want,startId) { - console.log('ServiceAbility onRequest'); - } - - onConnect(want) { - console.log('ServiceAbility onConnect'); - console.log('globalThis.startnum is ' + globalThis.startnum); - - switch (globalThis.startnum) { - case 1: - console.log('ServiceAbility case 1'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' - },100, { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0200 ====>success!") - }) - console.debug("====>case 1 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - break; - - case 2: - console.log('ServiceAbility case 2'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - }, globalThis.ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0800====>success!"+ JSON.stringify(data)) - }) - console.debug("====>case 3 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - - case 3: - console.log('ServiceAbility case 3'); - this.context.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - }, globalThis.ACCOUNT_ID100) - console.debug("====>case 5 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 4: - console.log('ServiceAbility case 4'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' - },101,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_1000====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_1000====>sunccess!"+ JSON.stringify(data)) - })) - break; - case 5: - console.log('ServiceAbility case 5'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' - }, globalThis.ACCOUNT_ID101,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0400====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_0400====>sunccess!"+ JSON.stringify(data)) - })) - break; - default: - console.log("====> ServiceAbility end default =====>") - break; - } - } - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index e507495a1..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from "@ohos.commonEvent" - -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility2 onCreate'); - globalThis.abilityWant = want; - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { - console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") - this.context.terminateSelf(); - console.log("====> terminateSelf End=====>") - }); - } - - onConnect(want) { - console.log('ServiceAbility2 onConnect'); - } - - onDisconnect(want) { - console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility2 onDestroy'); - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index 519c6280a..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,458 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' -import osaccount from '@ohos.account.osAccount' - - -var ACTS_ABILITYCONTEX = { - events: ["ABILITYCONTEX_Start_CommonEvent"] -}; - -const START_ABILITY_TIMEOUT = 3000; -console.debug("====>in Ability.test====>"); - -export default function abilityTest(abilityContext) { - console.debug("====>in ACTS_InterfaceMultiUsers====>"); - describe('ACTS_StartService', function () { - beforeAll(function(done) { - var osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ - console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); - globalThis.ACCOUNT_ID100 = data1[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ - console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); - globalThis.ACCOUNT_ID101 = data2[0]; - osAccountManager.activateOsAccount(102, (err)=>{ - console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); - osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ - console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); - globalThis.ACCOUNT_ID102 = data3[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - done(); - }) - }) - }) - }) - },3000) - }) - }) - },3000) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0200 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists, call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 1; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0200start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0800 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists, call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0800', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 2; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - done(); - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0800 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0800 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0800 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0800start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0200 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists - */ - it('ACTS_ConnectServiceAbilityWithAccount_0200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 3; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>ACTS_ConnectServiceAbilityWithAccount_0200 disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>ACTS_ConnectServiceAbilityWithAccount_0200 in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ConnectServiceAbilityWithAccount_0200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 0200start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_1000 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user is equal to the current user, - * and the user's task list exists, call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_1000', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 4; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_1000 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_1000 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_1000 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>1000start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0400 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user is equal to the current user, - * and the user's task list exists, call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_0400', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 5; - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - - function SubscribeCallBack(err, data) { - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0400 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0400 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index ecefaf77b..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityTest from './Ability.test.ets' - - -export default function testsuite(context) { - - console.debug("====>in list.test====>"); - abilityTest(context) - -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json deleted file mode 100644 index 56ba946b3..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifieduseractionextensiononetest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "com.example.actsspecifieduseractionextensiononetest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actsspecifieduseractionextensiononetest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsspecifieduseractionextensiononetest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "reason": "ceshi" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "ceshi" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json deleted file mode 100644 index ed5b06c79..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifieduseractionzerotest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/Test.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/Test.json deleted file mode 100644 index dd33d382f..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/Test.json +++ /dev/null @@ -1,50 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.example.actsspecifieduseractionzerotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsSpecifiedUserActionZeroTest.hap", - "ActsSpecifiedUserActiononeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionZeroTest.hap->/system/app/ActsSpecifiedUserActionZeroTest.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm create -n 102 -t normal", - "acm switch -i 101" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActiononeTest.hap->/system/app/ActsSpecifiedUserActiononeTest.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ], - "teardown-command":[ - "acm delete -i 101", - "acm delete -i 102" - ] - } - -] -} - diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index f85fcf92b..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index dda3b5af4..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 0f7d3fef4..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); - console.debug("====>close this context====>") - globalThis.ability2Context.terminateSelf(); -} -export default class MainAbility2 extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.ability2Context = this.context - windowStage.setUIContent(this.context, "pages/index", null) - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 3aa7c1445..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityTest from './abilityTest.ets' - - -export default function testsuite(context) { - - abilityTest(context) - -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets deleted file mode 100644 index caea5b06e..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets +++ /dev/null @@ -1,935 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent'; -import osaccount from '@ohos.account.osAccount' - -var ACTS_ABILITYCONTEX = { - events: ["ABILITYCONTEX_Start_CommonEvent"] -}; -var ACCOUNT_ID100; -var ACCOUNT_ID101; -var ACCOUNT_ID102; - -const START_ABILITY_TIMEOUT = 3000; -export default function abilityTest(abilityContext) { - describe('ACTS_AbilityContext', function () { - beforeAll(function(done) { - var osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ - console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); - ACCOUNT_ID100 = data1[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ - console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); - ACCOUNT_ID101 = data2[0]; - osAccountManager.activateOsAccount(102, (err)=>{ - console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); - osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ - console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); - ACCOUNT_ID102 = data3[0]; - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - done(); - }) - }) - }) - }) - },3000) - }) - }) - },3000) - }) - }) - - - /* - * @tc.number: ACTS_StartStandardAbilityWithAccount_0100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, - * call the AbilityContext::startAbilityWithAccount interface of - * Promise (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0100', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0100====>start") - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>ACTS_StartStandardAbilityWithAccount_0100 UnSubscribeCallback====>"); - setTimeout(function(){ - done(); - },2000) - } - - function timeout() { - if(flag == false) { - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityWithAccount_0100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID100, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0100====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0300 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), - * call the AbilityContext::startAbilityWithAccount interface of - * Promise (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0300', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0300 ====> start") - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0300 ====> timeout'); - done(); - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility12' - },ACCOUNT_ID102, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0300====>success!"+ JSON.stringify(data)) - expect().assertFail(); - done(); - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0500 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the AbilityContext::startAbilityWithAccount interface - * of AsyncCallback (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0500', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0500 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0500====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0500 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - },ACCOUNT_ID101, { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0500====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0600 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call the - * AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (with the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0600', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0600 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0600====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0600 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102, { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0600====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0700 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the - * AbilityCont. - * ext::startAbilityWithAccount interface of Promise (without the StartOptions parameter) - * to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0700', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0700 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0700====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>ACTS_StartStandardAbilityWithAccount_0700 UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false) { - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityWithAccount_0700 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0700====>success!"+ JSON.stringify(data)) - }) - }) - - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0900 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call - * the AbilityContext::startAbilityWithAccount interface of - * Promise (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0900', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0900 ====> start") - - var Subscriber; - - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0900====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0900 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0900====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_1100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the - * AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_1100', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_1100 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_1100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_1100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - },ACCOUNT_ID101, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_1100====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_1200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call the - * AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_1200', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_1200 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_1200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_1200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102,((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_1200====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, - * call the Promise's AbilityContext::startAbilityForResultWithAccount - * (with the StartOptions parameter) interface to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0100', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0100 ====> start") - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>ACTS_StartStandardAbilityForResultWithAccount_0100 UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID100, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0100====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0300 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), - * call the AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) - * interface of Promise to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0300', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0300 ====> start") - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0300 ====> timeout'); - done(); - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0300====>success!"+ JSON.stringify(data)) - expect().assertFail(); - done(); - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0500 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the - * AsyncCallback's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) - * interface to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0500', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0500 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0500====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0500 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID101, - { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0500 === success!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0600 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call the - * AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) interface of - * AsyncCallback to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0600', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0600 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0600====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0600 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - }, ACCOUNT_ID102, - { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0600 === success!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0700 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, - * call the Promise's AbilityContext::startAbilityForResultWithAccount - * (without the StartOptions parameter) interface to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0700', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0700 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0700====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false) - { - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0700 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0700====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0900 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call the - * AbilityContext::startAbilityForResultWithAccount (no StartOptions parameter) interface of - * Promise to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0900', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0900 ====> start") - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0900 ====> timeout'); - done(); - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0900====>success!"+ JSON.stringify(data)) - expect().assertFail(); - done(); - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the AsyncCallback's - * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) interface - * to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_1100', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1100 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_1100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_1100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID101, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1100 === success!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), - * call the AbilityContext::startAbilityForResultWithAccount (no StartOptions parameter) - * interface of AsyncCallback to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_1200', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1200 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_1200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - }, ACCOUNT_ID102, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1200 === success!" + JSON.stringify(data)) - })) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_1200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /** - * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is equal to the current user and the user's task list exists, - * call the AbilityContext::connectAbilityWithAccount interface to connect to Ability. - */ - it('ACTS_ConnectStandardAbilityWithAccount_0100', 0, async function (done) { - console.log("ACTS_ConnectStandardAbilityWithAccount_0100====>start") - var Subscriber; - var flag = true; - var number = 0; - - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectStandardAbilityWithAccount_0100 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectStandardAbilityWithAccount_0100 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>WithAccount 0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - abilityContext.disconnectAbility(number).then((err)=>{ - console.debug("====>err is====>" + JSON.stringify(err)); - }) - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_ConnectStandardAbilityWithAccount_0100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>ACTS_ConnectStandardAbilityWithAccount_0100 UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false) { - expect().assertFail(); - console.debug('ACTS_ConnectStandardAbilityWithAccount_0100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start connectAbilityWithAccount====>"); - number = await abilityContext.connectAbilityWithAccount({ - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - }, ACCOUNT_ID100,{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - }) - - /** - * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0300 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), - * call the AbilityContext::connectAbilityWithAccount interface to connect the Ability. - */ - it('ACTS_ConnectStandardAbilityWithAccount_0300', 0, async function (done) { - console.log("ACTS_ConnectStandardAbilityWithAccount_0300 ====> start") - var Subscriber; - var flag = true; - var number = 0; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>WithAccount 0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - abilityContext.disconnectAbility(number).then((err)=>{ - console.debug("====>err is====>" + JSON.stringify(err)); - }) - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectStandardAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectStandardAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_ConnectStandardAbilityWithAccount_0300====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start connectAbilityWithAccount====>"); - number = await abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - },ACCOUNT_ID102 ,{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json deleted file mode 100644 index d6278a9b4..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifieduseractionzerotest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "com.example.actsspecifieduseractionzerotest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsspecifieduseractionzerotest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "reason": "ceshi" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "ceshi" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json deleted file mode 100644 index c828e9ea1..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifieduseractiononetest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/Test.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/Test.json deleted file mode 100644 index 5f76cadc7..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/Test.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.example.actsspecifieduseractiononetest", - "shell-timeout": "300000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm create -n 102 -t normal", - "acm switch -i 101" - ] - }, - { - "test-file-name": [ - "ActsSpecifiedUserActiononeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActiononeTest.hap->/system/app/ActsSpecifiedUserActiononeTest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ] - }, - - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionZeroTest.hap->/system/app/ActsSpecifiedUserActionZeroTest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 101" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/*.hap" - ] - } - ] -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index b1c5ee1bb..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index dda3b5af4..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 1cc88f961..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); - console.debug("====>close this context====>") - globalThis.ability2Context.terminateSelf(); -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.ability2Context = this.context - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 53cc03986..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityTest from './abilityTest.ets' - - -export default function testsuite(context) { - - abilityTest(context) - -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets deleted file mode 100644 index 506fdcc1c..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets +++ /dev/null @@ -1,540 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent'; -import osaccount from '@ohos.account.osAccount' - -var ACTS_ABILITYCONTEX = { - events: ["ABILITYCONTEX_Start_CommonEvent"] -}; -var ACCOUNT_ID100; -var ACCOUNT_ID101; -var ACCOUNT_ID102; - -const START_ABILITY_TIMEOUT = 3000; -export default function abilityTest(abilityContext) { - describe('ACTS_AbilityContext', function () { - beforeAll(function(done) { - var osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ - console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); - ACCOUNT_ID100 = data1[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ - console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); - ACCOUNT_ID101 = data2[0]; - osAccountManager.activateOsAccount(102, (err)=>{ - console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); - osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ - console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); - ACCOUNT_ID102 = data3[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - done(); - }) - }) - }) - }) - },3000) - }) - }) - },3000) - }) - }) - - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the Promise's AbilityContext::startAbilityWithAccount - * interface (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0200', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0200====>start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID100, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0200====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0400 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, - * call the AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0400', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0400 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0400====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityWithAccount_0400 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - },ACCOUNT_ID101, - { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0400====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0800 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the Promise's AbilityContext::startAbilityWithAccount - * interface (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0800', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0800 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0800====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0800 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0800====>success!"+ JSON.stringify(data)) - }) - }) - - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_1000 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the - * AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_1000', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_1000 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_1000====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityWithAccount_1000 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - },ACCOUNT_ID101, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_1000====>success!!!" + JSON.stringify(data)) - })) - }) - - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the - * Promise's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) - * interface to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0200', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0200 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - }, ACCOUNT_ID100, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0200====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0400 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the - * AsyncCallback's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) - * interface to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0400', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0400 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0400====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0400 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID101, - { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("StartStandardAbilityForResultWithAccount_0400 === success!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0800 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the Promise's - * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) interface - * to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0800', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0800 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0800====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0800 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - }, ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0800====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1000 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the AsyncCallback's - * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) - * interface to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_1000', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1000 ====> start") - var flag = false; - var Subscriber; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_1000====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityForResultWithAccount_1000 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - - } - } - - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID101, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1000 === success!" + JSON.stringify(data)) - })) - }) - - - /** - * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the AbilityContext::connectAbilityWithAccount interface to connect the Ability. - */ - it('ACTS_ConnectStandardAbilityWithAccount_0200', 0, async function (done) { - console.log("ACTS_ConnectStandardAbilityWithAccount_0200 ====> start") - var Subscriber; - var flag = true; - var number = 0; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>WithAccount 0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - abilityContext.disconnectAbility(number).then((err)=>{ - console.debug("====>err is====>" + JSON.stringify(err)); - }) - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectStandardAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectStandardAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_ConnectStandardAbilityWithAccount_0200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start connectAbilityWithAccount====>"); - number = await abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - },ACCOUNT_ID102 ,{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json deleted file mode 100644 index 9fb5911c1..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifieduseractiononetest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "com.example.actsspecifieduseractiononetest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsspecifieduseractiononetest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/Test.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/AbilityStage.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/AbilityStage.ts deleted file mode 100755 index 271d9164e..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/AbilityStage.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilitySatage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate"); - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 5f8551ea9..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("jws onCreate"); - } - - onDestroy() { - console.log("jws onDestroy"); - } - - onWindowStageCreate(windowStage) { - console.log("jws onWindowStageCreate"); - } - - onWindowStageDestroy() { - console.log("jws onWindowStageDestroy"); - } - - onForeground() { - console.log("jws onForeground"); - } - - onBackground() { - console.log("jws onBackground"); - } - - call(){ - - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 745bfaffc..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "ServiceExtAbility" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - }, - { - "name": "description_dataability", - "value": "hap sample empty provider" - }, - { - "name": "description_mainability2", - "value": "eTS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - }, - { - "name": "description_testdataability", - "value": "hap sample empty provider" - }, - { - "name": "permreason_dataability", - "value": "request dataability premission" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json deleted file mode 100755 index 2547e5749..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.acts.actsinterfacemultiusersextensiontest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100755 index 91603f602..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from "@ohos.commonEvent" - -export default class MainAbility2 extends Ability { - - onCreate(want, launchParam) { - console.log("MainAbility2 onCreate"); - globalThis.abilityContext = this.context - } - - onDestroy() { - console.log("MainAbility2 onDestroy"); - } - - onWindowStageCreate(windowStage) { - console.log("MainAbility2 onWindowStageCreate"); - windowStage.setUIContent(this.context, "pages/index/second", null); - commonEvent.publish("ACTS_InterfaceMultiUsersExtension_CommonEvent", () => { - console.log("publish Publish ACTS_InterfaceMultiUsersExtension_CommonEvent callback") - globalThis.abilityContext.terminateSelf().then(() => { - commonEvent.publish("ACTS_TerminateSelf_CommonEvent", ()=>{ - console.log('terminateSelf promise'); - }); - }); - }) - } - - onWindowStageDestroy() { - console.log("MainAbility2 onWindowStageDestroy"); - } - - onForeground() { - console.log("MainAbility2 onForeground"); - } - - onBackground() { - console.log("MainAbility2 onBackground"); - } -}; diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets b/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100755 index 1f1cc6898..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,974 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' -import osaccount from '@ohos.account.osAccount' - -var subscriberInfo_MainAbility = { - events: ["ACTS_InterfaceMultiUsersExtension_CommonEvent"] - }; -var subscriberInfo_MainAbility2 = { - events: ["ACTS_TerminateSelf_CommonEvent"] -}; -var subscriberInfo_MainAbility3 = { - events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"] -}; -var osAccountManager -const START_ABILITY_TIMEOUT = 6000; -globalThis.number = 0; -console.debug("====>in Ability.test====>"); -export default function abilityTest(abilityContext) { - console.debug("====>in function abilityTest====>"); - describe('ActsInterfaceMultiUsersExtensionTest', function () { - afterAll(function() { - osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - osAccountManager.removeOsAccount(101, (err)=>{ - console.debug("====>remove localId: 101" + " err:" + JSON.stringify(err)); - }) - }) - }) - console.debug("====>in ACTS_InterfaceMultiUsers====>"); - /* - * @tc.number : ACTS_ExtensionStartAbility_0100 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options succeeded.(promise) - */ - it('ACTS_ExtensionStartAbility_0100', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 1 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0100start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0100 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0200 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options failed.(promise) - */ - it('ACTS_ExtensionStartAbility_0200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 2 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ExtensionStartAbility_0200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0200start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0300 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options succeeded.(callback) - */ - it('ACTS_ExtensionStartAbility_0300', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum=3 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0300start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0300 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0400 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options failed.(callback) - */ - it('ACTS_ExtensionStartAbility_0400', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 4 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ExtensionStartAbility_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0500 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(promise) - */ - it('ACTS_ExtensionStartAbility_0500', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 5 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0500start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0500 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0500 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0600 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability failed.(promise) - */ - it('ACTS_ExtensionStartAbility_0600', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 6 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ExtensionStartAbility_0600 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0600start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0700 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(callback) - */ - it('ACTS_ExtensionStartAbility_0700', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum=7 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0700start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0700 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0700 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0800 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability failed.(callback) - */ - it('ACTS_ExtensionStartAbility_0800', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 8 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ExtensionStartAbility_0800 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0800start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0900 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(callback) - */ - it('ACTS_ExtensionStartAbility_0900', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum=13 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent").assertTrue(); - console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){ - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility3).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0900start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0900 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0900 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_1000 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(callback) - */ - it('ACTS_ExtensionStartAbility_1000', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum=14 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent").assertTrue(); - console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){ - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility3).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>1000start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_1000 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_1000 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - /* - * @tc.number : ACTS_ExtensionTerminateSelf_0100 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(promise) - */ - it('ACTS_ExtensionTerminateSelf_0100', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 9 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_TerminateSelf_CommonEvent"){ - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function onConnectCallback(element, remote) { - console.log('onConnectCallback====> element=' + JSON.stringify(element)); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0100start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionTerminateSelf_0100 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionTerminateSelf_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - /* - * @tc.number : - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(promise) - */ - it('ACTS_ExtensionTerminateSelf_0200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 10 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_TerminateSelf_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug(' - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0200start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - }) - /* - * @tc.number : ACTS_ExtensionTerminateSelf_0300 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(callback) - */ - it('ACTS_ExtensionTerminateSelf_0300', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 11 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_TerminateSelf_CommonEvent"){ - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0300start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionTerminateSelf_0300 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionTerminateSelf_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - /* - * @tc.number : ACTS_ExtensionTerminateSelf_0400 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(callback) - */ - it('ACTS_ExtensionTerminateSelf_0400', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 12 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_TerminateSelf_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log('ACTS_ExtensionTerminateSelf_0400 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ExtensionTerminateSelf_0400 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ExtensionTerminateSelf_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index 198b3e409..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityTest from './Ability.test.ets' - -export default function testsuite(context) { - console.debug("====>in list.test====>"); - abilityTest(context) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json deleted file mode 100755 index 1d5966b31..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.actsinterfacemultiusersextensiontest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "com.acts.actsinterfacemultiusersextensiontest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait" - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.acts.actsinterfacemultiusersextensiontest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.acts.actsinterfacemultiusersextensiontest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION" - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_RUNNING_INFO", - "reason": "need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/app.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/app.json deleted file mode 100755 index 297408f96..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.acts.killprocesshap", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/Test.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 03ea5663a..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_KillProcess====>"); -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - commonEvent.publish("ACTS_KillProcess", PublishCallBackOne); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json deleted file mode 100755 index f3d6af9ff..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.killprocesshap.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - - } -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/app.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/app.json deleted file mode 100755 index 5a34634cb..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.acts.killprocessthirdhap", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/Test.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 4f74e976d..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import appManager from '@ohos.application.appManager' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - console.log("in killhap onForeground") - setTimeout(()=>{ - appManager.killProcessesByBundleName('com.example.killprocessthirdhap').then((data)=>{ - console.info('====>ACTS_KillProcess_0100 killProcessesByBundleName=====>' + JSON.stringify(data)) - }) - },2000) - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json deleted file mode 100755 index 27d177183..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.killprocessthirdhap.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/app.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/app.json deleted file mode 100755 index 04957795c..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.acts.killprocessthirdhap2", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/Test.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 09e417a9e..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import appManager from '@ohos.application.appManager' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - console.log("in killhap onForeground") - setTimeout(()=>{ - appManager.killProcessesByBundleName('com.example.killprocessthirdhap2',(err,data)=>{ - console.info('====>ACTS_KillProcess_0100 killProcessesByBundleName=====>' + JSON.stringify(data)) - }) - },2000) - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json deleted file mode 100755 index 1f73e0270..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.killprocessthirdhap2.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json deleted file mode 100755 index 1a44bb9e6..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsconnectabilitysystemabilitytest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/Test.json b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/Test.json deleted file mode 100755 index fcdb809aa..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/Test.json +++ /dev/null @@ -1,31 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "120000", - "package": "com.example.actsconnectabilitysystemabilitytest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101" - ] - }, - { - "test-file-name": [ - "ActsConnectAbilitySystemAbilityTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - - ] -} - diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 171016091..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,42 +0,0 @@ -import Ability from '@ohos.application.Ability' -// import commonEvent from '@ohos.commonEvent' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceTest onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceTest onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceTest onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceTest onWindowStageDestroy") - } - - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceTest onForeground") - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceTest onBackground") - } - -}; diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100755 index 2ebcc19bf..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import commonEvent from '@ohos.commonEvent' -import rpc from '@ohos.rpc'; -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' - -var conn = -1; -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0100_commonEvent========"); -} -function publishCallBackTwo () { - console.log("========Publish CallBack AMS_ConnectAbility_0200_commonEvent========"); -} -function publishCallBackThree () { - console.log("========Publish CallBack AMS_ConnectAbility_0300_commonEvent========"); -} -function publishCallBackFour () { - console.log("========Publish CallBack AMS_ConnectAbility_0400_commonEvent========"); -} -function publishCallBackFive () { - console.log("========Publish CallBack AMS_ConnectAbility_0500_commonEvent========"); -} -function publishCallBackSix () { - console.log("========Publish CallBack AMS_ConnectAbility_0600_commonEvent========"); -} -function publishCallBackzero () { - console.log("========Publish CallBack AMSc_disonnectAbility_0100_commonEvent========"); -} -function publishCallBackttwo () { - console.log("========Publish CallBack AMSc_disonnectAbility_0200_commonEvent========"); -} - -class Stub extends rpc.RemoteObject { - constructor(des) { - super(des); - } - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} - -function onConnectCallback(element) { - console.log('ACTS_ConnectAbility_0100 ConnectAbility onConnect element.bundleName : ' + element.bundleName) - console.log('ACTS_ConnectAbility_0100 ConnectAbility onConnect element.abilityName : ' + element.abilityName) -} - -function onDisconnectCallback1(element) { - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) -} -function onDisconnectCallback2(element) { - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) -} -function onDisconnectCallback3(element) { - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) -} -function onDisconnectCallback4(element) { - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) -} -function onDisconnectCallback5(element) { - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) -} -function onDisconnectCallback6(element) { - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) - console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) -} -function onFailedCallback(code) { - console.log('ACTS_ConnectAbility_0100 ConnectAbility onFailed errCode : ' + code) -} - - -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - - console.log('ServiceAbility registerApplicationStateObserver begin'); - console.log('ServiceAbility registerApplicationStateObserver end, conn: ' + conn); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - let extensionContext = this.context - if (want.action == "one") { - commonEvent.publish("AMS_ConnectAbility_0100_commonEvent", publishCallBackOne); - } - ; - if (want.action == "two") { - commonEvent.publish("AMS_ConnectAbility_0200_commonEvent", publishCallBackTwo); - } - ; - if (want.action == "Three") { - commonEvent.publish("AMS_ConnectAbility_0300_commonEvent", publishCallBackThree); - } - ; - if (want.action == "Four") { - commonEvent.publish("AMS_ConnectAbility_0400_commonEvent", publishCallBackFour); - } - ; - if (want.action == "Five") { - commonEvent.publish("AMS_ConnectAbility_0500_commonEvent", publishCallBackFive); - } - ; - if (want.action == "Six") { - commonEvent.publish("AMS_ConnectAbility_0600_commonEvent", publishCallBackSix); - } - ; - if (want.action == "Seven") { - extensionContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility2", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback1, - onFailed: onFailedCallback, - }, - ); - var myStub4 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); - return myStub4; - }; - if (want.action == "Eight") { - extensionContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility3", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback6, - onFailed: onFailedCallback, - }, - ); - var myStub1 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); - return myStub1; - }; - if (want.action == "Nine") { - console.log('connectAbility 111'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsconnectabilitysystemabilitytest', - abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback2, - onFailed: onFailedCallback, - },) - setTimeout(()=>{ - extensionContext.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility'); - }) - },1000) - var myStub2 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); - return myStub2; - - }; - if (want.action == "Ten") { - console.log('connectAbility 222'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsconnectabilitysystemabilitytest', - abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback3, - onFailed: onFailedCallback, - },) - setTimeout(()=>{ - extensionContext.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility2'); - }) - },1000) - var myStub3 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); - return myStub3; - - }; - if (want.action == "Ten one") { - console.log('connectAbility 333'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsconnectabilitysystemabilitytest', - abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback4, - onFailed: onFailedCallback, - },) - setTimeout(()=>{ - extensionContext.disconnectAbility(2222).then(()=>{ - console.log('in disconnectAbility3'); - }) - },1000) - var myStub5 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); - return myStub5; - - }; - if (want.action == "Ten two") { - console.log('connectAbility 444'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsconnectabilitysystemabilitytest', - abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback5, - onFailed: onFailedCallback, - },) - setTimeout(()=>{ - extensionContext.disconnectAbility(2222).then(()=>{ - console.log('in disconnectAbility4'); - }) - },1000) - var myStub6 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); - return myStub6; - - }; - } - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - commonEvent.publish("AMSc_disonnectAbility_0100_commonEvent",publishCallBackzero); - commonEvent.publish("AMSc_disonnectAbility_0200_commonEvent",publishCallBackttwo); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100755 index df24f3138..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from "@ohos.commonEvent" - -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility2 onCreate'); - globalThis.abilityWant = want; - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - } - - onConnect(want) { - console.log('ServiceAbility2 onConnect'); - commonEvent.publish("AMS_ConnectAbility_0700_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_0700_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_0900_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_0900_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1000_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1000_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1100_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1100_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1200_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1200_commonEvent callback"); - }) - } - - - onDisconnect(want) { - console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility2 onDestroy'); - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/index/index.ets b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/index/index.ets deleted file mode 100755 index deb36d6e3..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" -import testsuite from "../../test/List.test.ets" - -@Entry -@Component -struct Index { - - aboutToAppear() { - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - configService.setConfig(globalThis.abilityWant.parameters) - testsuite(globalThis.abilityContext) - core.execute() - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World1111111') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index 203485bd7..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityTest from './manyusersabilitytest.test.ets' -export default function testsuite(context) { - - abilityTest(context) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets deleted file mode 100755 index 9d2c58615..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets +++ /dev/null @@ -1,814 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' - - -var subscriberInfoStartAbility_0100 = { - events: ["AMS_ConnectAbility_0100_commonEvent"], -}; -var subscriberInfoStartAbility_0200 = { - events: ["AMS_ConnectAbility_0200_commonEvent"], -}; -var subscriberInfoStartAbility_0300 = { - events: ["AMS_ConnectAbility_0300_commonEvent"], -}; -var subscriberInfoStartAbility_0400 = { - events: ["AMS_ConnectAbility_0400_commonEvent"], -}; -var subscriberInfoStartAbility_0500 = { - events: ["AMS_ConnectAbility_0500_commonEvent"], -}; -var subscriberInfoStartAbility_0600 = { - events: ["AMS_ConnectAbility_0600_commonEvent"], -}; -var subscriberInfoStartAbility_0700 = { - events: ["AMS_ConnectAbility_0700_commonEvent"], -}; -var subscriberInfoStartAbility_0800 = { - events: ["AMS_ConnectAbility_0800_commonEvent"], -}; -var subscriberInfoStartAbility_0900 = { - events: ["AMS_ConnectAbility_0900_commonEvent"], -}; - -var subscriberInfoStartAbility_1000 = { - events: ["AMS_ConnectAbility_1000_commonEvent"], -}; - -var subscriberInfoStartAbility_1100 = { - events: ["AMS_ConnectAbility_1100_commonEvent"], -}; - -var subscriberInfoStartAbility_1200 = { - events: ["AMS_ConnectAbility_1200_commonEvent"], -}; -var unsubscriberInfoStartAbility_0100 = { - events: ["AMSc_disonnectAbility_0100_commonEvent"], -}; -var unsubscriberInfoStartAbility_0200 = { - events: ["AMSc_disonnectAbility_0200_commonEvent"], -}; - - -const START_ABILITY_TIMEOUT = 1000; -globalThis.number = 0; - -export default function abilityTest(abilityContext) { - describe('ActssystemabilityTest', function () { - function onFailedCallBack(code) { - console.log('ACTS_ConnectAbility_0200 Connectability errcode:' + code); - } - - /* - * @tc.number: ACTS_ConnectAbility_0100 - * @tc.name: Connects a service ability - * @tc.desc: Connects a service ability - */ - it('ACTS_ConnectAbility_0100', 0, async function (done) { - console.log('ACTS_ConnectAbility_0100====ACTS_ConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent"); - console.debug("====>ACTS_ConnectAbility_0100 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ConnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_ConnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - done(); - } - - function timeout() { - expect().assertFail(); - console.debug('AMS_ConnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ConnectAbility_0100 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "one", - }, - ); - console.debug("====>ACTS_ConnectAbility_0100 4 "); - - }) - - /* - * @tc.number: ACTS_ConnectAbility_0200 - * @tc.name: Connects a service ability - * @tc.desc: Connects a service ability - */ - it('ACTS_ConnectAbility_0200', 0, async function (done) { - console.log('ACTS_ConnectAbility_0200====Subscribe CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0200_commonEvent"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - done(); - } - function timeout() { - console.debug('AMS_ConnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbilityone", - action: "two", - }, - { - onFailed: onFailedCallBack, - }, - ); - }) - - /* - * @tc.number: ACTS_DisconnectAbility_0100 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_DisconnectAbility_0100', 0, async function (done) { - console.log('ACTS_DisconnectAbility_0100====ACTS_DisconnectAbility_0100 5 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - console.debug("====>ACTS_DisconnectAbility_0100 6====>"); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_DisconnectAbility_0100 6====>"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0100 2 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - setTimeout(()=> - { - done() - }, 1000)}; - function timeout() { - expect().assertFail(); - console.debug('AMS_DonnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_DisconnectAbility_0100 3====>"); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Three", - }, - ); - console.debug("====>ACTS_DisconnectAbility_0100 4====>"); - }) - - /* - * @tc.number: ACTS_DisconnectAbility_0200 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_DisconnectAbility_0200', 0, async function (done) { - console.log('ACTS_DisconnectAbility_0200 1====ACTS_DisconnectAbility_0200 3 CallBack1 data:====>" + JSON.stringify(data)); - commonEvent.createSubscriber(unsubscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0200 6 Subscriber====>"); - subscriberdisconnect = data; - await commonEvent.subscribe(subscriberdisconnect, subscribedisconnectback); - console.debug("====>ACTS_DisconnectAbility_0200 1111 connectAbility1====>"); - - console.debug("====>ACTS_DisconnectAbility_0200 1111 connectAbility2====>"); - console.debug("====>ACTS_DisconnectAbility_0200 66 Subscriber====>"); - abilityContext.disconnectAbility( - 999, - (error, data) => { - console.log('ACTS_DisconnectAbility_0200 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - }) - } - function subscribedisconnectback(err, data) { - console.debug("====>ACTS_DisconnectAbility_0200 7 CallBack2 data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - clearTimeout(id); - expect().assertFail(); - done(); - }) - }) - } - function timeout() { - console.debug('ACTS_DisconnectAbility_0200 8 timeout'); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('ACTS_DisconnectAbility_0200 9 DisconnectAbility result errCode : ' + error.code + " data: " + data) - console.debug("====>ACTS_DisconnectAbility_0200 99 Subscriber====>"); - setTimeout(() => { - done(); - }, 1000) - }); - }) - }) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0400).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0200 10 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Four", - }, - ); - console.debug("====>connId is:====>" + JSON.stringify(connId)); - console.debug("====>ACTS_DisconnectAbility_0200 1010 Subscriber====>"); - }) - function unSubscribeCallback() { - console.debug("====>ACTS_DisconnectAbility_0200 1111 UnSubscribe CallBack====>"); - done(); - } - }) - - /* - * @tc.number: ACTS_DisconnectAbility_0300 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_DisconnectAbility_0300', 0, async function (done) { - console.log('ACTS_DisconnectAbility_0300====ACTS_DisconnectAbility_0300 4 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0500_commonEvent"); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('ACTS_DisconnectAbility_0300 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0500).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0300 1 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>ACTS_DisconnectAbility_0300 6 CallBack====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - expect().assertFail(); - console.debug('AMS_ConnectAbility_0500 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('ACTS_DisconnectAbility_0300 7 DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_DisconnectAbility_0300 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Five", - }, - ); - console.debug("====>ACTS_DisconnectAbility_0300 4 "); - }) - - /* - * @tc.number: ACTS_DisconnectAbility_0400 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_DisconnectAbility_0400', 0, async function (done) { - console.log('ACTS_DisconnectAbility_0400 1====ACTS_DisconnectAbility_0400 3 CallBack1 data:====>" + JSON.stringify(data)); - commonEvent.createSubscriber(unsubscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0400 6 Subscriber====>"); - subscriberdisconnect = data; - await commonEvent.subscribe(subscriberdisconnect, subscribedisconnectback); - console.debug("====>ACTS_DisconnectAbility_0400 1111 connectAbility1====>"); - - console.debug("====>ACTS_DisconnectAbility_0400 1111 connectAbility2====>"); - console.debug("====>ACTS_DisconnectAbility_0400 66 Subscriber====>"); - abilityContext.disconnectAbility( - 999, - (error, data) => { - console.log('ACTS_DisconnectAbility_0400 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - }) - } - function subscribedisconnectback(err, data) { - console.debug("====>ACTS_DisconnectAbility_0400 7 CallBack2 data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - clearTimeout(id); - expect().assertFail(); - done(); - }) - }) - } - function timeout() { - console.debug('ACTS_DisconnectAbility_0400 8 timeout'); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('ACTS_DisconnectAbility_0400 9 DisconnectAbility result errCode : ' + error.code + " data: " + data) - console.debug("====>ACTS_DisconnectAbility_0400 99 Subscriber====>"); - setTimeout(() => { - done(); - }, 1000) - }); - }) - }) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0600).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0400 10 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Six", - }, - ); - console.debug("====>connId is:====>" + JSON.stringify(connId)); - console.debug("====>ACTS_DisconnectAbility_0400 1010 Subscriber====>"); - }) - function unSubscribeCallback() { - console.debug("====>ACTS_DisconnectAbility_0400 1111 UnSubscribe CallBack====>"); - done(); - } - }) - - /* - * @tc.number: ACTS_ExtensionConnectAbility_0100 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_ExtensionConnectAbility_0100', 0, async function (done) { - console.log('ACTS_ExtensionConnectAbility_0100====ACTS_ExtensionConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0700_commonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0100 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0700).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionConnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionConnectAbility_0100 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Seven", - }, - ); - console.debug("====>ACTS_ExtensionConnectAbility_0100 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionConnectAbility_0200 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_ExtensionConnectAbility_0200', 0, async function (done) { - console.log('ACTS_ExtensionConnectAbility_0200====ACTS_ExtensionConnectAbility_0200 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0800_commonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0200 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0200 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0800).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0200 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - console.debug('ACTS_ExtensionConnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionConnectAbility_0200 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Eight", - }, - ); - console.debug("====>ACTS_ExtensionConnectAbility_0200 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionDisconnectAbility_0100 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_ExtensionDisconnectAbility_0100', 0, async function (done) { - console.log('ACTS_ExtensionDisconnectAbility_0100====ACTS_ExtensionDisconnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0900_commonEvent"); - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0900).then(async (data) => { - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionDisconnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Nine", - }, - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionDisconnectAbility_0200 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_ExtensionDisconnectAbility_0200', 0, async function (done) { - console.log('ACTS_ExtensionDisconnectAbility_0200====ACTS_ExtensionDisconnectAbility_0200 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1000_commonEvent"); - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_1000).then(async (data) => { - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionDisconnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Ten", - }, - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionDisconnectAbility_0300 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_ExtensionDisconnectAbility_0300', 0, async function (done) { - console.log('ACTS_ExtensionDisconnectAbility_0300====ACTS_ExtensionDisconnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1100_commonEvent"); - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_1100).then(async (data) => { - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - console.debug('ACTS_ExtensionDisconnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Ten one", - }, - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionDisconnectAbility_0400 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_ExtensionDisconnectAbility_0400', 0, async function (done) { - console.log('ACTS_ExtensionDisconnectAbility_0400====ACTS_ThirdPartyExtensionDisconnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1200_commonEvent"); - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_1200).then(async (data) => { - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - console.debug('ACTS_ExtensionDisconnectAbility_0400 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Ten two", - }, - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 4 "); - }) - }) -} - - diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json deleted file mode 100755 index 486c0cf0f..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsconnectabilitysystemabilitytest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsconnectabilitysystemabilitytest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "reason": "ceshi" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "ceshi" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/app.json b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/app.json deleted file mode 100755 index 7ce2b709a..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsextensionconnectabilitytest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/Test.json b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/Test.json deleted file mode 100755 index d8239bcb3..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/Test.json +++ /dev/null @@ -1,42 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "120000", - "package": "com.example.actsextensionconnectabilitytest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101" - ] - }, - { - "test-file-name": [ - "ActsExtensionConnectAbilityTest.hap", - "actsServiceAbilityRelyHap.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "PushKit", - "push": [ - "actsServiceAbilityRelyHap.hap->/data/app/actsServiceAbilityRelyHap.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 777 /data/app/*.hap" - ] - } - ] -} - diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index d38bb6c9c..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.startnum = 0 - globalThis.stageContext = this.context; - - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 53688df76..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceTest onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceTest onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceTest onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceTest onWindowStageDestroy") - } - - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceTest onForeground") - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceTest onBackground") -} - -}; diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100755 index 056b97a1f..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from '@ohos.commonEvent' -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0300_commonEvent========"); -} -var conn = -1; -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - - console.log('ServiceAbility registerApplicationStateObserver begin'); - console.log('ServiceAbility registerApplicationStateObserver end, conn: ' + conn); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - let extensionContext = this.context - if (want.action == "Three") { - console.log('connectAbility 111'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsserviceabilityrelytest', - abilityName: 'com.example.actsserviceabilityrelytest.ServiceAbility' - }) - setTimeout(()=>{ - extensionContext.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility'); - }) - },1000) - - }; - commonEvent.publish("AMS_ConnectAbility_0300_commonEvent", publishCallBackOne); - - }; - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100755 index ba9ac7a26..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from '@ohos.commonEvent' -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0400_commonEvent========"); -} -var conn = -1; -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - - console.log('ServiceAbility registerApplicationStateObserver begin'); - console.log('ServiceAbility registerApplicationStateObserver end, conn: ' + conn); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - let extensionContext = this.context - - console.log('connectAbility 222'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsserviceabilityrelytest', - abilityName: 'com.example.actsserviceabilityrelytest.ServiceAbility' - }) - setTimeout(()=>{ - extensionContext.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility2'); - }) - },1000) - commonEvent.publish("AMS_ConnectAbility_0400_commonEvent", publishCallBackOne); - - }; - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index 8ca5c0a64..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityTest from './actsextensionconnectabilitytest.test.ets' -export default function testsuite(context) { - - abilityTest(context) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets deleted file mode 100755 index 9c790e1f1..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' - - -var subscriberInfoStartAbility_0100 = { - events: ["AMS_ConnectAbility_0100_commonEvent"], -}; -var subscriberInfoStartAbility_0200 = { - events: ["AMS_ConnectAbility_0200_commonEvent"], -}; -var subscriberInfoStartAbility_0300 = { - events: ["AMS_ConnectAbility_0300_commonEvent"], -}; -var subscriberInfoStartAbility_0400 = { - events: ["AMS_ConnectAbility_0400_commonEvent"], -}; -const START_ABILITY_TIMEOUT = 5000; -globalThis.number = 0; - -export default function abilityTest(abilityContext) { - describe('ActsExtensionConnectAbilityTest', function () { - - it('ACTS_ConnectAbility_0300', 0, async function (done) { - console.log('ACTS_ConnectAbility_0300====ACTS_ConnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent"); - console.debug("====>ACTS_ConnectAbility_0300 5 "); - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) - } - ); - console.debug("====>ACTS_ConnectAbility_0300 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_ConnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = await abilityContext.connectAbility({ - bundleName: "com.example.actsserviceabilityrelytest", - abilityName: "com.example.actsserviceabilityrelytest.ServiceAbility", - }, (err, data) => { - console.log('ACTS_ProcessManage SystemAppA onShowProcess startAbility startServiceAbility: ' - + JSON.stringify(err) + ", " + JSON.stringify(data)) - }) - }) - - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ConnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ConnectAbility_0300 4 "); - - }) - - it('ACTS_ConnectAbility_0400', 0, async function (done) { - console.log('ACTS_ConnectAbility_0400====ACTS_ConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0200_commonEvent"); - console.debug("====>ACTS_ConnectAbility_0400 5 "); - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) - } - ); - console.debug("====>ACTS_ConnectAbility_0400 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>ACTS_ConnectAbility_0400 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - console.debug("====>ACTS_ConnectAbility_0400 3 "); - connId = await abilityContext.connectAbility({ - bundleName: "com.example.actsserviceabilityrelytest", - abilityName: "com.example.actsserviceabilityrelytest.ServiceAbility", - }, (err, data) => { - console.log('ACTS_ProcessManage SystemAppA onShowProcess startAbility startServiceAbility: ' - + JSON.stringify(err) + ", " + JSON.stringify(data)) - }) - console.debug("====>ACTS_ConnectAbility_0400 4 "); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ConnectAbility_0400 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - it('ACTS_ExtensionConnectAbility_0300', 0, async function (done) { - console.log('ACTS_ExtensionConnectAbility_0300====ACTS_ExtensionConnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0300_commonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0300 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0300 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsextensionconnectabilitytest", - abilityName: "com.example.actsextensionconnectabilitytest.ServiceAbility", - action:"Three", - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - console.debug("====>ACTS_ExtensionConnectAbility_0300 4 "); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionConnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionConnectAbility_0300 3 "); - - }) - - it('ACTS_ExtensionConnectAbility_0400', 0, async function (done) { - console.log('ACTS_ExtensionConnectAbility_0400====ACTS_ExtensionConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0400_commonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0400 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0400 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0400).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0400 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - console.debug("====>ACTS_ExtensionConnectAbility_0400 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsextensionconnectabilitytest", - abilityName: "com.example.actsextensionconnectabilitytest.ServiceAbility2", - action:"Four", - }, - ); - console.debug("====>ACTS_ExtensionConnectAbility_0400 4 "); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionConnectAbility_0400 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - - - }) -} - - diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json deleted file mode 100755 index 791a6b264..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsextensionconnectabilitytest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actsextensionconnectabilitytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsextensionconnectabilitytest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100755 index ee9582e7c..000000000 --- a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from '@ohos.commonEvent' -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0100_commonEvent========"); -} -function publishCallBackTwo () { - console.log("========Publish CallBack AMS_ConnectAbility_0200_commonEvent========"); -} - -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - commonEvent.publish("AMS_ConnectAbility_0100_commonEvent", publishCallBackOne); - commonEvent.publish("AMS_ConnectAbility_0200_commonEvent", publishCallBackTwo); - }; - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json deleted file mode 100644 index 584a67f5b..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.extensionmodule", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/Test.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 159f48742..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index acbfa3724..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import rpc from '@ohos.rpc' - -var connection = -1; -let options = { - onConnect: function(elementName, proxy) { - console.log("mxh onConnect success"); - if (proxy == null) { - console.log("mxh proxy == null"); - return; - } - let option = new rpc.MessageOption(); - let data = new rpc.MessageParcel(); - let reply = new rpc.MessageParcel(); - data.writeInt(1); - data.writeInt(99); - proxy.sendRequest(1, data, reply, option); - let msg = reply.readInt(); - console.log("mxh onConnect msg:" + msg); - }, - - onDisconnect: function() {console.log("mxh onDisconnect success");}, - onFailed: function() {console.log("mxh onFailed");} -} -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log('mxh MainAbility onCreate is called' + want + launchParam); - } - - onDestroy() { - console.log('mxh MainAbility onDestroy is called'); - } - - onWindowStageCreate(windowStage) { - console.log('mxh MainAbility onWindowStageCreate is called'); - let context = this.context; - globalThis.startServiceExtAbility = (() => { - console.log("mxh startServiceExtAbility begin"); - var want = { - "bundleName": "com.example.ohosproject.hmservice", - "abilityName": "ServiceExtAbility", - } - context.startAbility(want).then((data) => { - console.info("mxh startAbility success:" + JSON.stringify(data)); - }).catch((error) => { - console.error("mxh startAbility failed:" + JSON.stringify(error)); - }) - console.log("mxh startServiceExtAbility end"); - }) - - globalThis.connectServiceExtAbility = (() => { - console.log("mxh connectServiceExtAbility begin"); - var want = { - "bundleName": "com.example.ohosproject.hmservice", - "abilityName": "ServiceExtAbility", - } - connection = context.connectAbility(want, options); - console.log("mxh connectServiceExtAbility end, connection:" + connection); - }) - - globalThis.disconnectServiceExtAbility = (() => { - console.log("mxh disconnectServiceExtAbility begin"); - context.disconnectAbility(connection).then((data) => { - console.info("mxh startAbility success:" + JSON.stringify(data)); - }).catch((error) => { - console.error("mxh startAbility failed:" + JSON.stringify(error)); - }); - console.log("mxh disconnectServiceExtAbility end, connection:" + connection); - }) - - windowStage.setUIContent(this.context, 'pages/index/index', null); - } - - onWindowStageDestroy() { - console.log('mxh MainAbility onWindowStageDestroy is called'); - } - - onForeground() { - console.log('mxh MainAbility onForeground is called'); - } - - onBackground() { - console.log('mxh MainAbility onBackground is called'); - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json deleted file mode 100644 index c7430ec21..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.pmvendorappservice.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "name": "ServiceExtAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "permissions": [ - "ohos.permission.USE_BLUETOOTH" - ], - "metadata": [ - { - "name": "ohos.extension.form", - "value": "MainAbility", - "resource": "@profile:form_config" - } - ], - "visible": true, - "type": "service" - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json deleted file mode 100644 index ca8f7004d..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.staticextensioninfotest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/Test.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 159f48742..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 5b95af0db..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageDestroy") - } - - async onForeground() { - // Ability has brought to foreground - console.log("ACTS_ProcessManage VendorAppService MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("ACTS_ProcessManage VendorAppService MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json deleted file mode 100644 index e26e51946..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.staticextensioninfotest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.staticextensioninfotest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ] - } -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/app.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/app.json deleted file mode 100644 index 51ee16f27..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.staticinformationmultihappackage", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/Test.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 159f48742..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 746e6b2a4..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_getAbilityInfo_0400 MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_getAbilityInfo_0400 MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_getAbilityInfo_0400 MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_getAbilityInfo_0400 MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_getAbilityInfo_0400 MainAbility onForeground") - if (globalThis.abilityWant.action == 'startHapA') { - globalThis.abilityContext.startAbility({ - bundleName: "com.example.staticinformationmultihappackage", - abilityName: "com.example.feature.MainAbility", - action: "startHapB" - }, (error, data) => { - console.log('ACTS_getAbilityInfo_0400 MainAbility onForeground - startAbility restart singleton: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - commonEvent.publish("MainAbility_Start_CommonEvent_multi_hap_entry", { - parameters: { - hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), - applicationInfo: JSON.stringify(globalThis.abilityContext.applicationInfo), - abilityInfo: JSON.stringify(globalThis.abilityContext.abilityInfo) - } - }, (err) => { - console.log("ACTS_getAbilityInfo_0400 MainAbility Publish CallBack onForeground") - }); - } - console.log("ACTS_getAbilityInfo_0400 MainAbility onForeground") - - if (globalThis.abilityWant.action == 'multiple') { - commonEvent.publish("MainAbility_Start_CommonEvent_multiple_hap_entry", { - parameters: { - hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), - applicationInfo: JSON.stringify(globalThis.abilityContext.applicationInfo), - abilityInfo: JSON.stringify(globalThis.abilityContext.abilityInfo) - } - }, (err) => { - console.log("ACTS_getAbilityInfo_0400 MainAbility Publish CallBack onForeground") - }); - } - } - - onBackground() { - // Ability has back to background - console.log("ACTS_getAbilityInfo_0400 MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json deleted file mode 100644 index 0cd086184..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "module": { - "name": "com.example.staticinformationmultihappackage", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.staticinformationmultihappackage.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.USE_BLUETOOTH", - "reason":"need use ohos.permission.USE_BLUETOOTH" - } - ] - } -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/app.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/app.json deleted file mode 100644 index 51ee16f27..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.staticinformationmultihappackage", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/Test.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/Test.json deleted file mode 100644 index ba2697bb6..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 159f48742..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index f2a2876e6..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_getAbilityInfo_0400 MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_getAbilityInfo_0400 MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_getAbilityInfo_0400 MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_getAbilityInfo_0400 MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_getAbilityInfo_0400 MainAbility onForeground") - if (globalThis.abilityWant.action == 'startHapB') { - commonEvent.publish("MainAbility_Start_CommonEvent_multi_hap_feature", { - parameters: { - hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), - applicationInfo: JSON.stringify(globalThis.abilityContext.applicationInfo), - abilityInfo: JSON.stringify(globalThis.abilityContext.abilityInfo) - } - }, (err) => { - console.log("ACTS_getAbilityInfo_0400 MainAbility Publish CallBack onForeground") - }); - } - } - - onBackground() { - // Ability has back to background - console.log("ACTS_getAbilityInfo_0400 MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json deleted file mode 100644 index 2f74083c6..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "module": { - "name": "com.example.feature", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.feature.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.USE_BLUETOOTH", - "reason":"need use ohos.permission.USE_BLUETOOTH" - } - ] - } -} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index 28dec8f5b..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; -import commonEvent from '@ohos.commonEvent'; -import bundle from '@ohos.bundle'; -import missionManager from '@ohos.application.missionManager'; - -const BUNDLE_PATHS = [['/data/ActsAmsStaticQueryTestTwoRelyHap.hap'],['/data/ActsAmsStaticARelyHap.hap']]; -const BUNDLE_NAMES = ['com.example.staticquerytesttwo','com.example.staticinformationmultihappackage']; -const PATHS_COUNT = 2; -const BUNDLE_COUNT = 2; -const MAX_MISSION_NUM = 1024; -var subscriberInfo = { - events: ['MainAbility_Start_CommonEvent_multi_hap_entryB', 'MainAbility_Start_CommonEvent_multiple_hap_entry'] -}; - -function getMissionId() { - return new Promise(async (resolve, reject) => { - var missionId = -1; - var missionInfos = await missionManager.getMissionInfos('', MAX_MISSION_NUM); - console.log('======>ACTS_getAbilityInfo_0500 getMissionId missionInfos<=======' + missionInfos); - for (let i = 0; i < missionInfos.length; i++) { - console.log('getMissionId result: ' + i + '= ' + JSON.stringify(missionInfos[i])) - if ((missionInfos[i].want.abilityName == "com.example.staticinformationmultiple.MainAbility") && - (missionInfos[i].runningState == 0)) { - missionId = missionInfos[i].missionId; - break; - } - } - console.log('======>ACTS_getAbilityInfo_0500 getMissionId resolve missionId<=======' + missionId); - resolve(missionId); - }) -} - -export default function abilityTest(abilityContext) { - describe('ActsAbilityTest', function () { - - // beforeEach(async (done) => { - // console.log('======>beforeEach ininin<======='); - // let installer = await bundle.getBundleInstaller(); - // var count = 0; - - // for (let i = 0; i < PATHS_COUNT; i++) { - // installer.install(BUNDLE_PATHS[i], { - // userId: 100, - // installFlag: 1, - // isKeepData: false - // }, (err, data) => { - // count++; - // console.log('======>beforeEach install finish <=======' + err.code); - // console.log('======>beforeEach install finish <=======' + data.status); - // console.log('======>beforeEach install finish <=======' + data.statusMessage); - // if (count == BUNDLE_COUNT) { - // done(); - // } - // }) - // } - // }) - - // afterEach(async (done) => { - // let installer = await bundle.getBundleInstaller(); - // var count = 0; - // var testMissionId; - - // testMissionId = await getMissionId(); - // console.log('======>afterEach test missionId<=======' + testMissionId); - // await missionManager.moveMissionToFront(testMissionId); - - // for (let i = 0; i < BUNDLE_COUNT; i++) { - // installer.uninstall(BUNDLE_NAMES[i], { - // userId: 100, - // installFlag: 1, - // isKeepData: false - // }, (err, data) => { - // count++; - // console.log('======>afterEach uninstall finish <=======' + err.code); - // console.log('======>afterEach uninstall finish <=======' + data.status); - // console.log('======>afterEach uninstall finish <=======' + data.statusMessage); - // if (count == BUNDLE_COUNT) { - // done(); - // } - // }) - // } - // }) - - /** - * @tc.number: ACTS_getAbilityInfo_0400 - * @tc.name: Starting singleton ability the second time does triggers onNewWant. - * @tc.desc: Starting singleton ability the second time does triggers onNewWant. - */ - it('ACTS_getAbilityInfo_0500', 0, async function (done) { - console.log("ACTS_getAbilityInfo_0500 --- start") - var Subscriber; - var EntryHap = false; - var FeatureHap = false; - - abilityContext.startAbility({ - bundleName: "com.example.staticquerytesttwo", - abilityName: "com.example.staticquerytesttwo.MainAbility", - action:"startmultiple" - }, (error, data) => { - console.log('ACTS_getAbilityInfo_0500 - startAbility start HapA: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_getAbilityInfo_0500====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - console.debug("ACTS_getAbilityInfo_0500====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_getAbilityInfo_0500====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - if (data.event == 'MainAbility_Start_CommonEvent_multi_hap_entryB') { - EntryHap = true; - console.log("ACTS_getAbilityInfo_0500====> MainAbility_Start_CommonEvent_multi_hap_entryB") - let abilityInfo = JSON.parse(data.parameters['abilityInfo']) - let hapModuleInfo = JSON.parse(data.parameters['hapModuleInfo']) - let applicationInfo =JSON.parse(data.parameters['applicationInfo']) - console.log("ACTS_getAbilityInfo_0500_entry_abilityInfo" + abilityInfo.name) - console.log("ACTS_getAbilityInfo_0500_entry_applicationInfo" + applicationInfo.name) - console.log("ACTS_getAbilityInfo_0500_entry_hapModuleInfo" + hapModuleInfo.name) - expect(abilityInfo.name).assertEqual("com.example.staticquerytesttwo.MainAbility"); - expect(applicationInfo.name).assertEqual("com.example.staticquerytesttwo"); - expect(hapModuleInfo.name).assertEqual("com.example.staticquerytesttwo"); - } else if (data.event == 'MainAbility_Start_CommonEvent_multiple_hap_entry'){ - FeatureHap = true; - console.log("ACTS_getAbilityInfo_0500====> MainAbility_Start_CommonEvent_multi_hap_feature") - let abilityInfo1 = JSON.parse(data.parameters['abilityInfo']) - let hapModuleInfo1 = JSON.parse(data.parameters['hapModuleInfo']) - let applicationInfo1 =JSON.parse(data.parameters['applicationInfo']) - console.log("ACTS_getAbilityInfo_0500_feature_abilityInfo" + abilityInfo1.name) - console.log("ACTS_getAbilityInfo_0500_feature_applicationInfo" + applicationInfo1.name) - console.log("ACTS_getAbilityInfo_0500_feature_hapModuleInfo" + hapModuleInfo1.name) - expect(abilityInfo1.name).assertEqual("com.example.staticinformationmultihappackage.MainAbility"); - expect(applicationInfo1.name).assertEqual("com.example.staticinformationmultihappackage"); - expect(hapModuleInfo1.name).assertEqual("com.example.staticinformationmultihappackage"); - } - if(EntryHap && FeatureHap){ - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - function UnSubscribeCallback() { - console.debug("ACTS_getAbilityInfo_0500====>UnSubscribe CallBack====>"); - done(); - } - }) - - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index a1bf03287..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; -import commonEvent from '@ohos.commonEvent'; -import bundle from '@ohos.bundle'; -import missionManager from '@ohos.application.missionManager'; - -const BUNDLE_PATH = ['/data/ActsAmsStaticARelyHap.hap','/data/ActsAmsStaticBRelyHap.hap']; -const BUNDLE_NAME = ['com.example.staticinformationmultihappackage']; -const PATHS_COUNT = 1; -const BUNDLE_COUNT = 1; -const MAX_MISSION_NUM = 1024; -var subscriberInfo = { - events: ['MainAbility_Start_CommonEvent_multi_hap_entry', 'MainAbility_Start_CommonEvent_multi_hap_feature'], -}; - -function getMissionId() { - return new Promise(async (resolve, reject) => { - var missionId = -1; - var missionInfos = await missionManager.getMissionInfos('', MAX_MISSION_NUM); - console.log('======>ACTS_getAbilityInfo_0400 getMissionId missionInfos<=======' + missionInfos); - for (let i = 0; i < missionInfos.length; i++) { - console.log('getMissionId result: ' + i + '= ' + JSON.stringify(missionInfos[i])) - if ((missionInfos[i].want.abilityName == "com.example.staticinformationmultihap.MainAbility") && - (missionInfos[i].runningState == 0)) { - missionId = missionInfos[i].missionId; - break; - } - } - console.log('======>ACTS_getAbilityInfo_0400 getMissionId resolve missionId<=======' + missionId); - resolve(missionId); - }) -} - -export default function abilityTest(abilityContext) { - describe('ActsAbilityTest', function () { - - beforeEach(async (done) => { - let installer = await bundle.getBundleInstaller(); - var count = 0; - installer.install(BUNDLE_PATH, { - userId: 100, - installFlag: 1, - isKeepData: false - }, (err, data) => { - count++; - console.log('======>ACTS_getAbilityInfo_0400 beforeEach install finish<=======' + err.code); - console.log('======>ACTS_getAbilityInfo_0400 beforeEach install finish<=======' + data.status); - console.log('======>ACTS_getAbilityInfo_0400 beforeEach install finish<=======' - + data.statusMessage); - if(count == PATHS_COUNT){ - done(); - } - }) - }) - - afterEach(async (done) => { - let installer = await bundle.getBundleInstaller(); - var count = 0; - var testMissionId; - - testMissionId = await getMissionId(); - console.log('======>ACTS_getAbilityInfo_0400 afterEach test missionId<=======' + testMissionId); - await missionManager.moveMissionToFront(testMissionId); - console.log('======>ACTS_getAbilityInfo_0400 afterEach test move<======='); - installer.uninstall(BUNDLE_NAME, { - userId: 100, - installFlag: 1, - isKeepData: false - }, (err, data) => { - count++; - console.log('======>ACTS_getAbilityInfo_0400 afterEach uninstall finish<=======' + err.code); - console.log('======>ACTS_getAbilityInfo_0400 afterEach uninstall finish<=======' + data.status); - console.log('======>ACTS_getAbilityInfo_0400 afterEach uninstall finish<=======' - + data.statusMessage); - if(count == BUNDLE_COUNT){ - done(); - } - }) - }) - - /** - * @tc.number: ACTS_getAbilityInfo_0400 - * @tc.name: Starting singleton ability the second time does triggers onNewWant. - * @tc.desc: Starting singleton ability the second time does triggers onNewWant. - */ - it('ACTS_getAbilityInfo_0400', 0, async function (done) { - console.log("ACTS_getAbilityInfo_0400 --- start") - var Subscriber; - var EntryHap = false; - var FeatureHap = false; - - abilityContext.startAbility({ - bundleName: "com.example.staticinformationmultihappackage", - abilityName: "com.example.staticinformationmultihappackage.MainAbility", - action:"startHapA" - }, (error, data) => { - console.log('ACTS_getAbilityInfo_0400 - startAbility start HapA: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_getAbilityInfo_0400====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - console.debug("ACTS_getAbilityInfo_0400====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_getAbilityInfo_0400====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - if (data.event == 'MainAbility_Start_CommonEvent_multi_hap_entry') { - EntryHap = true; - console.log("ACTS_getAbilityInfo_0400====> MainAbility_Start_CommonEvent_multi_hap_entry") - let abilityInfo = JSON.parse(data.parameters['abilityInfo']) - let hapModuleInfo = JSON.parse(data.parameters['hapModuleInfo']) - let applicationInfo =JSON.parse(data.parameters['applicationInfo']) - console.log("ACTS_getAbilityInfo_0400_entry_abilityInfo" + abilityInfo.name) - console.log("ACTS_getAbilityInfo_0400_entry_applicationInfo" + applicationInfo.name) - console.log("ACTS_getAbilityInfo_0400_entry_hapModuleInfo" + hapModuleInfo.name) - expect(abilityInfo.name).assertEqual("com.example.staticinformationmultihappackage.MainAbility"); - expect(applicationInfo.name).assertEqual("com.example.staticinformationmultihappackage"); - expect(hapModuleInfo.name).assertEqual("com.example.staticinformationmultihappackage"); - } else if (data.event == 'MainAbility_Start_CommonEvent_multi_hap_feature'){ - FeatureHap = true; - console.log("ACTS_getAbilityInfo_0400====> MainAbility_Start_CommonEvent_multi_hap_feature") - let abilityInfo1 = JSON.parse(data.parameters['abilityInfo']) - let hapModuleInfo1 = JSON.parse(data.parameters['hapModuleInfo']) - let applicationInfo1 =JSON.parse(data.parameters['applicationInfo']) - console.log("ACTS_getAbilityInfo_0400_feature_abilityInfo" + abilityInfo1.name) - console.log("ACTS_getAbilityInfo_0400_feature_applicationInfo" + applicationInfo1.name) - console.log("ACTS_getAbilityInfo_0400_feature_hapModuleInfo" + hapModuleInfo1.name) - expect(abilityInfo1.name).assertEqual("com.example.feature.MainAbility"); - expect(applicationInfo1.name).assertEqual("com.example.staticinformationmultihappackage"); - expect(hapModuleInfo1.name).assertEqual("com.example.feature"); - } - if(EntryHap && FeatureHap){ - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - function UnSubscribeCallback() { - console.debug("ACTS_getAbilityInfo_0400====>UnSubscribe CallBack====>"); - done(); - } - }) - - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/SecondMainAbility/SecondMainAbility.ts b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/SecondMainAbility/SecondMainAbility.ts deleted file mode 100644 index 346d72f2e..000000000 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/SecondMainAbility/SecondMainAbility.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -export default class SecondAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("SecondAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("SecondAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("SecondAbility onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index", null) - globalThis.ability2Context = this.context; - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("SecondAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("SecondAbility onForeground") - if (globalThis.abilityWant.action == 'getAbilityContext2') { - commonEvent.publish("SecondAbility_Start_CommonEvent_ability", { - parameters: { - hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), - applicationInfo: JSON.stringify(globalThis.abilityContext.applicationInfo), - abilityInfo: JSON.stringify(globalThis.abilityContext.abilityInfo) - } - } ,(err) => { - console.log("MainAbility Publish CallBack MainAbility_Start_CommonEvent") - }); - console.log('stub SerivceAbilityServer OnConnect start 2'); - } - } - - onBackground() { - // Ability has back to background - console.log("SecondAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/app.json b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/app.json deleted file mode 100644 index 15d65f48a..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifytesthap", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/Test.json b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 159f48742..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 305015644..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -var callBackSeq = ""; - -function publishCallBack() { - console.debug("====>Publish CallBack ====>"); -} - -async function startAbilityProcess(abilityContext, options, parameters) { - let bundleName; - let abilityName; - - let idx = parameters.nextStep; - switch (parameters.step[idx]) { - case "testA": - bundleName = "com.example.actsspecifytesthap"; - abilityName = "com.example.actsspecifytesthap.MainAbility"; - break; - default: - break; - } - parameters.nextStep = ++idx; - abilityContext.startAbility({ - bundleName: bundleName, - abilityName: abilityName, - parameters: parameters, - }, options, (error, data) => { - console.log('startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) -} - -async function onShowProcess() { - var abilityWant = globalThis.abilityWant; - var callBackData = "actsspecifytesthap:" - callBackData += callBackSeq; - - var commonEventPublishData = { - data: callBackData, - parameters: { - displayId: globalThis.abilityWant.parameters['ohos.aafwk.param.displayId'], - windowMode: globalThis.abilityWant.parameters['ohos.aafwk.param.windowMode'], -} - }; - - console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify(abilityWant)); - if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { - commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, () => { - console.log('============>querytestsecond success==========>>') - callBackSeq = ""; - }); - } else { - commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { - callBackSeq = ""; - console.log('============>querytest success==========>>') - startAbilityProcess(globalThis.abilityContext, globalThis.abilityWant.options, abilityWant.parameters); - }); - } -} - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("actsspecifytesthap onCreate") - callBackSeq += "onCreate"; - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("actsspecifytesthap onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("actsspecifytesthap onWindowStageCreate") - // callBackSeq += "onWindowStageCreate"; - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index", null) - console.log("actsspecifytesthap onWindowStageCreate finish") - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("actsspecifytesthap onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("actsspecifytesthap onForeground") - callBackSeq += "onForeground"; - onShowProcess(); - } - - onBackground() { - // Ability has back to background - console.log("actsspecifytesthap onBackground") - } -}; diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json deleted file mode 100644 index 3b88ad073..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "module": { - "name": "com.example.actsspecifytesthap", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifytesthap.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS", - "reason": "need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason": "need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name": "ohos.permission.GET_RUNNING_INFO", - "reason": "need use ohos.permission.GET_RUNNING_INFO" - } - ] - } -} diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 96b478210..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 31ee0f53f..000000000 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -async function onShowProcess() { - var abilityWant = globalThis.abilityWant; - - var commonEventPublishData = { - parameters: { - displayId: globalThis.abilityWant.parameters['ohos.aafwk.param.displayId'], - windowMode: globalThis.abilityWant.parameters['ohos.aafwk.param.windowMode'], - } - }; - - console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify(abilityWant)); - - commonEvent.publish("ACTS_TerminateSelf_CommonEvent", commonEventPublishData, () => { - console.log('============>querytestsecond success==========>>') - globalThis.abilityContext.terminateSelf(); - }); - -} -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - globalThis.abilityWant = want; - console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify( globalThis.abilityWant)); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/second/second", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - onShowProcess(); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/config.json b/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/config.json deleted file mode 100755 index 740fdbcf5..000000000 --- a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/config.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actscontext", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actscontext", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "com.example.permission", - "reason": "$string:permreason_example", - "usedScene": { - "ability": [ - "com.example.Ability", - "com.example.AbilityBackground" - ], - "when": "always" - } - }, - { - "name": "com.example.permission.user", - "reason": "$string:permreason_example", - "usedScene": { - "ability": [ - "com.example.Ability", - "com.example.AbilityBackground" - ], - "when": "always" - } - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.example.actscontext.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/app.js deleted file mode 100755 index 2ba842eda..000000000 --- a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index e973598c2..000000000 --- a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "permreason_example", - "value": "permreason example" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/List.test.js deleted file mode 100755 index 98a2fa6e0..000000000 --- a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./ContextJsunit.test.js') diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/config.json b/aafwk/aafwk_standard/context/scene/defpermission/src/main/config.json deleted file mode 100755 index ae380a7bb..000000000 --- a/aafwk/aafwk_standard/context/scene/defpermission/src/main/config.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "app": { - "bundleName": "com.example.defpermission", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.defpermission", - "name": ".MyApplication", - "defPermissions": [ - { - "name": "com.example.permission", - "grantMode": "system_grant", - "availableScope": [] - }, - { - "name": "com.example.permission.user", - "grantMode": "user_grant", - "availableScope": [] - } - ], - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.defpermission.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/app.js b/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/app.js deleted file mode 100755 index 2ba842eda..000000000 --- a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/resources/base/element/string.json deleted file mode 100755 index d405647b9..000000000 --- a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json deleted file mode 100644 index 932f88850..000000000 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsfeatureabilitytest", - "vendor": "jstest", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": { - "default": { - "process": "processTest" - } - }, - "module": { - "package": "com.example.actsfeatureabilitytest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home", - "flag.home.intent.from.system" - ], - "actions": [ - "action.system.home" - ] - } - ], - "backgroundModes": [ - "dataTransfer" - ], - "name": "com.example.actsfeatureabilitytest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "launchType": "singleton", - "process": "processTestAbility", - "permissions": ["ohos.permission.ACCELEROMETER"], - "deviceCapability": ["ability_base","ability_runtime"], - "uri": "uriTest", - "visible": true - } - ], - "reqCapabilities": ["reqCapabilitiesTest1","reqCapabilitiesTest2"], - "description": "descriptionTest", - "defPermissions": [ - { - "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.CAMERA", - "reason": "$string:permreason_camera", - "usedScene": - { - "ability": ["com.mycamera.Ability", "com.mycamera.AbilityBackground"], - "when": "always" - } - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" - }, - { - "name": "ohos.permission.ACCELEROMETER", - "reason":"need use ohos.permission.ACCELEROMETER" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 4120936dd..000000000 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "actsfeatureabilitytest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "permreason_camera", - "value": "permreason camera" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js deleted file mode 100644 index a9e636da7..000000000 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./FeatureAbilityJsunit.test.js') -require('./StartAbilityJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/app.js b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/app.js deleted file mode 100755 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/element/string.json deleted file mode 100644 index 1724af073..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "finishwithresultemptytest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/app.js b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/app.js deleted file mode 100755 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/element/string.json deleted file mode 100644 index 57065ef21..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "finishwithresultpromiseparameterstest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/app.js b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/app.js deleted file mode 100755 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/element/string.json deleted file mode 100644 index d4822ce6c..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "finishwithresulttest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/app.js b/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/app.js deleted file mode 100755 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/element/string.json deleted file mode 100644 index f16bfd0d1..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "getcallingbundletest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/app.js b/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/app.js deleted file mode 100755 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/resources/base/element/string.json deleted file mode 100644 index dd684230e..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "startability" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/app.js b/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/app.js deleted file mode 100755 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/element/string.json deleted file mode 100644 index 48717037b..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "startabilityforresult" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/app.js b/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/app.js deleted file mode 100755 index 2a68c1992..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/element/string.json deleted file mode 100644 index 269e9af64..000000000 --- a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "terminateabilitytest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/BUILD.gn deleted file mode 100644 index f410079b1..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/BUILD.gn +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("formmanager") { - testonly = true - if (is_standard_system) { - deps = [ - "formhostst_ets/formsystemhost:FormSystemHost", - "formhostst_ets/formsystemhostb:FormSystemHostB", - "formhostst_ets/formsystemhostc:FormSystemHostC", - "formhostst_ets/formsystemhostd:FormSystemHostD", - "formhostst_ets/formsystemhoste:FormSystemHostE", - "formhostst_ets/formsystemhostf:FormSystemHostF", - "formhostst_ets/formsystemhostg:FormSystemHostG", - "formhostst_ets/formsystemhosti:FormSystemHostI", - "formhostst_ets/formsystemhostj:FormSystemHostJ", - "formhostst_ets/formsystemhostk:FormSystemHostK", - "formhostst_ets/formsystemhostl:FormSystemHostL", - "formhostst_ets/formsystemhostn:FormSystemHostN", - "formhostst_ets/formsystemhostnoperm:FormSystemHostNoPerm", - "formhostst_ets/formsystemhosto:FormSystemHostO", - "formhostst_ets/formsystemhostp:FormSystemHostP", - "formproviderst_ets/formsupplyapplicationA:FormSupplyAppA", - "formproviderst_ets/formsupplyapplicationB:FormSupplyAppB", - "formproviderst_ets/formsupplyapplicationC:FormSupplyAppC", - "formproviderst_ets/formsupplyapplicationD:FormSupplyAppD", - "formproviderst_ets/formsupplyapplicationE:FormSupplyAppE", - "formproviderst_ets/formsupplyapplicationF:FormSupplyAppF", - "formproviderst_ets/formsupplyapplicationG:FormSupplyAppG", - "formproviderst_ets/formsupplyapplicationH:FormSupplyAppH", - "formproviderst_ets/formsupplyapplicationNotSysApp:FormSupplyAppNS", - "formproviderst_ets/formsystemprovidera:FormSystemProviderA", - "formproviderst_ets/formsystemproviderb:FormSystemProviderB", - "formproviderst_ets/formsystemproviderc:FormSystemProviderC", - "formproviderst_ets/formsystemproviderd:FormSystemProviderD", - "formsystemtest_ets/formacquiretest:ActsFormAcquireTest", - "formsystemtest_ets/formacquiretest2:ActsFormAcquireTest2", - "formsystemtest_ets/formdeletetest:ActsFormDeleteTest", - "formsystemtest_ets/formdynamicrefreshtest:ActsFormDynamicRefreshTest", - "formsystemtest_ets/formfuzztest:ActsFormFuzzTest", - "formsystemtest_ets/formgetformsinfotest/formsoneandonetest:ActsFormsOneAndOneTest", - "formsystemtest_ets/formgetformsinfotest/formsoneandtwotest:ActsFormsOneAndTwoTest", - "formsystemtest_ets/formgetformsinfotest/formsoneandzerotest:ActsFormsOneAndZeroTest", - "formsystemtest_ets/formgetformsinfotest/formswithoutpermtest:ActsFormsWithoutPermTest", - "formsystemtest_ets/formgetformsinfotest/formszerotest:ActsFormsZeroTest", - "formsystemtest_ets/formhostdeathrecipienttest:ActsFormHostDeathRecipientTest", - "formsystemtest_ets/formperformancetest:ActsFormPerformanceTest", - "formsystemtest_ets/formreleasetest:ActsFormReleaseTest", - "formsystemtest_ets/formstatetest_disable:ActsFormStateDisableTest", - "formsystemtest_ets/formstatetest_enable:ActsFormStateEnableTest", - "formsystemtest_ets/formstatetest_notifyinvisible:ActsFormStateNotifyInvisibleTest", - "formsystemtest_ets/formstatetest_notifyinvisible2:ActsFormStateNotifyInvisibleTest2", - "formsystemtest_ets/formstatetest_notifyvisible:ActsFormStateNotifyVisibleTest", - "formsystemtest_ets/formstresstest:ActsFormStressTest", - "formsystemtest_ets/formupdatefreshtest:ActsFormUpdateRefreshTest", - ] - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 178d3f1f3..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private deleteForm = false; - private deleteId = "-1"; - private temporaryId = "-1"; - private temporary = false; - private castForm = false; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formCastEvent = "FMS_FormCast_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formOnUninstallEvent = "FMS_FormOnUninstall_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private publishOnErrorCallBack() { - this.canCreateForm = false; - console.debug("====>formOnErrorEvent Publish CallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====>formOnAcquiredEvent Publish CallBack ====>"); - } - private publishCastCallBack() { - console.debug("====>formCastEvent Publish CallBack ====>"); - } - - private publishOnUninstallCallBack() { - console.debug("====>formOnUninstallEvent Publish CallBack ====>"); - } - - private deleteCallBack(err, data) { - console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); - if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") { - return; - } - formManager.deleteForm(data.data) - .then((data2) => { - console.info('[FormComponent] deleteForm result:' + data2); - }); - - this.canCreateForm = false; - console.info("!!!====>formsystemhost deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); - }) - - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if (want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if (want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - console.log("formsystemhost dimension1:" + this.dimension); - if (want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - console.log("formsystemhost dimension2:" + this.dimension); - if (want.parameters.castForm) { - this.castForm = want.parameters.castForm; - } - if (want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if (want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if (want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:' + this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end' + JSON.stringify(want)); - - if (!want.parameters.isCreate && this.deleteForm) { - console.log("formsystemhost deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('formsystemhost deleteForm result:' + data); - let commonEventPublishData = { - data: data || `0`, - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .catch((error) => { - console.info('[FormComponent] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - console.log("formsystemhost deleteForm end"); - } - if (!want.parameters.isCreate && this.castForm) { - console.log("[FormComponent.host] castTempForm start"); - formManager.castTempForm(this.temporaryId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - setTimeout(() => { - let commonEventPublishData = { - data: data || `0`, - parameters: { - "formId": this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error); - setTimeout(() => { - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }); - console.log("[FormComponent.host] castTempForm end"); - } - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.log(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.log("[FormComponent.host] get form, form id:" + form.id); - this.formId = form.id; - if (this.castForm) { - console.log("[FormComponent.host] castTempForm start"); - formManager.castTempForm(this.temporaryId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - setTimeout(() => { - let commonEventPublishData = { - data: data || `0`, - parameters: { - "formId": this.formId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error); - setTimeout(() => { - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }); - console.log("[FormComponent.host] castTempForm end"); - } else if (this.deleteForm) { - console.log("[FormComponent.host] deleteForm start"); - if (this.deleteId == "self") { - this.deleteId = this.formId.toString(); - } - setTimeout(() => { - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent] deleteForm result:' + data); - let commonEventPublishData = { - data: data || `0`, - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .catch((error) => { - console.info('[FormComponent] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - - console.log("[FormComponent.host] deleteForm end"); - }, 1000); - } else { - let commonEventPublishData = { - data: this.formId.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onUninstall((info) => { - console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); - let commonEventPublishData = { - data: this.formId.toString(), - parameters: { - "formId": info.id.toString() - } - }; - commonEvent.publish(this.formOnUninstallEvent, commonEventPublishData, this.publishOnUninstallCallBack); - }) - .onError((error) => { - console.log("[FormComponent.host] error code:" + error.errcode); - console.log("[FormComponent.host] error msg:" + error.msg); - if (this.deleteForm && this.deleteId) { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId": this.formId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } else { - let commonEventPublishData = { - data: error.msg - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 02459b19d..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private deleteForm = false; - private deleteId = "-1"; - private temporaryId="-1"; - private temporary = false; - private castForm = false; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formCastEvent = "FMS_FormCast_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - private subscriberDle; - - private publishOnErrorCallBack() { - this.canCreateForm = false; - console.debug("====>formOnErrorEvent Publish CallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====>formOnAcquiredEvent Publish CallBack ====>"); - } - private publishCastCallBack() { - console.debug("====>formCastEvent Publish CallBack ====>"); - } - private deleteCallBack(err, data) { - console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); - if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostb") { - return; - } - formManager.deleteForm(data.data) - .then((data2) => { - console.info('[FormComponent] deleteForm result:' + data2); - }); - - this.canCreateForm = false; - console.info("!!!====>formsystemhost deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDle = data; - await commonEvent.subscribe(this.subscriberDle, this.deleteCallBack); - }) - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if(want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if(want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if(want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if(!this.dimension) { - this.dimension = FormDimension.Dimension_1_2; - } - if(want.parameters.castForm) { - this.castForm = want.parameters.castForm; - } - if(want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if(want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if(want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end'+ JSON.stringify(want)); - - if(!want.parameters.isCreate && this.deleteForm) { - console.log("formsystemhostb deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('formsystemhostb deleteForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .catch((error) => { - console.info('[FormComponent] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - - console.log("formsystemhostb deleteForm end"); - } - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.log(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.log("[FormComponent.host] get form, form id:" + form.id); - this.formId = form.id; - if(this.castForm) { - console.log("[FormComponent.host] castTempForm start"); - formManager.castTempForm(this.temporaryId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - setTimeout(() => { - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error); - setTimeout(() => { - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }); - - console.log("[FormComponent.host] castTempForm end"); - } else if(this.deleteForm) { - console.log("[FormComponent.host] deleteForm start"); - if(this.deleteId == "self") { - this.deleteId = this.formId.toString(); - } - setTimeout(() => { - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent] deleteForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .catch((error) => { - console.info('[FormComponent] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - console.log("[FormComponent.host] deleteForm end"); - }, 1000); - } else { - let commonEventPublishData = { - data: this.formId.toString() - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - // .onUninstall((info) => { - // console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); - // }) - .onError((error) => { - console.log("[FormComponent.host] error code:" + error.errcode); - console.log("[FormComponent.host] error msg:" + error.msg); - if(this.deleteForm && this.deleteId) { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } else { - let commonEventPublishData = { - data: error.msg - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/BUILD.gn deleted file mode 100644 index d9128314a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostC") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostC" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json deleted file mode 100644 index ce18d9ac8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhostc", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhostc", - "name": ".FormStHostAppC", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormCast_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_TimeChange_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent" - }, - { - "name": "FMS_FormCast_commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "name": "FMS_TimeChange_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.REQUIRE_FORM" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f49f9bd10..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.host] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.host] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/element/string.json deleted file mode 100644 index c09b6a139..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostC" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index f511c9847..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private releaseForm = false; - private releaseId = "-1"; - private deleteForm = false; - private deleteId = "-1"; - private temporaryId="-1"; - private temporary = false; - private castForm = false; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formCastEvent = "FMS_FormCast_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; - private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private publishOnErrorCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc formOnErrorEventCallBack ====>"); - } - private publishOnDeletedCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc publishOnDeletedCallBack ====>"); - } - private publishOnReleasedCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc publishOnReleasedCallBackk ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>"); - } - private publishCastCallBack() { - console.debug("====>formsystemhostc formCastEventCallBack ====>"); - } - - private deleteCallBack(err, data) { - console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); - if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostd") { - return; - } - formManager.deleteForm(data.data) - .then((data2) => { - console.info('[FormComponent] deleteForm result:' + data2); - }); - - this.canCreateForm = false; - console.info("!!!====>formsystemhost deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); - }) - - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if(want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if(want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if(want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if(!this.dimension) { - this.dimension = FormDimension.Dimension_1_2; - } - if(want.parameters.castForm) { - this.castForm = want.parameters.castForm; - } - if(want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if(want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if(want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - if(want.parameters.releaseForm) { - this.releaseForm = want.parameters.releaseForm; - } - if(want.parameters.releaseId) { - this.releaseId = want.parameters.releaseId; - } - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end'+ JSON.stringify(want)); - - if(!want.parameters.isCreate && this.deleteForm) { - console.log("formsystemhost deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('formsystemhost deleteForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }) - .catch((error) => { - console.info('formsystemhost deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }); - - console.log("formsystemhost deleteForm end"); - } - - if(!want.parameters.isCreate && this.releaseForm) { - console.log("formsystemhost releaseForm start"); - formManager.releaseForm(this.releaseId) - .then((data) => { - console.info('formsystemhost releaseForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); - }) - .catch((error) => { - console.info('formsystemhost releaseForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); - }); - - console.log("formsystemhost releaseForm end"); - } - - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.log(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.log("[FormComponent.host] get form, form id:" + form.id); - this.formId = form.id; - if(this.castForm) { - console.log("[FormComponent.host] castTempForm start"); - formManager.castTempForm(this.temporaryId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - setTimeout(() => { - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error); - setTimeout(() => { - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }); - console.log("[FormComponent.host] castTempForm end"); - } else if(this.deleteForm) { - console.log("[FormComponent.host] deleteForm start"); - if(this.deleteId == "self") { - this.deleteId = this.formId.toString(); - } - setTimeout(() => { - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent] deleteForm result:' + data); - var commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }) - .catch((error) => { - console.info('formsystemhost deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }); - - console.log("[FormComponent.host] deleteForm end"); - }, 1000); - } else if(this.releaseForm) { - console.log("[FormComponent.host] releaseForm start"); - if(this.releaseId == "self") { - this.releaseId = this.formId.toString(); - } - setTimeout(() => { - formManager.releaseForm(this.releaseId) - .then((data) => { - console.info('[FormComponent] releaseForm result:' + data); - let retData = "-1"; - if(data == 0) { - retData = data.toString(); - } - var commonEventPublishData = { - data: retData, - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); - }); - - console.log("[FormComponent.host] releaseForm end"); - }, 1000); - } else { - var commonEventPublishData = { - data: this.formId.toString() - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - // .onUninstall((info) => { - // console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); - // }) - .onError((error) => { - console.log("[FormComponent.host] error code:" + error.errcode); - console.log("[FormComponent.host] error msg:" + error.msg); - if(this.deleteForm && this.deleteId) { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - } else { - let commonEventPublishData = { - data: error.msg - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 4471833c6..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from '@ohos.ability.featureAbility'; -import formManager from '@ohos.application.formHost'; -import formProvider from '@ohos.application.formProvider'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private requestForm = false; - private requestId = "-1"; - private refreshForm = false; - private refreshId = "-1"; - private refreshTime = 5; - private notifyVisibleForms = false; - private notifyVisibleId = "-1"; - private deleteForm = false; - private deleteId = "-1"; - private temporaryId = "-1"; - private temporary = false; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; - private formOnDynamicRefreshEvent = "FMS_FormDynamicRefresh_commonEvent"; - private formOnRequestEvent = "FMS_FormOnRequest_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private publishOnErrorCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc formOnErrorEventCallBack ====>"); - } - private publishOnDeletedCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc publishOnDeletedCallBack ====>"); - } - private formOnDynamicRefreshCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc formOnDynamicRefreshEventk ====>"); - } - private formOnRequestCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc formOnRequestCallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>"); - } - - private deleteCallBack(err, data) { - console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); - if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") { - return; - } - formManager.deleteForm(data.data) - .then((data2) => { - console.info('[FormComponent] deleteForm result:' + data2); - }); - - this.canCreateForm = false; - console.info("!!!====>formsystemhost deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); - }) - - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if (want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if (want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if (want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if (!this.dimension) { - this.dimension = FormDimension.Dimension_1_2; - } - if (want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if (want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if (want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - if (want.parameters.refreshForm) { - this.refreshForm = want.parameters.refreshForm; - } - if (want.parameters.refreshId) { - this.refreshId = want.parameters.refreshId; - } - if (want.parameters.refreshTime) { - this.refreshTime = want.parameters.refreshTime; - } - if (want.parameters.requestForm) { - this.requestForm = want.parameters.requestForm; - } - if (want.parameters.requestId) { - this.requestId = want.parameters.requestId; - } - if (want.parameters.notifyVisibleForms) { - this.notifyVisibleForms = want.parameters.notifyVisibleForms; - } - if (want.parameters.notifyVisibleId) { - this.notifyVisibleId = want.parameters.notifyVisibleId; - } - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:' + this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end' + JSON.stringify(want)); - - if (!want.parameters.isCreate && this.deleteForm) { - console.log("formsystemhost deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('formsystemhost deleteForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }) - .catch((error) => { - console.info('formsystemhost deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }); - - console.log("formsystemhost deleteForm end"); - } - if (!want.parameters.isCreate && this.refreshForm) { - console.log("formsystemhost refreshForm start"); - formProvider.setFormNextRefreshTime(this.refreshId, this.refreshTime) - .then((data) => { - console.info('formsystemhost refreshForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId": this.refreshId.toString() - } - }; - commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); - }) - .catch((error) => { - console.info('formsystemhost refreshForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.refreshId.toString() - } - }; - commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); - }); - - console.log("formsystemhost deleteForm end"); - } - if (!want.parameters.isCreate && this.requestForm) { - console.log("[FormComponent.host] requestForm start"); - formManager.requestForm(this.requestId) - .then((data) => { - console.info('[FormComponent] requestForm result:' + data); - var commonEventPublishData = { - data: "0", - parameters: { - "formId": this.requestId - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.formOnRequestCallBack); - }) - .catch((error) => { - console.info('[FormComponent] requestForm error:' + error.toString()); - var commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.requestId - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.formOnRequestCallBack); - }); - - console.log("[FormComponent.host] requestForm end"); - } - - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.log(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.log("[FormComponent.host] get form, form id:" + form.id); - this.formId = form.id; - if (this.deleteForm) { - console.log("[FormComponent.host] deleteForm start"); - if (this.deleteId == "self") { - this.deleteId = this.formId.toString(); - } - setTimeout(() => { - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent] deleteForm result:' + data); - var commonEventPublishData = { - data: "0", - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }) - .catch((error) => { - console.info('formsystemhost deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }); - - console.log("[FormComponent.host] deleteForm end"); - }, 1000); - } else if (this.requestForm) { - console.log("[FormComponent.host] requestForm start"); - if (this.requestId == "self") { - this.requestId = this.formId.toString(); - } - setTimeout(() => { - formManager.requestForm(this.requestId) - .then((data) => { - console.info('[FormComponent] requestForm result:' + data); - var delFormId = this.requestId; - if (this.requestId == "0" || this.requestId == "-1") { - delFormId = this.formId.toString(); - } - var commonEventPublishData = { - data: "0", - parameters: { - "formId": delFormId - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.formOnRequestCallBack); - }) - .catch((error) => { - console.info('[FormComponent] requestForm error:' + error); - var delFormId = this.requestId; - if (this.requestId == "0" || this.requestId == "-1") { - delFormId = this.formId.toString(); - } - var commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": delFormId - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.formOnRequestCallBack); - }); - - console.log("[FormComponent.host] requestForm end"); - }, 1000); - } else if (this.refreshForm) { - console.log("formsystemhost refreshForm start"); - if (this.refreshId == "self") { - this.refreshId = this.formId.toString(); - } - setTimeout(() => { - formProvider.setFormNextRefreshTime(this.refreshId, this.refreshTime) - .then((data) => { - console.info('formsystemhost refreshForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId": this.refreshId.toString() - } - }; - commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); - }) - .catch((error) => { - console.info('formsystemhost refreshForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.refreshId.toString() - } - }; - commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); - }); - }, 1000); - } else if (this.notifyVisibleForms) { - console.log("formsystemhost notifyVisibleForms start"); - if (this.notifyVisibleId == "self") { - this.notifyVisibleId = this.formId.toString(); - } - setTimeout(() => { - formManager.notifyVisibleForms([this.notifyVisibleId]) - .then((data) => { - console.info('formsystemhost notifyVisibleForms result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId": this.notifyVisibleId.toString() - } - }; - }) - .catch((error) => { - console.info('formsystemhost notifyVisibleForms error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.notifyVisibleId.toString() - } - }; - }); - }, 1000); - } else { - var commonEventPublishData = { - data: this.formId.toString() - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onUninstall((info) => { - console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); - }) - .onError((error) => { - console.log("[FormComponent.host] error code:" + error.errcode); - console.log("[FormComponent.host] error msg:" + error.msg); - if (this.deleteForm && this.deleteId) { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId": this.formId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - } else { - let commonEventPublishData = { - data: error.msg - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/BUILD.gn deleted file mode 100644 index e8de20fcd..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostF") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostF" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json deleted file mode 100644 index c732ef257..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhostf", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhostf", - "name": ".FormStHostAppF", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormUpdateRefresh_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "name": "FMS_FormUpdateRefresh_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.REQUIRE_FORM" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f49f9bd10..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.host] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.host] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 02404decc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from '@ohos.ability.featureAbility'; -import formBindingData from '@ohos.application.formBindingData'; -import formManager from '@ohos.application.formHost'; -import formProvider from '@ohos.application.formProvider'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private updateForm = false; - private updateId = "-1"; - private jsonEmpty = false; - private releaseForm = false; - private releaseId = "-1"; - private deleteForm = false; - private deleteId = "-1"; - private temporaryId="-1"; - private temporary = false; - - private isStartOtherApp = false; - private otherAppState = "visible"; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; - private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent"; - private formOnUpdatedEvent = "FMS_FormUpdateRefresh_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private publishOnErrorCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc formOnErrorEventCallBack ====>"); - } - private publishOnDeletedCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc publishOnDeletedCallBack ====>"); - } - private publishOnReleasedCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc publishOnReleasedCallBackk ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>"); - } - private publishOnUpdatedCallBack() { - this.canCreateForm = false; - console.debug("====>formsystemhostc publishOnUpdatedCallBack ====>"); - } - private deleteCallBack(err, data) { - console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); - if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostf") { - return; - } - formManager.deleteForm(data.data) - .then((data2) => { - console.info('[FormComponent] deleteForm result:' + data2); - }); - - this.canCreateForm = false; - console.info("!!!====>formsystemhost deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); - }) - - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if(want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if(want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if(want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if(!this.dimension) { - this.dimension = FormDimension.Dimension_1_2; - } - if(want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if(want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if(want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - if(want.parameters.releaseForm) { - this.releaseForm = want.parameters.releaseForm; - } - if(want.parameters.releaseId) { - this.releaseId = want.parameters.releaseId; - } - if(want.parameters.updateForm) { - this.updateForm = want.parameters.updateForm; - } - if(want.parameters.updateId) { - this.updateId = want.parameters.updateId; - } - if(want.parameters.jsonEmpty) { - this.jsonEmpty = want.parameters.jsonEmpty; - } - if(want.parameters.isStartOtherApp) { - this.isStartOtherApp = true; - if(want.parameters.otherAppState) { - this.otherAppState = want.parameters.otherAppState; - } - } - - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end'+ JSON.stringify(want)); - - if(!want.parameters.isCreate && this.deleteForm) { - console.log("formsystemhost deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('formsystemhost deleteForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }) - .catch((error) => { - console.info('formsystemhost deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }); - - console.log("formsystemhost deleteForm end"); - } - - if(!want.parameters.isCreate && this.releaseForm) { - console.log("formsystemhost releaseForm start"); - formManager.releaseForm(this.releaseId) - .then((data) => { - console.info('formsystemhost releaseForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); - }) - .catch((error) => { - console.info('formsystemhost releaseForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); - }); - - console.log("formsystemhost releaseForm end"); - } - - if(!want.parameters.isCreate && this.updateForm) { - console.log("formsystemhost updateForm start"); - let formData = { - temperature: "11°", - time: "11:00", - area: "Shenyang", - epidemic: true, - count: 10 - }; - if(this.jsonEmpty) { - formData = {}; - } - let bindingData = formBindingData.createFormBindingData(formData); - formProvider.updateForm(this.updateId, bindingData) - .then((data) => { - console.info('formsystemhost updateForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId" : this.updateId - } - }; - commonEvent.publish(this.formOnUpdatedEvent, commonEventPublishData, this.publishOnUpdatedCallBack); - }) - .catch((error) => { - console.info('formsystemhost updateForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.updateId - } - }; - commonEvent.publish(this.formOnUpdatedEvent, commonEventPublishData, this.publishOnUpdatedCallBack); - }); - - console.log("formsystemhost releaseForm end"); - } - - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.log(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.log("[FormComponent.host] get form, form id:" + form.id); - this.formId = form.id; - if(this.deleteForm) { - console.log("[FormComponent.host] deleteForm start"); - if(this.deleteId == "self") { - this.deleteId = this.formId.toString(); - } - setTimeout(() => { - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent] deleteForm result:' + data); - var commonEventPublishData = { - data: "0", - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }) - .catch((error) => { - console.info('formsystemhost deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }); - console.log("[FormComponent.host] deleteForm end"); - }, 500); - } else if(this.releaseForm) { - console.log("[FormComponent.host] releaseForm start"); - if(this.releaseId == "self") { - this.releaseId = this.formId.toString(); - } - setTimeout(() => { - formManager.releaseForm(this.releaseId) - .then((data) => { - console.info('[FormComponent] releaseForm result:' + data); - var commonEventPublishData = { - data: "0", - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); - }) - .catch((error) => { - console.info('formsystemhost releaseForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); - }); - - console.log("[FormComponent.host] releaseForm end"); - }, 500); - } else if (this.updateForm) { - console.log("formsystemhost updateForm start"); - let formData = { - temperature: "11°", - time: "11:00", - area: "Shenyang", - epidemic: true, - count: 10 - }; - if(this.jsonEmpty) { - formData = {}; - } - let bindingData = formBindingData.createFormBindingData(formData); - formProvider.updateForm(this.updateId, bindingData) - .then((data) => { - console.info('formsystemhost updateForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId" : this.updateId - } - }; - commonEvent.publish(this.formOnUpdatedEvent, commonEventPublishData, this.publishOnUpdatedCallBack); - }) - .catch((error) => { - console.info('formsystemhost updateForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.updateId - } - }; - commonEvent.publish(this.formOnUpdatedEvent, commonEventPublishData, this.publishOnUpdatedCallBack); - }); - - console.log("formsystemhost releaseForm end"); - } else if (this.isStartOtherApp) { - console.log("formsystemhost app G start"); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : this.otherAppState, - "stateIds" : [this.formId.toString()], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`formsystemhost featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`formsystemhost featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - } else { - var commonEventPublishData = { - data: this.formId.toString() - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - // .onUninstall((info) => { - // console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); - // }) - .onError((error) => { - console.log("[FormComponent.host] error code:" + error.errcode); - console.log("[FormComponent.host] error msg:" + error.msg); - if(this.deleteForm && this.deleteId) { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - } else { - let commonEventPublishData = { - data: error.msg - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/element/string.json deleted file mode 100644 index c882f827a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostF" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/BUILD.gn deleted file mode 100644 index a4cec6e6f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostG") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostG" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json deleted file mode 100644 index 4b94f7326..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhostg", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhostg", - "name": ".FormStHostAppG", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnState_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "name": "FMS_FormOnState_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.REQUIRE_FORM" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f49f9bd10..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.host] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.host] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 411f282e3..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,502 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private stateForm = "visible"; - private doStateForm = false; - private stateIds = []; - private deleteForm = false; - private deleteId = "-1"; - private temporaryId="-1"; - private temporary = false; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; - private formOnStateEvent = "FMS_FormOnState_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private publishOnErrorCallBack() { - this.canCreateForm = false; - console.debug("====>[FormComponent.host] formOnErrorEventCallBack ====>"); - } - private publishOnDeletedCallBack() { - this.canCreateForm = false; - console.debug("====>[FormComponent.host] publishOnDeletedCallBack ====>"); - } - private publishOnStateCallBack() { - this.canCreateForm = false; - console.debug("====>[FormComponent.host] publishOnStateCallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====>[FormComponent.host] formOnAcquiredEventCallBack ====>"); - } - private deleteCallBack(err, data) { - console.info("!!!====>[FormComponent.host] deleteCallBack start:====>" + JSON.stringify(data)); - if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostg") { - return; - } - formManager.deleteForm(data.data) - .then((data2) => { - console.info('[FormComponent] deleteForm result:' + data2); - }); - - this.canCreateForm = false; - console.info("!!!====>[FormComponent.host] deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>[FormComponent.host] Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); - }) - - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if(want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if(want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if(want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if(!this.dimension) { - this.dimension = FormDimension.Dimension_1_2; - } - if(want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if(want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if(want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - if(want.parameters.stateForm) { - this.stateForm = want.parameters.stateForm; - this.doStateForm = true; - } - if(want.parameters.stateIds) { - this.stateIds = want.parameters.stateIds; - } - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end'+ JSON.stringify(want)); - - if(!want.parameters.isCreate && this.deleteForm) { - console.log("[FormComponent.host] deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent.host] deleteForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId" : this.deleteId; - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId; - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }); - - console.log("[FormComponent.host] deleteForm end"); - } - - if(!want.parameters.isCreate && this.stateForm) { - if(this.stateForm == "visible") { - console.log("[FormComponent.host] notifyVisibleForm start"); - formManager.notifyVisibleForms(this.stateIds) - .then((data) => { - console.info('[FormComponent.host] notifyVisibleForm result:' + data); - console.info('[FormComponent.host] notifyVisibleForm formId:' + this.stateIds[0]); - let commonEventPublishData = { - data: "0", - parameters: { - "kind": "visible", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] notifyVisibleForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "kind": "visible", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }); - console.log("[FormComponent.host] notifyVisibleForm end"); - } else if(this.stateForm == "invisible") { - console.log("[FormComponent.host] notifyInvisibleForm start"); - formManager.notifyInvisibleForms(this.stateIds) - .then((data) => { - console.info('[FormComponent.host] notifyInvisibleForm result:' + data); - console.info('[FormComponent.host] notifyInvisibleForm formId:' + this.stateIds[0]); - let commonEventPublishData = { - data: "0", - parameters: { - "kind": "invisible", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] notifyInvisibleForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "kind": "invisible", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }); - console.log("[FormComponent.host] notifyInvisibleForm end"); - } else if(this.stateForm == "enable") { - console.log("[FormComponent.host] enableFormsUpdate start"); - formManager.enableFormsUpdate(this.stateIds) - .then((data) => { - console.info('[FormComponent.host] enableFormsUpdate result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "kind": "enable", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] enableFormsUpdate error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "kind": "enable", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }); - console.log("[FormComponent.host] enableFormsUpdate end"); - } else { - console.log("[FormComponent.host] disableFormsUpdate start"); - formManager.disableFormsUpdate(this.stateIds) - .then((data) => { - console.info('[FormComponent.host] disableFormsUpdate result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "kind": "disable", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] disableFormsUpdate error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "kind": "disable", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }); - console.log("[FormComponent.host] disableFormsUpdate end"); - } - } - - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.log(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.log("[FormComponent.host] get form, form id:" + form.id); - this.formId = form.id; - if(this.deleteForm) { - console.log("[FormComponent.host] deleteForm start"); - if(this.deleteId == "self") { - this.deleteId = this.formId.toString(); - } - setTimeout(() => { - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent] deleteForm result:' + data); - let commonEventPublishData = { - data: "0", - parameters: { - "formId" : this.deleteId; - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - }); - - console.log("[FormComponent.host] deleteForm end"); - }, 500); - } else if(this.doStateForm) { - console.log("[FormComponent.host] state start"); - if((this.stateIds.length != 0) && (this.stateIds[0] == "self")) { - this.stateIds = [this.formId.toString()]; - } - console.info('[FormComponent.host] notifyVisibleForm stateIds:' + this.stateIds); - setTimeout(() => { - if(this.stateForm == "visible") { - console.log("[FormComponent.host] notifyVisibleForm start"); - formManager.notifyVisibleForms(this.stateIds) - .then((data) => { - console.info('[FormComponent.host] notifyVisibleForm result:' + data); - console.info('[FormComponent.host] notifyVisibleForm formId:' + this.stateIds[0]); - if(this.stateIds.length == 0) { - this.stateIds = ["-1"]; - } - let commonEventPublishData = { - data: "0", - parameters: { - "kind": "visible", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] notifyVisibleForm error:' + error); - if(this.stateIds.length == 0) { - this.stateIds = ["-1"]; - } - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "kind": "visible", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }); - console.log("[FormComponent.host] notifyVisibleForm end"); - } else if(this.stateForm == "invisible") { - console.log("[FormComponent.host] notifyInvisibleForm start"); - formManager.notifyInvisibleForms(this.stateIds) - .then((data) => { - console.info('[FormComponent.host] notifyInvisibleForm result:' + data); - if(this.stateIds.length == 0) { - this.stateIds = ["-1"]; - } - console.info('[FormComponent.host] notifyInvisibleForm formId:' + this.stateIds[0]); - let commonEventPublishData = { - data: "0", - parameters: { - "kind": "invisible", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] notifyInvisibleForm error:' + error.code); - if(this.stateIds.length == 0) { - this.stateIds = ["-1"]; - } - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "kind": "invisible", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }); - console.log("[FormComponent.host] notifyInvisibleForm end"); - } else if(this.stateForm == "enable") { - console.log("[FormComponent.host] enableFormsUpdate start"); - formManager.enableFormsUpdate(this.stateIds) - .then((data) => { - console.info('[FormComponent.host] enableFormsUpdate result:' + data); - if(this.stateIds.length == 0) { - this.stateIds = ["-1"]; - } - let commonEventPublishData = { - data: "0", - parameters: { - "kind": "enable", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] enableFormsUpdate error:' + error); - if(this.stateIds.length == 0) { - this.stateIds = ["-1"]; - } - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "kind": "enable", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }); - console.log("[FormComponent.host] enableFormsUpdate end"); - } else { - console.log("[FormComponent.host] disableFormsUpdate start"); - formManager.disableFormsUpdate(this.stateIds) - .then((data) => { - console.info('[FormComponent.host] disableFormsUpdate result:' + data); - if(this.stateIds.length == 0) { - this.stateIds = ["-1"]; - } - let commonEventPublishData = { - data: "0", - parameters: { - "kind": "disable", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }) - .catch((error) => { - console.info('[FormComponent.host] disableFormsUpdate error:' + error); - if(this.stateIds.length == 0) { - this.stateIds = ["-1"]; - } - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "kind": "disable", - "formId" : this.stateIds[0] - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); - }); - console.log("[FormComponent.host] disableFormsUpdate end"); - } - }, 1000); - } else { - let commonEventPublishData = { - data: this.formId.toString(), - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onUninstall((info) => { - console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); - }) - .onError((error) => { - console.log("[FormComponent.host] error code:" + error.errcode); - console.log("[FormComponent.host] error msg:" + error.msg); - if(this.deleteForm && this.deleteId) { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); - } else { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId" : "-1" - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 6599b743b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostG" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 14318ae2d..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - - private dimension: FormDimension = FormDimension.Dimension_1_2; - private deleteForm = false; - private deleteId = "-1"; - private temporaryId = "-1"; - private temporary = false; - private castForm = false; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formCastEvent = "FMS_FormCast_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private publishOnErrorCallBack() { - this.canCreateForm = false; - console.info("====>formOnErrorEvent Publish CallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.info("====>formOnAcquiredEvent Publish CallBack ====>"); - } - private publishCastCallBack() { - console.info("====>formCastEvent Publish CallBack ====>"); - } - - private deleteCallBack(err, data) { - console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); - if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") { - return; - } - formManager.deleteForm(data.data) - .then((data2) => { - console.info('[FormComponent] deleteForm result:' + data2); - }); - - this.canCreateForm = false; - console.info("!!!====>formsystemhost deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); - }) - - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if (want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if (want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if (want.parameters.castForm) { - this.castForm = want.parameters.castForm; - } - if (want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if (want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if (want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if (want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:' + this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end' + JSON.stringify(want)); - - if (!want.parameters.isCreate && this.deleteForm) { - console.info("formsystemhost deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('formsystemhost deleteForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .catch((error) => { - console.info('[FormComponent] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - console.info("formsystemhost deleteForm end"); - } - if (!want.parameters.isCreate && this.castForm) { - console.info("[FormComponent.host] castTempForm start"); - formManager.castTempForm(this.temporaryId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - setTimeout(() => { - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId": this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error); - setTimeout(() => { - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }); - console.info("[FormComponent.host] castTempForm end"); - } - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.info(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info("[FormComponent.host] get form, form id:" + form.id); - this.formId = form.id; - if (this.castForm) { - console.info("[FormComponent.host] castTempForm start"); - formManager.castTempForm(this.temporaryId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - setTimeout(() => { - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId": this.formId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error); - setTimeout(() => { - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }); - console.info("[FormComponent.host] castTempForm end"); - } else if (this.deleteForm) { - console.info("[FormComponent.host] deleteForm start"); - if (this.deleteId == "self") { - this.deleteId = this.formId.toString(); - } - setTimeout(() => { - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent] deleteForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .catch((error) => { - console.info('[FormComponent] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - - console.info("[FormComponent.host] deleteForm end"); - }, 1000); - } else { - let commonEventPublishData = { - data: this.formId.toString(), - parameters: { - "formId": this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onUninstall((info) => { - console.info("[FormComponent] onUninstall:" + JSON.stringify(info)); - }) - .onError((error) => { - console.info("[FormComponent.host] error code:" + error.errcode); - console.info("[FormComponent.host] error msg:" + error.msg); - if (this.deleteForm && this.deleteId) { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId": this.formId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } else { - let commonEventPublishData = { - data: error.msg - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index bd7874c1a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private deleteForm = false; - private deleteId = "-1"; - private temporaryId="-1"; - private temporary = false; - private castForm = false; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formCastEvent = "FMS_FormCast_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private publishOnErrorCallBack() { - this.canCreateForm = false; - console.debug("====>formOnErrorEvent Publish CallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====>formOnAcquiredEvent Publish CallBack ====>"); - } - private publishCastCallBack() { - console.debug("====>formCastEvent Publish CallBack ====>"); - } - - private deleteCallBack(err, data) { - console.info("!!!====>formsystemhostj deleteCallBack start:====>" + JSON.stringify(data)); - if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostj") { - return; - } - formManager.deleteForm(data.data) - .then((data2) => { - console.info('[FormComponent] deleteForm result:' + data2); - }); - - this.canCreateForm = false; - console.info("!!!====>formsystemhostj deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>formsystemhostj Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); - }) - - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - this.moduleName = want.parameters.moduleName; - if(want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - console.log("formsystemhostj dimension1:" + this.dimension); - if(want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - console.log("formsystemhostj dimension2:" + this.dimension); - if(want.parameters.castForm) { - this.castForm = want.parameters.castForm; - } - if(want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if(want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if(want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end'+ JSON.stringify(want)); - - if(!want.parameters.isCreate && this.deleteForm) { - console.log("formsystemhostj deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('formsystemhostj deleteForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .catch((error) => { - console.info('[FormComponent] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - console.log("formsystemhostj deleteForm end"); - } - if(!want.parameters.isCreate && this.castForm) { - console.log("[FormComponent.host] castTempForm start"); - formManager.castTempForm(this.temporaryId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - setTimeout(() => { - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error); - setTimeout(() => { - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }); - console.log("[FormComponent.host] castTempForm end"); - } - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.log(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.log("[FormComponent.host] get form, form id:" + form.id); - this.formId = form.id; - if(this.castForm) { - console.log("[FormComponent.host] castTempForm start"); - formManager.castTempForm(this.temporaryId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - setTimeout(() => { - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error); - setTimeout(() => { - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.temporaryId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }, 5); - }); - console.log("[FormComponent.host] castTempForm end"); - } else if(this.deleteForm) { - console.log("[FormComponent.host] deleteForm start"); - if(this.deleteId == "self") { - this.deleteId = this.formId.toString(); - } - setTimeout(() => { - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('[FormComponent] deleteForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .catch((error) => { - console.info('[FormComponent] deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - - console.log("[FormComponent.host] deleteForm end"); - }, 1000); - } else { - let commonEventPublishData = { - data: this.formId.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - // .onUninstall((info) => { - // console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); - // }) - .onError((error) => { - console.log("[FormComponent.host] error code:" + error.errcode); - console.log("[FormComponent.host] error msg:" + error.msg); - if(this.deleteForm && this.deleteId) { - let commonEventPublishData = { - data: error.msg, - parameters: { - "formId" : this.formId.toString() - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } else { - let commonEventPublishData = { - data: error.msg - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - } - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/BUILD.gn deleted file mode 100644 index b08ce13e9..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostK") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostK" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json deleted file mode 100644 index 8cb2ede4c..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhostk", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhostk", - "name": ".FormStHostAppK", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnCast_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormTerminate_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnRequest_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnReleased_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent" - }, - { - "name": "FMS_FormOnCast_commonEvent" - }, - { - "name": "FMS_FormTerminate_commonEvent" - }, - { - "name": "FMS_FormOnRequest_commonEvent" - }, - { - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.REQUIRE_FORM" - }, - { - "name": "fms.time_speed" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 5c749e5e1..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.hostk] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.hostk] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 2331e063d..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,609 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import formHost from '@ohos.application.formHost'; -import commonEvent from '@ohos.commonEvent'; -import { getCurrentTime } from '@ohos.systemTime'; - -// @ts-nocheck -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = `com.form.formsystemtestservicea.hmservice`; - @State ability: string = `com.form.formsystemtestservicea.hmservice.MainAbility`; - @State moduleName: string = `entry`; - @State name: string = `Form_Js001`; - @State canCreateForm: boolean = false; - @State allowUpdate: boolean = true; - @State isShowing: boolean = true; - @State dimension: FormDimension = FormDimension.Dimension_1_2; - @State temporary: boolean = false; - private requestForm = false; - private requestId = `-1`; - private temporaryId = `-1`; - private deleteForm = false; - private deleteId = `-1`; - private castTempForm = false; - private notifyVisibility = false; - private notifyVisibleForms = false; - private notifyInvisibleForms = false; - private releaseForm = false; - private releaseId = "-1"; - private update = false; - private enableUpdate = false; - private disableUpdate = false; - private isVisible = false; - private castForm = false; - private tempFormId = 0; - private createTempAndNormal = false; - private tempParam = {}; - private createSecondForm = false; - private secondParam = {}; - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"] - }; - private subscriberFormTerminateEvent = { - events: ["FMS_FormTerminate_commonEvent"] - }; - private TAG = `[FormComponent.hostk]`; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formOnRequestEvent = "FMS_FormOnRequest_commonEvent"; - private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; - private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent"; - - private onAcquiredCallback() { - console.info(`${this.TAG} onAcquiredCallback`); - } - - private onRequestCallback() { - console.info(`====>${this.TAG} onRequestCallback====>`); - } - - private onDeletedCallback() { - console.info(`${this.TAG} onDeletedCallback`); - } - - private onReleasedCallback() { - console.info(`====>${this.TAG} onReleasedCallback====>`); - } - - private unsubscribeDeleteCallback() { - console.info(`${this.TAG} unSubscribeDeleteCallback`); - } - - async private aboutToAppear() { - const onDeleteEventSubscriber = await commonEvent.createSubscriber(this.subscriberFormDeleteEvent); - const onTerminateEventSubscriber = await commonEvent.createSubscriber(this.subscriberFormTerminateEvent); - commonEvent.subscribe(onDeleteEventSubscriber, async (err, data) => { - const formIds = data.parameters.formIds; - console.info(`${this.TAG} deleteCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${this.TAG} deleteCallback formIds: ${JSON.stringify(formIds)}`); - - commonEvent.unsubscribe(onDeleteEventSubscriber, () => this.unsubscribeDeleteCallback()); - let deletedFormAmount = 0; - if (formIds.length == 0) { - return; - } - formIds.forEach(async (formId, index) => { - try { - const res = await formHost.deleteForm(formId); - ++deletedFormAmount; - console.info(`${this.TAG} deleteForm${index} result: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${this.TAG} deleteForm${index} error: ${JSON.stringify(error)}`); - } - - if (index >= formIds.length - 1) { - const commonEventPublishData = { - parameters: { - deletedFormAmount: deletedFormAmount, - formIds: [].concat(data.parameters.formIds) - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, () => this.onDeletedCallback()); - console.info(`${this.TAG} deleteCallback end, deletedFormAmount ${deletedFormAmount}`); - } - }); - }); - - featureAbility.getWant() - .then(async (want: any) => { - console.info(`${this.TAG} ===> getWant: ${JSON.stringify(want)}`); - this.formId = want.parameters.formId; - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if (want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if (want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if (want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if (want.parameters.castForm) { - this.castForm = want.parameters.castForm; - } - if (want.parameters.temporaryId) { - this.temporaryId = want.parameters.temporaryId; - } - if (want.parameters.requestForm) { - this.requestForm = want.parameters.requestForm; - } - if (want.parameters.requestId) { - this.requestId = want.parameters.requestId; - } - if (want.parameters.createSecondForm) { - this.createSecondForm = want.parameters.createSecondForm; - this.secondParam = want.parameters.secondParam; - } - if (want.parameters.createTempAndNormal) { - this.createTempAndNormal = want.parameters.createTempAndNormal; - this.tempParam = want.parameters.tempParam; - } - if (want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if (want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - if (want.parameters.castTempForm) { - this.castTempForm = want.parameters.castTempForm; - } - if (want.parameters.notifyVisibility) { - this.notifyVisibility = want.parameters.notifyVisibility; - } - if (want.parameters.notifyVisibleForms) { - this.notifyVisibleForms = want.parameters.notifyVisibleForms; - } - if (want.parameters.notifyInvisibleForms) { - this.notifyInvisibleForms = want.parameters.notifyInvisibleForms; - } - if (want.parameters.releaseForm) { - this.releaseForm = want.parameters.releaseForm; - } - if (want.parameters.releaseId) { - this.releaseId = want.parameters.releaseId; - } - if (want.parameters.update) { - this.update = want.parameters.update; - } - if (want.parameters.enableUpdate) { - this.enableUpdate = want.parameters.enableUpdate; - } - if (want.parameters.disableUpdate) { - this.disableUpdate = want.parameters.disableUpdate; - } - if (want.parameters.subscribeTerminate) { - commonEvent.subscribe(onTerminateEventSubscriber, async (err, data) => { - console.info(`${this.TAG} onTerminateCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - commonEvent.unsubscribe(onTerminateEventSubscriber, () => { }); - console.info(`${this.TAG} onTerminateCallback end`); - setTimeout(async () => { - // terminate self - featureAbility.terminateSelf(); - console.info(`${this.TAG} featureAbility.terminateSelf`); - }, 1000); - }); - } - if (want.parameters.isCreate) { - this.canCreateForm = want.parameters.isCreate; - } - - if (!want.parameters.isCreate && this.deleteForm) { - console.log(`${this.TAG} deleteForm start`); - formHost.deleteForm(this.deleteId) - .then((data) => { - console.info(`${this.TAG} deleteForm result: ${JSON.stringify(data)}`); - let commonEventPublishData = { - data: data || `0`, - parameters: { - "formId": this.deleteId - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.onDeletedCallback); - }) - .catch((error) => { - console.info(`${this.TAG} deleteForm error: ${JSON.stringify(error)}`); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.deleteId - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.onDeletedCallback); - }); - } - - if (!want.parameters.isCreate && this.releaseForm) { - console.log(`${this.TAG} releaseForm start`); - formHost.releaseForm(this.releaseId, true) - .then((data) => { - console.info(`${this.TAG} releaseForm result: ${JSON.stringify(data)}`); - let commonEventPublishData = { - data: data || `0`, - parameters: { - "formId": this.releaseId - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.onReleasedCallback); - }) - .catch((error) => { - console.info(`${this.TAG} releaseForm error: ${JSON.stringify(error)}`); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId": this.releaseId - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.onReleasedCallback); - }); - } - - if (!this.canCreateForm && this.requestForm) { - let commonEventPublishData; - formHost.requestForm(this.requestId) - .then((data) => { - console.info(`${this.TAG} requestForm result: ${JSON.stringify(data)}`); - commonEventPublishData = { - data: data || `0`, - parameters: { - "formId": this.requestId - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.onRequestCallback); - }) - .catch((error) => { - console.info(`${this.TAG} requestForm error: ${JSON.stringify(error)}`); - commonEventPublishData = { - parameters: { - "error": error - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.onRequestCallback); - }); - } - }) - .catch((error: any) => { - console.error(`${this.TAG} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Column() { - Text(`form component test begin`) - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpdate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired(async (form) => { - const createdTime = await getCurrentTime(); - this.formId = form.id; - console.info(`${this.TAG} get form, form id: ${form.id}`); - if (this.deleteForm) { - try { - const startTime = await getCurrentTime(); - const res = await formHost.deleteForm(this.formId); - const endTime = await getCurrentTime(); - console.info(`${this.TAG} deleteForm result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `deleteForm`, - formId: this.formId, - startTime: startTime, - hostTime: endTime - startTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.formOnAcquiredEvent()); - } catch (error) { - console.info(`${this.TAG} deleteForm error: ${JSON.stringify(error)}`); - } - } else if (this.castTempForm) { - try { - const startTime = await getCurrentTime(); - const res = await formHost.castTempForm(this.formId); - const endTime = await getCurrentTime(); - console.info(`${this.TAG} castTempForm result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `castTempForm`, - formId: this.formId, - startTime: startTime, - hostTime: endTime - startTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.formOnAcquiredEvent()); - } catch (error) { - console.info(`${this.TAG} castTempForm error: ${JSON.stringify(error)}`); - } - } else if (this.notifyVisibility) { - try { - const res = await formHost.notifyVisibleForms([this.formId]); - console.info(`${this.TAG} notifyVisibleForms result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `notifyVisibleForms`, - formId: this.formId, - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.formOnAcquiredEvent()); - } catch (error) { - console.info(`${this.TAG} notifyVisibleForms error: ${JSON.stringify(error)}`); - } - try { - const res = await formHost.notifyInvisibleForms([this.formId]); - console.info(`${this.TAG} notifyInvisibleForms result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `notifyInvisibleForms`, - formId: this.formId, - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.formOnAcquiredEvent()); - } catch (error) { - console.info(`${this.TAG} notifyInvisibleForms error: ${JSON.stringify(error)}`); - } - } else if (this.notifyVisibleForms) { - try { - const startTime = await getCurrentTime(); - const res = await formHost.notifyVisibleForms([this.formId]); - const endTime = await getCurrentTime(); - console.info(`${this.TAG} notifyVisibleForms result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `notifyVisibleForms`, - formId: this.formId, - startTime: startTime, - hostTime: endTime - startTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.formOnAcquiredEvent()); - } catch (error) { - console.info(`${this.TAG} notifyVisibleForms error: ${JSON.stringify(error)}`); - } - } else if (this.notifyInvisibleForms) { - try { - const startTime = await getCurrentTime(); - const res = await formHost.notifyInvisibleForms([this.formId]); - const endTime = await getCurrentTime(); - console.info(`${this.TAG} notifyInvisibleForms result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `notifyInvisibleForms`, - formId: this.formId, - startTime: startTime, - hostTime: endTime - startTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.formOnAcquiredEvent()); - } catch (error) { - console.info(`${this.TAG} notifyInvisibleForms error: ${JSON.stringify(error)}`); - } - } else if (this.requestForm) { - try { - const startTime = await getCurrentTime(); - const res = await formHost.requestForm(this.formId); - const endTime = await getCurrentTime(); - console.info(`${this.TAG} requestForm result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `request`, - formId: this.formId, - startTime: startTime, - hostTime: endTime - startTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - } catch (error) { - console.info(`${this.TAG} requestForm error: ${JSON.stringify(error)}`); - } - } else if (this.releaseForm) { - try { - const startTime = await getCurrentTime(); - const res = await formHost.releaseForm(this.formId); - const endTime = await getCurrentTime(); - console.info(`${this.TAG} releaseForm result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `release`, - formId: this.formId, - hostTime: endTime - startTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - } catch (error) { - console.info(`${this.TAG} releaseForm error: ${JSON.stringify(error)}`); - } - } else if (this.update) { - try { - const res = await formHost.enableFormsUpdate([this.formId]); - console.info(`${this.TAG} enableUpdate result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `enableUpdate`, - formId: this.formId, - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - } catch (error) { - console.info(`${this.TAG} enableUpdate error: ${JSON.stringify(error)}`); - } - try { - const res = await formHost.disableFormsUpdate([this.formId]); - console.info(`${this.TAG} disableUpdate result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `disableUpdate`, - formId: this.formId, - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - } catch (error) { - console.info(`${this.TAG} disableUpdate error: ${JSON.stringify(error)}`); - } - } else if (this.enableUpdate) { - try { - const startTime = await getCurrentTime(); - const res = await formHost.enableFormsUpdate([this.formId]); - const endTime = await getCurrentTime(); - console.info(`${this.TAG} enableUpdate result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `enableUpdate`, - formId: this.formId, - hostTime: endTime - startTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - } catch (error) { - console.info(`${this.TAG} enableUpdate error: ${JSON.stringify(error)}`); - } - } else if (this.disableUpdate) { - try { - const startTime = await getCurrentTime(); - const res = await formHost.disableFormsUpdate([this.formId]); - const endTime = await getCurrentTime(); - console.info(`${this.TAG} disableUpdate result: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: res || `0`, - parameters: { - kind: `disableUpdate`, - formId: this.formId, - hostTime: endTime - startTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - } catch (error) { - console.info(`${this.TAG} disableUpdate error: ${JSON.stringify(error)}`); - } - } else { - const commonEventPublishData = { - data: this.formId.toString(), - parameters: { - formId: this.formId.toString(), - time: createdTime - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - } - }) - .onUninstall((info) => { - console.info(`${this.TAG} onUninstall: ${JSON.stringify(info)}`); - const commonEventPublishData = { - parameters: { - formId: info.id.toString(), - kind: "onUninstall" - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - }) - .onError((error) => { - console.error(`${this.TAG} onError: ${JSON.stringify(error)}`); - }) - } - if (this.createSecondForm) { - FormComponent({ - id: this.secondParam.formId, - name: this.secondParam.name, - bundle: this.secondParam.bundle, - ability: this.secondParam.ability, - module: this.secondParam.moduleName, - dimension: FormDimension.Dimension_1_2, - temporary: this.secondParam.temporary, - }) - .allowUpdate(this.allowUpdate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(`${this.TAG} secondForm onAcquired, form id: ${form.id}`); - this.formId = form.id; - const commonEventPublishData = { - data: this.formId.toString(), - parameters: { - "formId": this.formId.toString() - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - }) - .onUninstall((info) => { - console.info(`${this.TAG} onUninstall: ${JSON.stringify(info)}`); - }) - .onError((error) => { - console.error(`${this.TAG} onError: ${JSON.stringify(error)}`); - }); - } - if (this.createTempAndNormal) { - FormComponent({ - id: this.tempParam.formId, - name: this.tempParam.name, - bundle: this.tempParam.bundle, - ability: this.tempParam.ability, - module: this.tempParam.moduleName, - dimension: FormDimension.Dimension_1_2, - temporary: true, - }) - .allowUpdate(this.allowUpdate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(`${this.TAG} castForm onAcquired, form id: ${form.id}`); - this.formId = form.id; - const commonEventPublishData = { - data: this.formId.toString(), - parameters: { - "formId": this.formId.toString(), - "cast": true, - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); - }) - .onUninstall((info) => { - console.info(`${this.TAG} onUninstall: ${JSON.stringify(info)}`); - }) - .onError((error) => { - console.error(`${this.TAG} onError: ${JSON.stringify(error)}`); - }); - } - } - .backgroundColor(Color.White) - - Text(`form component test end`); - } - .backgroundColor(Color.White) - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 3243229f5..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostK" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/BUILD.gn deleted file mode 100644 index 5855a4859..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostL") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostL" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json deleted file mode 100644 index aee14662e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhostl", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhostl", - "name": ".FormStHostAppL", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnRequest_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use FMS_FormDelete_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "FMS_FormOnRequest_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.REQUIRE_FORM" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 7ce0bb2eb..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.hostl] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.hostl] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 707008c2b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from '@ohos.ability.featureAbility'; -import formManager from '@ohos.application.formHost'; - -// @ts-nocheck -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = `com.form.formsystemtestservicea.hmservice`; - @State ability: string = `com.form.formsystemtestservicea.hmservice.MainAbility`; - @State moduleName: string = `entry`; - @State name: string = `Form_Js001`; - @State canCreateForm: boolean = false; - @State allowUpdate: boolean = true; - @State isShowing: boolean = true; - @State dimension: FormDimension = FormDimension.Dimension_1_2; - @State temporary: boolean = false; - private requestForm = false; - private requestId = `-1`; - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"] - }; - private TAG = `[FormComponent.hostl]`; - private formOnAcquiredEvent = `FMS_FormOnAcquired_commonEvent`; - private formOnRequestEvent = `FMS_FormOnRequest_commonEvent`; - private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; - - private onAcquiredCallback() { - console.info(`====>${this.TAG} onAcquiredCallback====>`); - } - - private onRequestCallback() { - console.info(`====>${this.TAG} onRequestCallback====>`); - } - - private unsubscribeDeleteCallback() { - console.info(`${this.TAG} unSubscribeDeleteCallback====>`); - } - - async private aboutToAppear() { - const onDeleteEventSubscriber = await commonEvent.createSubscriber(this.subscriberFormDeleteEvent); - commonEvent.subscribe(onDeleteEventSubscriber, async (err, data) => { - console.info(`${this.TAG} deleteCallBack start:====> ${JSON.stringify(data)}`); - - data.parameters.formIds.forEach(async (formId) => { - await formHost.deleteForm(formId) - .then((res) => { - console.info(`${this.TAG} deleteForm result: ${JSON.stringify(res)}`); - }); - }); - - commonEvent.unsubscribe(onDeleteEventSubscriber, () => this.unsubscribeDeleteCallback()); - console.info(`${this.TAG} deleteCallBack end ====>`); - }); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.TAG} getWant: ${JSON.stringify(want)}`); - this.formId = want.parameters.formId; - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if (want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if (want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if (want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if (want.parameters.requestForm) { - this.requestForm = want.parameters.requestForm; - } - if (want.parameters.requestId) { - this.requestId = want.parameters.requestId; - } - if (want.parameters.isCreate) { - this.canCreateForm = want.parameters.isCreate; - } - - if (!this.canCreateForm && this.requestForm) { - let commonEventPublishData; - formManager.requestForm(this.requestId) - .then((data) => { - console.info(`${this.TAG} requestForm result: ${JSON.stringify(data)}`); - commonEventPublishData = { - data: data.toString(), - parameters: { - "formId": this.requestId - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.onRequestCallback); - }) - .catch((error) => { - console.info(`${this.TAG} requestForm error: ${JSON.stringify(error)}`); - commonEventPublishData = { - parameters: { - "error": error - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.onRequestCallback); - }); - } - }) - .catch((error: any) => { - console.error(`${this.TAG} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Column() { - Text(`form component test begin`); - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpdate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(`${this.TAG} onAcquired, form id: ${form.id}`); - this.formId = form.id; - const commonEventPublishData = { - data: this.formId.toString() - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.onAcquiredCallback); - }) - .onUninstall((info) => { - console.info(`${this.TAG} onUninstall: ${JSON.stringify(info)}`); - }) - .onError((error) => { - console.error(`${this.TAG} onError: ${JSON.stringify(error)}`); - }); - } - } - .backgroundColor(Color.White) - - Text(`form component test end`); - } - .backgroundColor(Color.White) - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 3c68884fd..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostL" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/BUILD.gn deleted file mode 100644 index fcf084568..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostN") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostN" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json deleted file mode 100644 index bba04f58c..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhostn", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhostn", - "name": ".FormStHostAppN", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormCast_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_SendCastForm_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent" - }, - { - "name": "FMS_FormCast_commonEvent" - }, - { - "name": "FMS_SendCastForm_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.REQUIRE_FORM" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f49f9bd10..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.host] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.host] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index e4e8562fc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,455 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; - -@Entry -@Component -struct Index { - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State optType: number = 0; - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private normal = 0; - private temporary = 0; - private normaldel = 0; - private temporarydel = 0; - private normalFormIds = []; - private tempFormIds = []; - - private deleteIds = []; - private delCount = 0; - - private normalFormCounts = []; - private tempFormCounts = []; - - private castFormId = "-1"; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formCastEvent = "FMS_FormCast_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private subscriberSendCastForm; - private subscriberSendCastFormEvent = { - events: ["FMS_SendCastForm_commonEvent"], - }; - - private publishOnErrorCallBack() { - console.debug("====> [FormComponent] formsystemhostn formOnErrorEvent Publish CallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====> [FormComponent] formsystemhostn formOnAcquiredEvent Publish CallBack ====>"); - } - private publishDeleteCallBack() { - console.debug("====> [FormComponent] formsystemhostn publishDeleteCallBack Publish CallBack ====>"); - } - private publishCastCallBack() { - console.debug("====>formCastEvent Publish CallBack ====>"); - } - private startAbility(bundleName, abilityName, sendMsg) { - featureAbility.startAbility({ - want: { - bundleName: bundleName, - abilityName: abilityName, - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName": "entry", - "temporary": false, - "sendCastForm": true, - "sendCastFormMsg": sendMsg, - "isCreate": false - } - } - }).then((res: any) => { - console.info(`[FormComponent] formsystemhostn featureAbility.startAbility res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`[FormComponent] formsystemhostn featureAbility.startAbility error: ${JSON.stringify(err)}`); - }); - } - - private publishOnSendCastForm(err, data) { - console.info("!!!====>[FormComponent] formsystemhostn OnSendCastForm start:====>" + JSON.stringify(data)); - if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhostn") { - return; - } - let formId = data.parameters.castFormId; - setTimeout(function () { - console.info("[FormComponent.host] castTempForm start, formId: " + formId); - formManager.castTempForm(formId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", data.toString()); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); - this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", error.code.toString()); - }); - console.info("[FormComponent.host] castTempForm end"); - }, 5000); - console.info("!!!====>[FormComponent] formsystemhostn OnSendCastForm end"); - } - - private deleteCallBack(err, data) { - console.info("!!!====>[FormComponent] formsystemhostn deleteCallBack start:====>" + JSON.stringify(data)); - const delFormIds = data.parameters.formIds; - console.info(`[FormComponent] data size ${delFormIds.length}`); - - console.info(`[FormComponent] data.subscriber ${JSON.stringify(this.subscriberDel)}`); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); - }); - console.info(`[FormComponent] data.bundleName ${JSON.stringify(data.bundleName)}`); - console.info(`[FormComponent] tof ${"com.ohos.st.formsystemhostn" != data.bundleName}`); - if ("com.ohos.st.formsystemhostn" != data.bundleName) { - return; - } - delFormIds.forEach(async (formId, index) => { - console.info(`[FormComponent] formsystemhostn deleteForm ${index}`); - try { - const res = await formManager.deleteForm(formId); - console.info(`[FormComponent] formsystemhostn deleteForm ${index} ${formId} result: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`[FormComponent] formsystemhostn deleteForm ${index} ${formId} error: ${JSON.stringify(error)}`); - } - }); - console.info("!!!====> [FormComponent] formsystemhostn optType deleteCallBack end ====>"); - } - - private unSubscribeDeleteCallback() { - console.debug("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); - } - - private unSubscribeCastFormCallback() { - console.debug("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>[FormComponent] formsystemhostn Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - commonEvent.subscribe(this.subscriberDel, (err, data) => { - if ("com.ohos.st.formsystemhostn" != data.bundleName) { - return; - } else { - console.info("!!!====>[FormComponent.hostn] formsystemhostn deleteCallBack start:====>" + JSON.stringify(data)); - const delFormIds = data.parameters.formIds; - console.info(`[FormComponent] data size ${delFormIds.length}`); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); - }); - let delCounter = 0; - delFormIds.forEach((formId) => { - formManager.deleteForm(formId, (error, data) => { - console.info(`[FormComponent] formsystemhostn deleteForm ${++delCounter} ${formId} data: ${JSON.stringify(data)} err: ${JSON.stringify(error)}`); - }); - }); - } - }); - }); - - commonEvent.createSubscriber(this.subscriberSendCastFormEvent).then(async (data) => { - console.info("====>[FormComponent] formsystemhostn Subscriber SendCastForm data:====>", JSON.stringify(data)); - this.subscriberSendCastForm = data; - await commonEvent.subscribe(this.subscriberSendCastForm, this.publishOnSendCastForm); - }); - - featureAbility.getWant() - .then(async (want: any) => { - console.info(" [FormComponent] formsystemhostn getWant:" + JSON.stringify(want)); - - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if (want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - - if (want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - - if (want.parameters.normal) { - this.normal = want.parameters.normal; - } - - if (want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if (want.parameters.normaldel) { - this.normaldel = want.parameters.normaldel; - } - - if (want.parameters.temporarydel) { - this.temporarydel = want.parameters.temporarydel; - } - - if (want.parameters.deleteIds) { - this.deleteIds = want.parameters.deleteIds; - } - if (want.parameters.castFormId) { - this.castFormId = want.parameters.castFormId; - } - - if (want.parameters.releaseFormId) { - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); - }); - - const formId = want.parameters.releaseFormId; - const isReleaseCache = want.parameters.isReleaseCache; - const res = await formManager.releaseForm(formId, isReleaseCache); - console.info(`[FormComponent] releaseForm res: ${JSON.stringify(res)}`); - const commonEventPublishData = { - data: `releaseForm`, - bundleName: `com.ohos.st.formsystemhostn`, - parameters: { - formIds: [].concat(formId) - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - - this.normal = 1; - } - - this.makeCount(); - - setTimeout(() => { - this.optType = want.parameters.optType; - console.info(' [FormComponent] formsystemhostn getWant optType:' + this.optType); - }, 10); - - if (this.castFormId != "-1" && want.parameters.optType == 3) { - console.info("[FormComponent.host] castTempForm start"); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); - }); - - formManager.castTempForm(this.castFormId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - let commonEventPublishData = { - data: data || `0`, - bundleName: "com.ohos.st.formsystemhostn", - parameters: { - formId: this.castFormId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + error.code); - let commonEventPublishData = { - data: error.code.toString(), - errMsg: error.msg, - bundleName: "com.ohos.st.formsystemhostn", - parameters: { - formId: this.castFormId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }); - console.info("[FormComponent.host] castTempForm end"); - } - - if (want.parameters.optType == 2 && this.deleteIds.length > 0) { - for (let iIndex = 0; iIndex < this.deleteIds.length; ++iIndex) { - console.info("[FormComponent] formsystemhostn deleteForm start"); - formManager.deleteForm(this.deleteIds[iIndex]) - .then((data) => { - console.info('[FormComponent] formsystemhostn deleteForm result:' + data); - this.delCount++; - - if (this.delCount == this.deleteIds.length) { - let commonEventPublishData = { - data: data.toString(), - bundleName: "com.ohos.st.formsystemhostn", - parameters: { - "formIds": this.deleteIds - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishDeleteCallBack); - } - }) - .catch((error) => { - console.info(' [FormComponent] formsystemhostn deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - bundleName: "com.ohos.st.formsystemhostn", - parameters: { - "formIds": [this.deleteIds[iIndex]] - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - console.info("[FormComponent] formsystemhostn deleteForm end"); - } - } - }) - .catch((error: any) => { - console.error(' [FormComponent] formsystemhostn Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.info(`[FormComponent.host] aboutToAppear end`); - } - - private makeCount() { - console.info(' [FormComponent] formsystemhostn makeCount start.'); - for (let nNormal = 0; nNormal < this.normal; nNormal++) { - this.normalFormCounts.push(nNormal); - } - console.info(' [FormComponent] formsystemhostn this.normalFormCounts.length:' + this.normalFormCounts.length); - - for (let nTemp = 0; nTemp < this.temporary; nTemp++) { - this.tempFormCounts.push(nTemp); - } - console.info(' [FormComponent] formsystemhostn this.tempFormCounts.length:' + this.tempFormCounts.length); - } - - build() { - Scroll(new Scroller()) { - Column() { - if (this.optType == 1) { - Text(' [FormComponent] formsystemhostn normal form component test begin') - Grid() { - ForEach(this.normalFormCounts, (item) => { - GridItem() { - FormComponent({ - id: 0, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: false - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(" [FormComponent] formsystemhostn get normal form, form id:" + form.id); - - this.normalFormIds.push(form.id.toString()); - if (this.normalFormIds.length == this.normal - this.normaldel) { - let commonEventPublishData = { - data: "normalForm", - bundleName: "com.ohos.st.formsystemhostn", - parameters: { - "formIds": this.normalFormIds - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onError((error) => { - console.info(" [FormComponent] formsystemhostn normal form error code:" + error.errcode); - console.info(" [FormComponent] formsystemhostn normal form error msg:" + error.msg); - let commonEventPublishData = { - data: error.msg, - bundleName: "com.ohos.st.formsystemhostn" - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .size({ width: 40, height: 40 }) - } - }, (item) => JSON.stringify(item)) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') - .columnsGap(2) - .rowsGap(2) - .width('100%') - Text(' [FormComponent] formsystemhostn normal form component test end') - - Text(' [FormComponent] formsystemhostn temp form component test start') - Grid() { - ForEach(this.tempFormCounts, (item) => { - GridItem() { - FormComponent({ - id: 0, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: true - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(" [FormComponent] formsystemhostn get temp form, form id:" + form.id); - this.tempFormIds.push(form.id.toString()); - if (this.tempFormIds.length == this.temporary - this.temporarydel) { - let commonEventPublishData = { - data: "tempForm", - bundleName: "com.ohos.st.formsystemhostn", - parameters: { - "formIds": this.tempFormIds - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onError((error) => { - console.info(" [FormComponent] formsystemhostn temp form error code:" + error.errcode); - console.info(" [FormComponent] formsystemhostn temp form error msg:" + error.msg); - let commonEventPublishData = { - data: error.msg, - bundleName: "com.ohos.st.formsystemhostn" - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .size({ width: 40, height: 40 }) - } - }, (item) => JSON.stringify(item)) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') - .columnsGap(2) - .rowsGap(2) - .width('100%') - - Text(' [FormComponent] formsystemhostn temp form component test end') - } - } - .backgroundColor(Color.White) - } - .scrollable(ScrollDirection.Vertical) - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/element/string.json deleted file mode 100644 index a92ae9f03..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostN" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/BUILD.gn deleted file mode 100644 index ee371aeac..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostNoPerm") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostNoPerm" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json deleted file mode 100644 index 4dd2ebce2..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhostnoperm", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhostnoperm", - "name": ".FormStHostAppNoPerm", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnRequest_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnState_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "name": "FMS_FormOnRequest_commonEvent" - }, - { - "name": "FMS_FormOnState_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f49f9bd10..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.host] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.host] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 4bc1a76a3..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import commonEvent from '@ohos.commonEvent'; -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; - -@Entry -@Component -struct Index { - @State formId: number = 0; - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State canCreateForm: boolean = false; - - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private stateForm = "visible"; - private stateIds = []; - private requestForm = false; - private requestId = "-1"; - private releaseForm = false; - private releaseId = "-1"; - private deleteForm = false; - private deleteId = "-1"; - private temporary = false; - private castForm = false; - - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; - private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent"; - private formOnRequestEvent = "FMS_FormOnRequest_commonEvent"; - private formOnStateEvent = "FMS_FormOnState_commonEvent"; - - private publishCallBack() { - console.debug("====>formOnErrorEvent Publish CallBack ====>"); - } - - private aboutToAppear() { - console.error('[FormComponent] getWant'); - featureAbility.getWant() - .then((want: any) => { - this.formId = parseInt(want.parameters.formId); - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if(want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - if(want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if(want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - if(want.parameters.castForm) { - this.castForm = want.parameters.castForm; - } - if(want.parameters.deleteForm) { - this.deleteForm = want.parameters.deleteForm; - } - if(want.parameters.deleteId) { - this.deleteId = want.parameters.deleteId; - } - if(want.parameters.releaseForm) { - this.releaseForm = want.parameters.releaseForm; - } - if(want.parameters.releaseId) { - this.releaseId = want.parameters.releaseId; - } - if(want.parameters.requestForm) { - this.requestForm = want.parameters.requestForm; - } - if(want.parameters.requestId) { - this.requestId = want.parameters.requestId; - } - if(want.parameters.stateForm) { - this.stateForm = want.parameters.stateForm; - } - if(want.parameters.stateIds) { - this.stateIds = want.parameters.stateIds; - } - - setTimeout(() => { - this.canCreateForm = want.parameters.isCreate ? true : false; - console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); - }, 10); - console.error('[FormComponent] getWant end'+ JSON.stringify(want)); - - if(!want.parameters.isCreate && this.deleteForm) { - console.log("formsystemhostnoperm deleteForm start"); - formManager.deleteForm(this.deleteId) - .then((data) => { - console.info('formsystemhostnoperm deleteForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishCallBack); - }) - .catch((error) => { - console.info('formsystemhostnoperm deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.deleteId.toString() - } - }; - commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishCallBack); - }); - - console.log("formsystemhostnoperm deleteForm end"); - } - - if(!want.parameters.isCreate && this.releaseForm) { - console.log("formsystemhost releaseForm start"); - formManager.releaseForm(this.releaseId) - .then((data) => { - console.info('formsystemhost releaseForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishCallBack); - }) - .catch((error) => { - console.info('formsystemhost releaseForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.releaseId.toString() - } - }; - commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishCallBack); - }); - - console.log("formsystemhost releaseForm end"); - } - - if(!want.parameters.isCreate && this.requestForm) { - console.log("[FormComponent.host] requestForm start"); - formManager.requestForm(this.requestId) - .then((data) => { - console.info('[FormComponent] requestForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.requestId - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.publishCallBack); - }) - .catch((error) => { - console.info('[FormComponent] requestForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.requestId - } - }; - commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.publishCallBack); - }); - - console.log("[FormComponent.host] requestForm end"); - } - if(!want.parameters.isCreate && this.stateForm) { - if(this.stateForm == "visible") { - console.log("formsystemhost notifyVisibleForm start"); - formManager.notifyVisibleForms(this.stateIds) - .then((data) => { - console.info('formsystemhost notifyVisibleForm result:' + data); - let retData = "0"; - if(data == 0) { - retData = data.toString(); - } else { - retData = data.code.toString(); - } - let commonEventPublishData = { - data: retData, - parameters: { - "formId" : this.stateIds.toString() - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); - }) - .catch((error) => { - console.info('formsystemhost notifyVisibleForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.stateIds.toString() - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); - }); - console.log("formsystemhost notifyVisibleForm end"); - } else if(this.stateForm == "invisible") { - console.log("formsystemhost notifyInvisibleForm start"); - formManager.notifyInvisibleForms(this.stateIds) - .then((data) => { - console.info('formsystemhost notifyInvisibleForm result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.stateIds.toString() - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); - }) - .catch((error) => { - console.info('formsystemhost notifyInvisibleForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.stateIds.toString() - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); - }); - console.log("formsystemhost notifyInvisibleForm end"); - } else if(this.stateForm == "enable") { - console.log("formsystemhost enableFormsUpdate start"); - formManager.enableFormsUpdate(this.stateIds) - .then((data) => { - console.info('formsystemhost enableFormsUpdate result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.stateIds.toString() - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); - }) - .catch((error) => { - console.info('formsystemhost enableFormsUpdate error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.stateIds.toString() - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); - }); - console.log("formsystemhost enableFormsUpdate end"); - } else { - console.log("formsystemhost disableFormsUpdate start"); - formManager.disableFormsUpdate(this.stateIds) - .then((data) => { - console.info('formsystemhost disableFormsUpdate result:' + data); - let commonEventPublishData = { - data: data.toString(), - parameters: { - "formId" : this.stateIds.toString() - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); - }) - .catch((error) => { - console.info('formsystemhost disableFormsUpdate error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - parameters: { - "formId" : this.stateIds.toString() - } - }; - commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); - }); - console.log("formsystemhost disableFormsUpdate end"); - } - } - - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - - console.log(`[FormComponent.host] aboutToAppear end`); - } - - build() { - Column() { - Text('form component test begin') - Column() { - if (this.canCreateForm) { - FormComponent({ - id: this.formId, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: this.temporary, - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - this.formId = form.id; - console.log("[FormComponent.host] get form, form id:" + form.id); - }) - .onError((error) => { - console.log("[FormComponent.host] error code:" + error.errcode); - console.log("[FormComponent.host] error msg:" + error.msg); - let commonEventPublishData = { - data: error.msg - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishCallBack); - }) - } - } - .backgroundColor(Color.White) - Text('form component test end') - } - .backgroundColor(Color.White) - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9fbbb3f68..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostNoPerm" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/BUILD.gn deleted file mode 100644 index 2cb109dd4..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostO") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostO" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json deleted file mode 100644 index ce6b5e219..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhosto", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhosto", - "name": ".FormStHostAppO", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormCast_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_SendCastForm_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent" - }, - { - "name": "FMS_FormCast_commonEvent" - }, - { - "name": "FMS_SendCastForm_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.REQUIRE_FORM" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f49f9bd10..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.host] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.host] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index ef8e33d68..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; -import commonEvent from '@ohos.commonEvent'; - -@Entry -@Component -struct Index { - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.FormAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State optType: number = 0; - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private normal = 0; - private temporary = 0; - private normaldel = 0; - private temporarydel = 0; - private normalFormIds = []; - private tempFormIds = []; - - private deleteIds = []; - private delCount = 0; - - private normalFormCounts = []; - private tempFormCounts = []; - - private castFormId = "-1"; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formCastEvent = "FMS_FormCast_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private subscriberSendCastForm; - private subscriberSendCastFormEvent = { - events: ["FMS_SendCastForm_commonEvent"], - }; - - private publishOnErrorCallBack() { - console.debug("====> [FormComponent] formsystemhosto formOnErrorEvent Publish CallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====> [FormComponent] formsystemhosto formOnAcquiredEvent Publish CallBack ====>"); - } - private publishDeleteCallBack() { - console.debug("====> [FormComponent] formsystemhosto publishDeleteCallBack Publish CallBack ====>"); - } - private publishCastCallBack() { - console.debug("====>formCastEvent Publish CallBack ====>"); - } - private startAbility(bundleName, abilityName, sendMsg) { - featureAbility.startAbility({ - want: { - bundleName: bundleName, - abilityName: abilityName, - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "sendCastForm": true, - "sendCastFormMsg": sendMsg, - "isCreate": false - } - } - }).then((res: any) => { - console.info(`[FormComponent] formsystemhosto featureAbility.startAbility res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`[FormComponent] formsystemhosto featureAbility.startAbility error: ${JSON.stringify(err)}`); - }); - } - private publishOnSendCastForm(err, data) { - console.info("!!!====>[FormComponent] formsystemhosto OnSendCastForm start:====>" + JSON.stringify(data)); - if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhosto") { - return; - } - let formId = data.parameters.castFormId; - setTimeout(function () { - console.info("[FormComponent.host] castTempForm start, formId: " + formId); - formManager.castTempForm(formId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", data.toString()); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); - this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", error.code.toString()); - }); - console.info("[FormComponent.host] castTempForm end"); - }, 5000); - console.info("!!!====>[FormComponent] formsystemhosto OnSendCastForm end"); - } - - private deleteCallBack(err, data) { - console.info("!!!====>[FormComponent] formsystemhosto deleteCallBack start:====>" + JSON.stringify(data)); - const delFormIds = data.parameters.formIds; - console.info(`[FormComponent] data size ${delFormIds.length}`); - - console.info(`[FormComponent] data.subscriber ${JSON.stringify(this.subscriberDel)}`); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhosto optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhosto optType unSubscribeCastFormCallback CallBack====>"); - }); - console.info(`[FormComponent] data.bundleName ${JSON.stringify(data.bundleName)}`); - console.info(`[FormComponent] tof ${"com.ohos.st.formsystemhosto" != data.bundleName}`); - if ("com.ohos.st.formsystemhosto" != data.bundleName) { - return; - } - delFormIds.forEach(async (formId, index) => { - console.info(`[FormComponent] formsystemhosto deleteForm ${index}`); - try { - const res = await formManager.deleteForm(formId); - console.info(`[FormComponent] formsystemhosto deleteForm ${index} ${formId} result: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`[FormComponent] formsystemhosto deleteForm ${index} ${formId} error: ${JSON.stringify(error)}`); - } - }); - console.info("!!!====> [FormComponent] formsystemhosto optType deleteCallBack end ====>"); - } - - private unSubscribeDeleteCallback() { - console.debug("====> [FormComponent] formsystemhosto optType unSubscribeDeleteCallback CallBack====>"); - } - - private unSubscribeCastFormCallback() { - console.debug("====> [FormComponent] formsystemhosto optType unSubscribeCastFormCallback CallBack====>"); - } - - private aboutToAppear() { - const TAG = "[FormComponent.hosto]"; - - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>[FormComponent] formsystemhosto Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - commonEvent.subscribe(this.subscriberDel, (err, data) => { - if ("com.ohos.st.formsystemhosto" != data.bundleName) { - return; - } else { - console.info("!!!====>[FormComponent.hosto] formsystemhosto deleteCallBack start:====>" + JSON.stringify(data)); - const delFormIds = data.parameters.formIds; - console.info(`[FormComponent] data size ${delFormIds.length}`); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhosto optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhosto optType unSubscribeCastFormCallback CallBack====>"); - }); - let delCounter = 0; - delFormIds.forEach((formId) => { - formManager.deleteForm(formId, (error, data) => { - console.info(`[FormComponent] formsystemhosto deleteForm ${++delCounter} ${formId} data: ${JSON.stringify(data)} err: ${JSON.stringify(error)}`); - }); - }); - } - }); - }); - - commonEvent.createSubscriber(this.subscriberSendCastFormEvent).then(async (data) => { - console.info("====>[FormComponent] formsystemhosto Subscriber SendCastForm data:====>", JSON.stringify(data)); - this.subscriberSendCastForm = data; - await commonEvent.subscribe(this.subscriberSendCastForm, this.publishOnSendCastForm); - }); - - featureAbility.getWant() - .then((want: any) => { - console.info(" [FormComponent] formsystemhosto getWant:" + JSON.stringify(want)); - - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if (want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - - if (want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - - if (want.parameters.normal) { - this.normal = want.parameters.normal; - } - - if (want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if (want.parameters.normaldel) { - this.normaldel = want.parameters.normaldel; - } - - if (want.parameters.temporarydel) { - this.temporarydel = want.parameters.temporarydel; - } - - if (want.parameters.deleteIds) { - this.deleteIds = want.parameters.deleteIds; - } - if (want.parameters.castFormId) { - this.castFormId = want.parameters.castFormId; - } - - this.makeCount(); - - setTimeout(() => { - this.optType = want.parameters.optType; - console.info(' [FormComponent] formsystemhosto getWant optType:' + this.optType); - }, 10); - - if (this.castFormId != "-1" && want.parameters.optType == 3) { - console.info("[FormComponent.host] castTempForm start"); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhosto optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhosto optType unSubscribeCastFormCallback CallBack====>"); - }); - - formManager.castTempForm(this.castFormId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - let commonEventPublishData = { - data: data || `0`, - bundleName: "com.ohos.st.formsystemhosto", - parameters: { - formId: this.castFormId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); - let commonEventPublishData = { - data: error.code.toString(), - bundleName: "com.ohos.st.formsystemhosto", - parameters: { - errMsg: error.message, - formId: this.castFormId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }); - console.info("[FormComponent.host] castTempForm end"); - } - - if (want.parameters.optType == 2 && this.deleteIds.length > 0) { - for (let iIndex = 0; iIndex < this.deleteIds.length; ++iIndex) { - console.info("[FormComponent] formsystemhosto deleteForm start"); - formManager.deleteForm(this.deleteIds[iIndex]) - .then((data) => { - console.info('[FormComponent] formsystemhosto deleteForm result:' + data); - this.delCount++; - - if (this.delCount == this.deleteIds.length) { - let commonEventPublishData = { - data: data.toString(), - bundleName: "com.ohos.st.formsystemhosto", - parameters: { - "formIds": this.deleteIds - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishDeleteCallBack); - } - }) - .catch((error) => { - console.info(' [FormComponent] formsystemhosto deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - bundleName: "com.ohos.st.formsystemhosto", - parameters: { - "formIds": [this.deleteIds[iIndex]] - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - console.info("[FormComponent] formsystemhosto deleteForm end"); - } - } - }) - .catch((error: any) => { - console.error(' [FormComponent] formsystemhosto Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.info(`[FormComponent.host] aboutToAppear end`); - } - - private makeCount() { - console.info(' [FormComponent] formsystemhosto makeCount start.'); - for (let nNormal = 0; nNormal < this.normal; nNormal++) { - this.normalFormCounts.push(nNormal); - } - console.info(' [FormComponent] formsystemhosto this.normalFormCounts.length:' + this.normalFormCounts.length); - - for (let nTemp = 0; nTemp < this.temporary; nTemp++) { - this.tempFormCounts.push(nTemp); - } - console.info(' [FormComponent] formsystemhosto this.tempFormCounts.length:' + this.tempFormCounts.length); - } - - build() { - Scroll(new Scroller()) { - Column() { - if (this.optType == 1) { - Text(' [FormComponent] formsystemhosto normal form component test begin') - Grid() { - ForEach(this.normalFormCounts, (item) => { - GridItem() { - FormComponent({ - id: 0, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: false - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(" [FormComponent] formsystemhosto get normal form, form id:" + form.id); - - this.normalFormIds.push(form.id.toString()); - if (this.normalFormIds.length == this.normal - this.normaldel) { - let commonEventPublishData = { - data: "normalForm", - bundleName: "com.ohos.st.formsystemhosto", - parameters: { - "formIds": this.normalFormIds - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onError((error) => { - console.info(" [FormComponent] formsystemhosto normal form error code:" + error.errcode); - console.info(" [FormComponent] formsystemhosto normal form error msg:" + error.msg); - let commonEventPublishData = { - data: error.msg, - bundleName: "com.ohos.st.formsystemhosto" - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .size({ width: 40, height: 40 }) - } - }, (item) => JSON.stringify(item)) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') - .columnsGap(2) - .rowsGap(2) - .width('100%') - Text(' [FormComponent] formsystemhosto normal form component test end') - - Text(' [FormComponent] formsystemhosto temp form component test start') - Grid() { - ForEach(this.tempFormCounts, (item) => { - GridItem() { - FormComponent({ - id: 0, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: true - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(" [FormComponent] formsystemhosto get temp form, form id:" + form.id); - this.tempFormIds.push(form.id.toString()); - if (this.tempFormIds.length == this.temporary - this.temporarydel) { - let commonEventPublishData = { - data: "tempForm", - bundleName: "com.ohos.st.formsystemhosto", - parameters: { - "formIds": this.tempFormIds - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onError((error) => { - console.info(" [FormComponent] formsystemhosto temp form error code:" + error.errcode); - console.info(" [FormComponent] formsystemhosto temp form error msg:" + error.msg); - let commonEventPublishData = { - data: error.msg, - bundleName: "com.ohos.st.formsystemhosto" - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .size({ width: 40, height: 40 }) - } - }, (item) => JSON.stringify(item)) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') - .columnsGap(2) - .rowsGap(2) - .width('100%') - - Text(' [FormComponent] formsystemhosto temp form component test end') - } - } - .backgroundColor(Color.White) - } - .scrollable(ScrollDirection.Vertical) - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e9202859e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostO" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/BUILD.gn deleted file mode 100644 index f19869313..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemHostP") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "FormSystemHostP" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/Test.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json deleted file mode 100644 index cc425ebdd..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemhostp", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemhostp", - "name": ".FormStHostAppP", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormCast_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_SendCastForm_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent" - }, - { - "name": "FMS_FormCast_commonEvent" - }, - { - "name": "FMS_SendCastForm_commonEvent" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.REQUIRE_FORM" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f49f9bd10..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent.host] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent.host] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index e91fed1e0..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,422 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import formManager from '@ohos.application.formHost'; -import commonEvent from '@ohos.commonEvent'; - -@Entry -@Component -struct Index { - @State bundle: string = "com.form.formsystemtestservicea.hmservice"; - @State ability: string = "com.form.formsystemtestservicea.hmservice.FormAbility"; - @State moduleName: string = "entry"; - @State name: string = "Form_Js001"; - @State allowUpate: boolean = true; - @State isShowing: boolean = true; - @State optType: number = 0; - private dimension: FormDimension = FormDimension.Dimension_1_2; - - private normal = 0; - private temporary = 0; - private normaldel = 0; - private temporarydel = 0; - private normalFormIds = []; - private tempFormIds = []; - - private deleteIds = []; - private delCount = 0; - - private normalFormCounts = []; - private tempFormCounts = []; - - private castFormId = "-1"; - - private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; - private formOnErrorEvent = "FMS_FormOnError_commonEvent"; - private formCastEvent = "FMS_FormCast_commonEvent"; - - private subscriberDel; - private subscriberFormDeleteEvent = { - events: ["FMS_FormDelete_commonEvent"], - }; - - private subscriberSendCastForm; - private subscriberSendCastFormEvent = { - events: ["FMS_SendCastForm_commonEvent"], - }; - - private publishOnErrorCallBack() { - console.debug("====> [FormComponent] formsystemhostp formOnErrorEvent Publish CallBack ====>"); - } - private publishOnAcquiredCallBack() { - console.debug("====> [FormComponent] formsystemhostp formOnAcquiredEvent Publish CallBack ====>"); - } - private publishDeleteCallBack() { - console.debug("====> [FormComponent] formsystemhostp publishDeleteCallBack Publish CallBack ====>"); - } - private publishCastCallBack() { - console.debug("====>formCastEvent Publish CallBack ====>"); - } - private startAbility(bundleName, abilityName, sendMsg) { - featureAbility.startAbility({ - want: { - bundleName: bundleName, - abilityName: abilityName, - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "sendCastForm": true, - "sendCastFormMsg": sendMsg, - "isCreate": false - } - } - }).then((res: any) => { - console.info(`[FormComponent] formsystemhostp featureAbility.startAbility res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`[FormComponent] formsystemhostp featureAbility.startAbility error: ${JSON.stringify(err)}`); - }); - } - private publishOnSendCastForm(err, data) { - console.info("!!!====>[FormComponent] formsystemhostp OnSendCastForm start:====>" + JSON.stringify(data)); - if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhostp") { - return; - } - let formId = data.parameters.castFormId; - setTimeout(function () { - console.info("[FormComponent.host] castTempForm start, formId: " + formId); - formManager.castTempForm(formId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", data.toString()); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); - this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", error.code.toString()); - }); - console.info("[FormComponent.host] castTempForm end"); - }, 5000); - console.info("!!!====>[FormComponent] formsystemhostp OnSendCastForm end"); - } - - private deleteCallBack(err, data) { - console.info("!!!====>[FormComponent] formsystemhostp deleteCallBack start:====>" + JSON.stringify(data)); - const delFormIds = data.parameters.formIds; - console.info(`[FormComponent] data size ${delFormIds.length}`); - - console.info(`[FormComponent] data.subscriber ${JSON.stringify(this.subscriberDel)}`); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhostp optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhostp optType unSubscribeCastFormCallback CallBack====>"); - }); - console.info(`[FormComponent] data.bundleName ${JSON.stringify(data.bundleName)}`); - console.info(`[FormComponent] tof ${"com.ohos.st.formsystemhostp" != data.bundleName}`); - if ("com.ohos.st.formsystemhostp" != data.bundleName) { - return; - } - delFormIds.forEach(async (formId, index) => { - console.info(`[FormComponent] formsystemhostp deleteForm ${index}`); - try { - const res = await formManager.deleteForm(formId); - console.info(`[FormComponent] formsystemhostp deleteForm ${index} ${formId} result: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`[FormComponent] formsystemhostp deleteForm ${index} ${formId} error: ${JSON.stringify(error)}`); - } - }); - console.info("!!!====> [FormComponent] formsystemhostp optType deleteCallBack end ====>"); - } - - private aboutToAppear() { - commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { - console.info("====>[FormComponent] formsystemhostp Subscriber FormDelete data:====>", JSON.stringify(data)); - this.subscriberDel = data; - commonEvent.subscribe(this.subscriberDel, (err, data) => { - if ("com.ohos.st.formsystemhostp" != data.bundleName) { - return; - } else { - console.info("!!!====>[FormComponent.hostp] formsystemhostp deleteCallBack start:====>" + JSON.stringify(data)); - const delFormIds = data.parameters.formIds; - console.info(`[FormComponent] data size ${delFormIds.length}`); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhostp optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhostp optType unSubscribeCastFormCallback CallBack====>"); - }); - let delCounter = 0; - delFormIds.forEach((formId) => { - formManager.deleteForm(formId, (error, data) => { - console.info(`[FormComponent] formsystemhostp deleteForm ${++delCounter} ${formId} data: ${JSON.stringify(data)} err: ${JSON.stringify(error)}`); - }); - }); - } - }); - }); - - commonEvent.createSubscriber(this.subscriberSendCastFormEvent).then(async (data) => { - console.info("====>[FormComponent] formsystemhostp Subscriber SendCastForm data:====>", JSON.stringify(data)); - this.subscriberSendCastForm = data; - await commonEvent.subscribe(this.subscriberSendCastForm, this.publishOnSendCastForm); - }); - - featureAbility.getWant() - .then((want: any) => { - console.info(" [FormComponent] formsystemhostp getWant:" + JSON.stringify(want)); - - this.name = want.parameters.name; - this.bundle = want.parameters.bundle; - this.ability = want.parameters.ability; - if (want.parameters.moduleName) { - this.moduleName = want.parameters.moduleName; - } - - if (want.parameters.dimension) { - this.dimension = want.parameters.dimension; - } - - if (want.parameters.normal) { - this.normal = want.parameters.normal; - } - - if (want.parameters.temporary) { - this.temporary = want.parameters.temporary; - } - if (want.parameters.normaldel) { - this.normaldel = want.parameters.normaldel; - } - - if (want.parameters.temporarydel) { - this.temporarydel = want.parameters.temporarydel; - } - - if (want.parameters.deleteIds) { - this.deleteIds = want.parameters.deleteIds; - } - if (want.parameters.castFormId) { - this.castFormId = want.parameters.castFormId; - } - - this.makeCount(); - - setTimeout(() => { - this.optType = want.parameters.optType; - console.info(' [FormComponent] formsystemhostp getWant optType:' + this.optType); - }, 10); - - if (this.castFormId != "-1" && want.parameters.optType == 3) { - console.info("[FormComponent.host] castTempForm start"); - commonEvent.unsubscribe(this.subscriberDel, () => { - console.info("====> [FormComponent] formsystemhostp optType unSubscribeDeleteCallback CallBack====>"); - }); - commonEvent.unsubscribe(this.subscriberSendCastForm, () => { - console.info("====> [FormComponent] formsystemhostp optType unSubscribeCastFormCallback CallBack====>"); - }); - - formManager.castTempForm(this.castFormId) - .then((data) => { - console.info('[FormComponent] castTempForm result:' + data); - let commonEventPublishData = { - data: data || `0`, - bundleName: "com.ohos.st.formsystemhostp", - parameters: { - formId: this.castFormId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }) - .catch((error) => { - console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); - let commonEventPublishData = { - data: error.code.toString(), - bundleName: "com.ohos.st.formsystemhostp", - parameters: { - errMsg: error.message, - formId: this.castFormId.toString() - } - }; - commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); - }); - console.info("[FormComponent.host] castTempForm end"); - } - - if (want.parameters.optType == 2 && this.deleteIds.length > 0) { - for (let iIndex = 0; iIndex < this.deleteIds.length; ++iIndex) { - console.info("[FormComponent] formsystemhostp deleteForm start"); - formManager.deleteForm(this.deleteIds[iIndex]) - .then((data) => { - console.info('[FormComponent] formsystemhostp deleteForm result:' + data); - this.delCount++; - - if (this.delCount == this.deleteIds.length) { - let commonEventPublishData = { - data: data.toString(), - bundleName: "com.ohos.st.formsystemhostp", - parameters: { - "formIds": this.deleteIds - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishDeleteCallBack); - } - }) - .catch((error) => { - console.info(' [FormComponent] formsystemhostp deleteForm error:' + error); - let commonEventPublishData = { - data: error.code.toString(), - bundleName: "com.ohos.st.formsystemhostp", - parameters: { - "formIds": [this.deleteIds[iIndex]] - } - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }); - console.info("[FormComponent] formsystemhostp deleteForm end"); - } - } - }) - .catch((error: any) => { - console.error(' [FormComponent] formsystemhostp Operation failed. Cause: ' + JSON.stringify(error)); - }) - console.info(`[FormComponent.host] aboutToAppear end`); - } - - private makeCount() { - console.info(' [FormComponent] formsystemhostp makeCount start.'); - for (let nNormal = 0; nNormal < this.normal; nNormal++) { - this.normalFormCounts.push(nNormal); - } - console.info(' [FormComponent] formsystemhostp this.normalFormCounts.length:' + this.normalFormCounts.length); - - for (let nTemp = 0; nTemp < this.temporary; nTemp++) { - this.tempFormCounts.push(nTemp); - } - console.info(' [FormComponent] formsystemhostp this.tempFormCounts.length:' + this.tempFormCounts.length); - } - - build() { - Scroll(new Scroller()) { - Column() { - if (this.optType == 1) { - Text(' [FormComponent] formsystemhostp normal form component test begin') - Grid() { - ForEach(this.normalFormCounts, (item) => { - GridItem() { - FormComponent({ - id: 0, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: false - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(" [FormComponent] formsystemhostp get normal form, form id:" + form.id); - - this.normalFormIds.push(form.id.toString()); - if (this.normalFormIds.length == this.normal - this.normaldel) { - let commonEventPublishData = { - data: "normalForm", - bundleName: "com.ohos.st.formsystemhostp", - parameters: { - "formIds": this.normalFormIds - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onError((error) => { - console.info(" [FormComponent] formsystemhostp normal form error code:" + error.errcode); - console.info(" [FormComponent] formsystemhostp normal form error msg:" + error.msg); - let commonEventPublishData = { - data: error.msg, - bundleName: "com.ohos.st.formsystemhostp" - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .size({ width: 40, height: 40 }) - } - }, (item) => JSON.stringify(item)) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') - .columnsGap(2) - .rowsGap(2) - .width('100%') - Text(' [FormComponent] formsystemhostp normal form component test end') - - Text(' [FormComponent] formsystemhostp temp form component test start') - Grid() { - ForEach(this.tempFormCounts, (item) => { - GridItem() { - FormComponent({ - id: 0, - name: this.name, - bundle: this.bundle, - ability: this.ability, - module: this.moduleName, - dimension: this.dimension, - temporary: true - }) - .allowUpdate(this.allowUpate) - .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) - .onAcquired((form) => { - console.info(" [FormComponent] formsystemhostp get temp form, form id:" + form.id); - this.tempFormIds.push(form.id.toString()); - if (this.tempFormIds.length == this.temporary - this.temporarydel) { - let commonEventPublishData = { - data: "tempForm", - bundleName: "com.ohos.st.formsystemhostp", - parameters: { - "formIds": this.tempFormIds - } - }; - commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); - } - }) - .onError((error) => { - console.info(" [FormComponent] formsystemhostp temp form error code:" + error.errcode); - console.info(" [FormComponent] formsystemhostp temp form error msg:" + error.msg); - let commonEventPublishData = { - data: error.msg, - bundleName: "com.ohos.st.formsystemhostp" - }; - commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); - }) - .size({ width: 40, height: 40 }) - } - }, (item) => JSON.stringify(item)) - } - .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') - .columnsGap(2) - .rowsGap(2) - .width('100%') - - Text(' [FormComponent] formsystemhostp temp form component test end') - } - } - .backgroundColor(Color.White) - } - .scrollable(ScrollDirection.Vertical) - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e1cf22f27..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formhostP" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json deleted file mode 100644 index 4936330fa..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "app": { - "bundleName": "com.form.formsystemtestservicea.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 9, - "releaseType": "Release", - "target": 9 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.form.formsystemtestservicea.hmservice", - "name": ".FormSupplyAppA", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "name": ".FormAbility", - "srcPath": "FormAbility", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "formsEnabled": true, - "forms": [ - { - "jsComponentName": "Form_Js001", - "isDefault": true, - "scheduledUpdateTime": "10:30", - "formVisibleNotify": true, - "defaultDimension": "1*2", - "name": "Form_Js001", - "description": "This is a form 001", - "colorMode": "auto", - "type": "JS", - "supportDimensions": [ - "1*2", - "2*2" - ], - "updateEnabled": true, - "updateDuration": 1 - }, - { - "jsComponentName":"Form_Js002", - "isDefault":false, - "defaultDimension":"2*2", - "formVisibleNotify":true, - "name":"Form_Js002", - "colorMode":"auto", - "description":"This is a form 002", - "supportDimensions":[ - "1*2", - "2*2" - ], - "type":"JS", - "updateEnabled":true, - "updateDuration":1 - } - ], - "srcLanguage": "ets" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": "Form_Js001", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "type": "form" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "reason": "need use FormSupply commonEvent", - "name": "FMS_FormSupply_commonEvent" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/FormAbility/form.ts b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/FormAbility/form.ts deleted file mode 100644 index 09124b5db..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/FormAbility/form.ts +++ /dev/null @@ -1,88 +0,0 @@ -import formBindingData from '@ohos.application.formBindingData' -import commonEvent from '@ohos.commonEvent' - -let supplyForm_Event = "FMS_FormSupply_commonEvent"; - -function publishCallBack() { - console.info("!!!====>FormAbility publishCallBack====>"); -} - -export default { - onCreate(want) { - console.info('FormAbility onCreate, want:' + JSON.stringify(want)); - let formData = { - temperature: "11°", - time: "11:00", - area: "Shenyang", - epidemic: true, - count: 10 - }; - let bindingData = formBindingData.createFormBindingData(formData); - var commonEventPublishData = { - parameters: { - "kind" : "onCreate", - "parameters" : JSON.stringify(want), - "data" : JSON.stringify(formData) - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - return bindingData; - }, - onUpdate(formId) { - console.info('FormAbility onUpdate, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onUpdate", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onCastToNormal(formId) { - console.info('FormAbility onCastTemp, formId: ' + formId); - - var commonEventPublishData = { - parameters: { - "kind" : "onCastToNormal", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onEvent(formId, message) { - console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); - - var commonEventPublishData = { - parameters: { - "kind" : "onEvent", - "parameters" : formId, - "data" : message - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onVisibilityChange(formEvents) { - console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); - var commonEventPublishData = { - parameters: { - "kind" : "onVisibilityChange", - "parameters" : JSON.stringify(formEvents), - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onDestroy(formId) { - console.info('FormAbility onDestroy, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onDestroy", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.css b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.css deleted file mode 100644 index 4a7a725b7..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.css +++ /dev/null @@ -1,19 +0,0 @@ -#wrapper { - flex-direction: column; -} - -#div1 { - width: 100%; - height: 100%; - justify-content: center; - align-items: center; - background-color: white; -} - -#text1 { - height: 45px; - width: 150px; - font-size: 16px; - text-align: center; -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.hml b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.hml deleted file mode 100644 index cd6106fe7..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.hml +++ /dev/null @@ -1,7 +0,0 @@ -
-
-
- {{title}} -
-
-
\ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.json deleted file mode 100644 index 376c97a90..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "actions": {}, - "data": { - "title": "Hello World" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/element/string.json deleted file mode 100644 index b0e7e3905..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "A提供方" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json deleted file mode 100644 index 20cfeb7f4..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "app": { - "bundleName": "com.form.formsystemtestserviceb.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 9, - "releaseType": "Release", - "target": 9 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.form.formsystemtestserviceb.hmservice", - "name": ".FormSupplyAppB", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "name": ".FormAbility", - "srcPath": "FormAbility", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "formsEnabled": true, - "forms": [ - { - "jsComponentName": "widget", - "isDefault": true, - "formVisibleNotify": true, - "defaultDimension": "1*2", - "name": "Form_Js001", - "description": "This is a form 001", - "colorMode": "auto", - "type": "JS", - "supportDimensions": [ - "1*2", - "2*2" - ], - "updateEnabled": true, - "updateDuration": 1 - }, - { - "jsComponentName":"widget", - "isDefault":false, - "defaultDimension":"2*2", - "formVisibleNotify":true, - "name":"Form_Js002", - "colorMode":"auto", - "description":"This is a form 002", - "supportDimensions":[ - "1*2", - "2*2" - ], - "type":"JS", - "updateEnabled":true, - "scheduledUpdateTime": "10:30" - } - ], - "srcLanguage": "ets" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": "widget", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "type": "form" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/FormAbility/form.ts b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/FormAbility/form.ts deleted file mode 100644 index 09124b5db..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/FormAbility/form.ts +++ /dev/null @@ -1,88 +0,0 @@ -import formBindingData from '@ohos.application.formBindingData' -import commonEvent from '@ohos.commonEvent' - -let supplyForm_Event = "FMS_FormSupply_commonEvent"; - -function publishCallBack() { - console.info("!!!====>FormAbility publishCallBack====>"); -} - -export default { - onCreate(want) { - console.info('FormAbility onCreate, want:' + JSON.stringify(want)); - let formData = { - temperature: "11°", - time: "11:00", - area: "Shenyang", - epidemic: true, - count: 10 - }; - let bindingData = formBindingData.createFormBindingData(formData); - var commonEventPublishData = { - parameters: { - "kind" : "onCreate", - "parameters" : JSON.stringify(want), - "data" : JSON.stringify(formData) - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - return bindingData; - }, - onUpdate(formId) { - console.info('FormAbility onUpdate, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onUpdate", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onCastToNormal(formId) { - console.info('FormAbility onCastTemp, formId: ' + formId); - - var commonEventPublishData = { - parameters: { - "kind" : "onCastToNormal", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onEvent(formId, message) { - console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); - - var commonEventPublishData = { - parameters: { - "kind" : "onEvent", - "parameters" : formId, - "data" : message - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onVisibilityChange(formEvents) { - console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); - var commonEventPublishData = { - parameters: { - "kind" : "onVisibilityChange", - "parameters" : JSON.stringify(formEvents), - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onDestroy(formId) { - console.info('FormAbility onDestroy, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onDestroy", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_list.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_list.svg deleted file mode 100644 index 553da281a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_list.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - ic_list - Created with Sketch. - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_vision.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_vision.svg deleted file mode 100644 index 95f75bf22..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_vision.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - ic_vision - - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/element/string.json deleted file mode 100644 index ae5f28b1d..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "B提供方" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json deleted file mode 100644 index 46fea018c..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "app": { - "bundleName": "com.form.formsystemtestserviced.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 9, - "releaseType": "Release", - "target": 9 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.form.formsystemtestserviced.hmservice", - "name": ".FormSupplyAppD", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "name": ".FormAbility", - "srcPath": "FormAbility", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "formsEnabled": true, - "forms": [ - { - "jsComponentName": "widget", - "isDefault": true, - "formVisibleNotify": false, - "defaultDimension": "1*2", - "name": "Form_Js001", - "description": "This is a form 001", - "colorMode": "auto", - "type": "JS", - "supportDimensions": [ - "1*2", - "2*2" - ], - "updateEnabled": true, - "updateDuration": 1 - }, - { - "jsComponentName":"widget", - "isDefault":false, - "defaultDimension":"2*2", - "formVisibleNotify":true, - "name":"Form_Js002", - "colorMode":"auto", - "description":"This is a form 002", - "supportDimensions":[ - "1*2", - "2*2" - ], - "type":"JS", - "updateEnabled":true, - "scheduledUpdateTime": "10:30" - } - ], - "srcLanguage": "ets" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": "widget", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "type": "form" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/FormAbility/form.ts b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/FormAbility/form.ts deleted file mode 100644 index 33079f82d..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/FormAbility/form.ts +++ /dev/null @@ -1,89 +0,0 @@ -import formBindingData from '@ohos.application.formBindingData' -import formProvider from '@ohos.application.formProvider' -import commonEvent from '@ohos.commonEvent' - -let supplyForm_Event = "FMS_FormSupply_commonEvent"; - -function publishCallBack() { - console.info("!!!====>FormAbility publishCallBack====>"); -} - -export default { - onCreate(want) { - console.info('FormAbility onCreate, want:' + JSON.stringify(want)); - let formData = { - temperature: "11°", - time: "11:00", - area: "Shenyang", - epidemic: true, - count: 10 - }; - let bindingData = formBindingData.createFormBindingData(formData); - let commonEventPublishData = { - parameters: { - "kind" : "onCreate", - "parameters" : JSON.stringify(want), - "data" : JSON.stringify(formData) - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - return bindingData; - }, - onUpdate(formId) { - console.info('FormAbility onUpdate, formId: ' + formId); - let commonEventPublishData = { - parameters: { - "kind" : "onUpdate", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onCastToNormal(formId) { - console.info('FormAbility onCastTemp, formId: ' + formId); - - let commonEventPublishData = { - parameters: { - "kind" : "onCastToNormal", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onEvent(formId, message) { - console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); - - let commonEventPublishData = { - parameters: { - "kind" : "onEvent", - "parameters" : formId, - "data" : message - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onVisibilityChange(formEvents) { - console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); - var commonEventPublishData = { - parameters: { - "kind" : "onVisibilityChange", - "parameters" : JSON.stringify(formEvents), - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onDestroy(formId) { - console.info('FormAbility onDestroy, formId: ' + formId); - let commonEventPublishData = { - parameters: { - "kind" : "onDestroy", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_list.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_list.svg deleted file mode 100644 index 553da281a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_list.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - ic_list - Created with Sketch. - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_vision.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_vision.svg deleted file mode 100644 index 95f75bf22..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_vision.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - ic_vision - - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/element/string.json deleted file mode 100644 index a45f105e0..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "D提供方" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json deleted file mode 100644 index f9c45d5aa..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "app": { - "bundleName": "com.form.formsystemtestservicee.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 9, - "releaseType": "Release", - "target": 9 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.form.formsystemtestservicee.hmservice", - "name": ".FormSupplyAppE", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "name": ".FormAbility", - "srcPath": "FormAbility", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "formsEnabled": true, - "forms": [ - { - "jsComponentName": "widget", - "isDefault": true, - "scheduledUpdateTime": "10:30", - "formVisibleNotify": true, - "defaultDimension": "1*2", - "name": "Form_Js001", - "description": "This is a form 001", - "colorMode": "auto", - "type": "JS", - "supportDimensions": [ - "1*2", - "2*2" - ], - "updateEnabled": true, - "updateDuration": 1 - }, - { - "jsComponentName":"widget", - "isDefault":false, - "defaultDimension":"2*2", - "formVisibleNotify":true, - "name":"Form_Js002", - "colorMode":"auto", - "description":"This is a form 002", - "supportDimensions":[ - "1*2", - "2*2" - ], - "type":"JS", - "updateEnabled":true, - "updateDuration":1 - } - ], - "srcLanguage": "ets" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": "widget", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "type": "form" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/FormAbility/form.ts b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/FormAbility/form.ts deleted file mode 100644 index df452bf7b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/FormAbility/form.ts +++ /dev/null @@ -1,99 +0,0 @@ -import formBindingData from '@ohos.application.formBindingData' -import commonEvent from '@ohos.commonEvent' - -let supplyForm_Event = "FMS_FormSupply_commonEvent"; - -function publishCallBack() { - console.info("!!!====>FormAbility publishCallBack====>"); -} - -export default { - onCreate(want) { - console.info('FormAbility onCreate, want:' + JSON.stringify(want)); - let formData = { - "temperature":"11c", - "time":"11:00", - "test":11, - "test3":true, - "test_over_1k":'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of' - }; - let bindingData = formBindingData.createFormBindingData(formData); - var commonEventPublishData = { - parameters: { - "kind" : "onCreate", - "parameters" : JSON.stringify(want), - "data" : JSON.stringify(formData) - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - return bindingData; - }, - onUpdate(formId) { - console.info('FormAbility onUpdate, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onUpdate", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onCastToNormal(formId) { - console.info('FormAbility onCastTemp, formId: ' + formId); - - var commonEventPublishData = { - parameters: { - "kind" : "onCastToNormal", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onEvent(formId, message) { - console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); - - var commonEventPublishData = { - parameters: { - "kind" : "onEvent", - "parameters" : formId, - "data" : message - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onVisibilityChange(formEvents) { - console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); - var commonEventPublishData = { - parameters: { - "kind" : "onVisibilityChange", - "parameters" : JSON.stringify(formEvents), - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onDestroy(formId) { - console.info('FormAbility onDestroy, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onDestroy", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_list.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_list.svg deleted file mode 100644 index 553da281a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_list.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - ic_list - Created with Sketch. - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_vision.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_vision.svg deleted file mode 100644 index 95f75bf22..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_vision.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - ic_vision - - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/element/string.json deleted file mode 100644 index b0e7e3905..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "A提供方" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/FormAbility/form.ts b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/FormAbility/form.ts deleted file mode 100644 index ad6974bb1..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/FormAbility/form.ts +++ /dev/null @@ -1,143 +0,0 @@ -import commonEvent from '@ohos.commonEvent'; -import formBindingData from '@ohos.application.formBindingData'; -import formProvider from '@ohos.application.formProvider'; -import {getCurrentTime} from '@ohos.systemTime'; - -let supplyForm_Event = "FMS_FormSupply_commonEvent"; - -function publishCallBack() { - console.info("!!!====>FormAbility publishCallBack====>"); -} - -export default { - async onCreate(want) { - const time = await getCurrentTime(); - console.info('FormAbility onCreate, want:' + JSON.stringify(want)); - let formData = { - temperature: "11°", - time: "11:00", - area: "Shenyang", - epidemic: true, - count: 10 - }; - let bindingData = formBindingData.createFormBindingData(formData); - var commonEventPublishData = { - parameters: { - "kind": "onCreate", - "parameters": JSON.stringify(want), - "data": JSON.stringify(formData), - "time": time - } - }; - console.info(`FormAbility data ${JSON.stringify(commonEventPublishData)}`); - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - return bindingData; - }, - async onUpdate(formId) { - const time = await getCurrentTime(); - console.info('FormAbility onUpdate, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind": "onUpdate", - "parameters": formId, - "data": "", - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - async onCastToNormal(formId) { - const time = await getCurrentTime(); - console.info('FormAbility onCastTemp, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind": "onCastToNormal", - "parameters": formId, - "data": "", - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - async onEvent(formId, message) { - const time = await getCurrentTime(); - console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); - var commonEventPublishData = { - parameters: { - "kind": "onEvent", - "parameters": formId, - "data": message, - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - async onVisibilityChange(formEvents) { - const time = await getCurrentTime(); - console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); - var commonEventPublishData = { - parameters: { - "kind": "onVisibilityChange", - "parameters": JSON.stringify(formEvents), - "data": "", - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - - for (let key in formEvents) { - const value = formEvents[key]; - key = key.toString(); - console.log('form_extension onVisibilityChange, key:' + key + ", value=" + value); - let dataObj = { - temperature: "22°", - time: "22:00", - test: 22, - }; - let obj = formBindingData.createFormBindingData(dataObj); - - const updateFormStartTime = await getCurrentTime(); - let data = await formProvider.updateForm(key, obj); - console.info('FormAbility onUpdateForm, res: ' + data); - const updateFormEndTime = await getCurrentTime(); - - commonEventPublishData = { - parameters: { - "kind": "onUpdateForm", - "parameters": key, - "data": "", - "time": updateFormEndTime - updateFormStartTime - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - - const setFormNextRefreshTimeStartTime = await getCurrentTime(); - data = await formProvider.setFormNextRefreshTime(key, 5); - console.info('FormAbility setFormNextRefreshTime, res: ' + data); - const setFormNextRefreshTimeEndTime = await getCurrentTime(); - - commonEventPublishData = { - parameters: { - "kind": "onSetFormNextRefreshTime", - "parameters": key, - "data": "", - "time": setFormNextRefreshTimeEndTime - setFormNextRefreshTimeStartTime - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } - }, - async onDestroy(formId) { - const time = await getCurrentTime(); - console.info('FormAbility onDestroy, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind": "onDestroy", - "parameters": formId, - "data": "", - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_list.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_list.svg deleted file mode 100644 index 553da281a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_list.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - ic_list - Created with Sketch. - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_vision.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_vision.svg deleted file mode 100644 index 95f75bf22..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_vision.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - ic_vision - - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/element/string.json deleted file mode 100644 index ff87c28c2..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "提供方F" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json deleted file mode 100644 index 3c93e4061..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "app": { - "bundleName": "com.form.formsystemtestserviceg.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 9, - "releaseType": "Release", - "target": 9 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.form.formsystemtestserviceg.hmservice", - "name": ".FormSupplyAppG", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "name": ".FormAbility", - "srcPath": "FormAbility", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "formsEnabled": true, - "forms": [ - { - "jsComponentName": "Form_Js001", - "isDefault": true, - "scheduledUpdateTime": "10:30", - "formVisibleNotify": true, - "defaultDimension": "1*2", - "name": "Form_Js001", - "description": "This is a form widget", - "colorMode": "auto", - "type": "JS", - "supportDimensions": [ - "1*2", "2*2" - ], - "updateEnabled": true, - "updateDuration": 1 - } - ], - "srcLanguage": "ets" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": "Form_Js001", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "type": "form" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "reason": "need use FormSupply commonEvent", - "name": "FMS_FormSupply_commonEvent" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/FormAbility/form.ts b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/FormAbility/form.ts deleted file mode 100644 index 504d3c667..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/FormAbility/form.ts +++ /dev/null @@ -1,155 +0,0 @@ -import commonEvent from '@ohos.commonEvent'; -import formBindingData from '@ohos.application.formBindingData'; -import formProvider from '@ohos.application.formProvider'; -import {getCurrentTime} from '@ohos.systemTime'; - -let supplyForm_Event = "FMS_FormSupply_commonEvent"; - -function publishCallBack() { - console.info("!!!====>FormAbility publishCallBack====>"); -} - -export default { - async onCreate(want) { - const time = await getCurrentTime(); - console.info('FormAbility onCreate, want:' + JSON.stringify(want)); - let formData = { - temperature: "11°", - time: "11:00", - area: "Shenyang", - epidemic: true, - "test_over_1k":'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of', - count: 10 - }; - let bindingData = formBindingData.createFormBindingData(formData); - var commonEventPublishData = { - parameters: { - "kind": "onCreate", - "parameters": JSON.stringify(want), - "data": JSON.stringify(formData), - "time": time - } - }; - console.info(`FormAbility data ${JSON.stringify(commonEventPublishData)}`); - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - return bindingData; - }, - async onUpdate(formId) { - const time = await getCurrentTime(); - console.info('FormAbility onUpdate, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind": "onUpdate", - "parameters": formId, - "data": "", - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - async onCastToNormal(formId) { - const time = await getCurrentTime(); - console.info('FormAbility onCastTemp, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind": "onCastToNormal", - "parameters": formId, - "data": "", - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - async onEvent(formId, message) { - const time = await getCurrentTime(); - console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); - var commonEventPublishData = { - parameters: { - "kind": "onEvent", - "parameters": formId, - "data": message, - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - async onVisibilityChange(formEvents) { - const time = await getCurrentTime(); - console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); - var commonEventPublishData = { - parameters: { - "kind": "onVisibilityChange", - "parameters": JSON.stringify(formEvents), - "data": "", - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - - for (let key in formEvents) { - const value = formEvents[key]; - key = key.toString(); - console.log('form_extension onVisibilityChange, key:' + key + ", value=" + value); - let dataObj = { - temperature: "22°", - time: "22:00", - test: 22, - }; - let obj = formBindingData.createFormBindingData(dataObj); - - const updateFormStartTime = await getCurrentTime(); - let data = await formProvider.updateForm(key, obj); - console.info('FormAbility onUpdateForm, res: ' + data); - const updateFormEndTime = await getCurrentTime(); - - commonEventPublishData = { - parameters: { - "kind": "onUpdateForm", - "parameters": key, - "data": "", - "time": updateFormEndTime - updateFormStartTime - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - - const setFormNextRefreshTimeStartTime = await getCurrentTime(); - data = await formProvider.setFormNextRefreshTime(key, 5); - console.info('FormAbility setFormNextRefreshTime, res: ' + data); - const setFormNextRefreshTimeEndTime = await getCurrentTime(); - - commonEventPublishData = { - parameters: { - "kind": "onSetFormNextRefreshTime", - "parameters": key, - "data": "", - "time": setFormNextRefreshTimeEndTime - setFormNextRefreshTimeStartTime - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } - }, - async onDestroy(formId) { - const time = await getCurrentTime(); - console.info('FormAbility onDestroy, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind": "onDestroy", - "parameters": formId, - "data": "", - "time": time - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_list.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_list.svg deleted file mode 100644 index 553da281a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_list.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - ic_list - Created with Sketch. - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_vision.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_vision.svg deleted file mode 100644 index 95f75bf22..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_vision.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - ic_vision - - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 28dbacf9a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "提供方G" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json deleted file mode 100644 index 8b65064d6..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "app": { - "bundleName": "com.form.formsystemtestserviceh.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 9, - "releaseType": "Release", - "target": 9 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.form.formsystemtestserviceh.hmservice", - "name": ".FormSupplyAppH", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "name": ".FormAbility", - "srcPath": "FormAbility", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "formsEnabled": true, - "forms": [ - { - "jsComponentName": "widget", - "isDefault": true, - "scheduledUpdateTime": "10:30", - "formVisibleNotify": true, - "defaultDimension": "1*2", - "name": "Form_Js001", - "description": "This is a form 001", - "colorMode": "auto", - "type": "JS", - "supportDimensions": [ - "1*2", - "2*2" - ], - "updateEnabled": true, - "updateDuration": 1 - }, - { - "jsComponentName":"widget", - "isDefault":false, - "defaultDimension":"2*2", - "formVisibleNotify":true, - "name":"Form_Js002", - "colorMode":"auto", - "description":"This is a form 002", - "supportDimensions":[ - "1*2", - "2*2" - ], - "type":"JS", - "updateEnabled":true, - "updateDuration":1 - } - ], - "srcLanguage": "ets" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": "widget", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "type": "form" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/FormAbility/form.ts b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/FormAbility/form.ts deleted file mode 100644 index df452bf7b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/FormAbility/form.ts +++ /dev/null @@ -1,99 +0,0 @@ -import formBindingData from '@ohos.application.formBindingData' -import commonEvent from '@ohos.commonEvent' - -let supplyForm_Event = "FMS_FormSupply_commonEvent"; - -function publishCallBack() { - console.info("!!!====>FormAbility publishCallBack====>"); -} - -export default { - onCreate(want) { - console.info('FormAbility onCreate, want:' + JSON.stringify(want)); - let formData = { - "temperature":"11c", - "time":"11:00", - "test":11, - "test3":true, - "test_over_1k":'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of' - }; - let bindingData = formBindingData.createFormBindingData(formData); - var commonEventPublishData = { - parameters: { - "kind" : "onCreate", - "parameters" : JSON.stringify(want), - "data" : JSON.stringify(formData) - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - return bindingData; - }, - onUpdate(formId) { - console.info('FormAbility onUpdate, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onUpdate", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onCastToNormal(formId) { - console.info('FormAbility onCastTemp, formId: ' + formId); - - var commonEventPublishData = { - parameters: { - "kind" : "onCastToNormal", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onEvent(formId, message) { - console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); - - var commonEventPublishData = { - parameters: { - "kind" : "onEvent", - "parameters" : formId, - "data" : message - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onVisibilityChange(formEvents) { - console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); - var commonEventPublishData = { - parameters: { - "kind" : "onVisibilityChange", - "parameters" : JSON.stringify(formEvents), - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onDestroy(formId) { - console.info('FormAbility onDestroy, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onDestroy", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_list.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_list.svg deleted file mode 100644 index 553da281a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_list.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - ic_list - Created with Sketch. - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_vision.svg b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_vision.svg deleted file mode 100644 index 95f75bf22..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_vision.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - ic_vision - - - - - \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 301452040..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "H提供方" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/Test.json deleted file mode 100644 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json deleted file mode 100644 index ce21273b4..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "app": { - "bundleName": "com.form.formsystemtestservicenotsysapp.hmservice", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 9, - "releaseType": "Release", - "target": 9 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.form.formsystemtestservicenotsysapp.hmservice", - "name": ".FormSupplyAppNS", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "name": ".FormAbility", - "srcPath": "FormAbility", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "formsEnabled": true, - "forms": [ - { - "jsComponentName": "Form_Js001", - "isDefault": true, - "scheduledUpdateTime": "10:30", - "formVisibleNotify": true, - "defaultDimension": "1*2", - "name": "Form_Js001", - "description": "This is a form 001", - "colorMode": "auto", - "type": "JS", - "supportDimensions": [ - "1*2", - "2*2" - ], - "updateEnabled": true, - "updateDuration": 1 - }, - { - "jsComponentName":"Form_Js002", - "isDefault":false, - "defaultDimension":"2*2", - "formVisibleNotify":true, - "name":"Form_Js002", - "colorMode":"auto", - "description":"This is a form 002", - "supportDimensions":[ - "1*2", - "2*2" - ], - "type":"JS", - "updateEnabled":true, - "updateDuration":1 - } - ], - "srcLanguage": "ets" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index", - "pages/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": "Form_Js001", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "type": "form" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "reason": "need use FormSupply commonEvent", - "name": "FMS_FormSupply_commonEvent" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/FormAbility/form.ts b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/FormAbility/form.ts deleted file mode 100644 index df452bf7b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/FormAbility/form.ts +++ /dev/null @@ -1,99 +0,0 @@ -import formBindingData from '@ohos.application.formBindingData' -import commonEvent from '@ohos.commonEvent' - -let supplyForm_Event = "FMS_FormSupply_commonEvent"; - -function publishCallBack() { - console.info("!!!====>FormAbility publishCallBack====>"); -} - -export default { - onCreate(want) { - console.info('FormAbility onCreate, want:' + JSON.stringify(want)); - let formData = { - "temperature":"11c", - "time":"11:00", - "test":11, - "test3":true, - "test_over_1k":'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + - 'test over 1k of data,test over 1k of' - }; - let bindingData = formBindingData.createFormBindingData(formData); - var commonEventPublishData = { - parameters: { - "kind" : "onCreate", - "parameters" : JSON.stringify(want), - "data" : JSON.stringify(formData) - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - return bindingData; - }, - onUpdate(formId) { - console.info('FormAbility onUpdate, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onUpdate", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onCastToNormal(formId) { - console.info('FormAbility onCastTemp, formId: ' + formId); - - var commonEventPublishData = { - parameters: { - "kind" : "onCastToNormal", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onEvent(formId, message) { - console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); - - var commonEventPublishData = { - parameters: { - "kind" : "onEvent", - "parameters" : formId, - "data" : message - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onVisibilityChange(formEvents) { - console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); - var commonEventPublishData = { - parameters: { - "kind" : "onVisibilityChange", - "parameters" : JSON.stringify(formEvents), - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - }, - onDestroy(formId) { - console.info('FormAbility onDestroy, formId: ' + formId); - var commonEventPublishData = { - parameters: { - "kind" : "onDestroy", - "parameters" : formId, - "data" : "" - } - }; - commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.css b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.css deleted file mode 100644 index 4a7a725b7..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.css +++ /dev/null @@ -1,19 +0,0 @@ -#wrapper { - flex-direction: column; -} - -#div1 { - width: 100%; - height: 100%; - justify-content: center; - align-items: center; - background-color: white; -} - -#text1 { - height: 45px; - width: 150px; - font-size: 16px; - text-align: center; -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.hml b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.hml deleted file mode 100644 index cd6106fe7..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.hml +++ /dev/null @@ -1,7 +0,0 @@ -
-
-
- {{title}} -
-
-
\ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.json deleted file mode 100644 index 376c97a90..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "actions": {}, - "data": { - "title": "Hello World" - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/element/string.json deleted file mode 100644 index fd46026c3..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "NS提供方" - }, - { - "name": "description_mainability", - "value": "eTS_Empty Ability" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/BUILD.gn deleted file mode 100644 index 704384d58..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemProviderA") { - hap_name = "FormSystemProviderA" - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/Test.json deleted file mode 100644 index ba2697bb6..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json deleted file mode 100644 index c787cdca9..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json +++ /dev/null @@ -1,173 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemprovidera", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemprovidera", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "form_module_a", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "launchType": "standard", - "formsEnabled": true, - "forms": [ - { - "name": "FormA_Js001", - "description": "form_description_FormA_Js001", - "descriptionId": 0, - "isDefault": true, - "type": "JS", - "colorMode": "dark", - "supportDimensions": [ - "1*2", - "2*4" - ], - "defaultDimension": "1*2", - "updateEnabled": true, - "updateDuration": 1, - "scheduledUpdateTime": "5:30", - "jsComponentName": "card_a01", - "formVisibleNotify": true, - "formConfigAbility": "abilitya01", - "metaData": { - "customizeData": [ - { - "name": "originWidgetNameA01", - "value": "valueA01" - } - ] - } - }, - { - "name": "FormA_Js002", - "description": "form_description_FormA_Js002", - "descriptionId": 10, - "isDefault": false, - "type": "JS", - "colorMode": "light", - "supportDimensions": [ - "1*2", - "2*2", - "2*4", - "4*4" - ], - "defaultDimension": "4*4", - "updateEnabled": false, - "updateDuration": 2, - "scheduledUpdateTime": "20:30", - "jsComponentName": "card_a02", - "formVisibleNotify": false, - "formConfigAbility": "abilitya02", - "metaData": { - "customizeData": [ - { - "name": "originWidgetNameA02", - "value": "valueA02" - } - ] - } - } - ] - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 75488d282..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info(`[FormProviderA] Application onCreate`); - }, - onDestroy() { - console.info(`[FormProviderA] Application onDestroy`); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index b4961ada0..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; - -@Entry -@Component -struct Index { - private componentName: string = `FormProviderA`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`Fms Main Ability Test`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/BUILD.gn deleted file mode 100644 index d7a47b5f3..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemProviderB") { - hap_name = "FormSystemProviderB" - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/Test.json deleted file mode 100644 index ba2697bb6..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json deleted file mode 100644 index 07b1dea2c..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemproviderb", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemproviderb", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "form_module_b", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "launchType": "standard", - "formsEnabled": true, - "forms": [ - { - "name": "FormB_Js001", - "description": "form_description_FormB_Js001", - "descriptionId": 20, - "isDefault": true, - "type": "JS", - "colorMode": "auto", - "supportDimensions": [ - "1*2", - "2*2" - ], - "defaultDimension": "2*2", - "updateEnabled": true, - "updateDuration": 3, - "scheduledUpdateTime": "10:30", - "jsComponentName": "card_b", - "formVisibleNotify": true, - "formConfigAbility": "abilityb", - "metaData": { - "customizeData": [ - { - "name": "originWidgetNameB", - "value": "valueB" - } - ] - } - } - ] - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 50544f4d1..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info(`[FormProviderB] Application onCreate`); - }, - onDestroy() { - console.info(`[FormProviderB] Application onDestroy`); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 0dd3a2712..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; - -@Entry -@Component -struct Index { - private componentName: string = `FormProviderB`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`Fms Main Ability Test`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/BUILD.gn deleted file mode 100644 index a7c6d7d52..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemProviderC") { - hap_name = "FormSystemProviderC" - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/Test.json deleted file mode 100644 index ba2697bb6..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json deleted file mode 100644 index fc493c12b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemproviderc", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemproviderc", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "form_module_c", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "launchType": "standard", - "formsEnabled": true, - "forms": [ - { - "name": "FormC_Js001", - "description": "form_description_FormC_Js001", - "descriptionId": 30, - "isDefault": true, - "type": "JS", - "colorMode": "light", - "supportDimensions": [ - "2*4", - "4*4" - ], - "defaultDimension": "2*4", - "updateEnabled": true, - "updateDuration": 4, - "scheduledUpdateTime": "15:30", - "jsComponentName": "card_c", - "formVisibleNotify": true, - "formConfigAbility": "abilityc", - "metaData": { - "customizeData": [ - { - "name": "originWidgetNameC", - "value": "valueC" - } - ] - } - } - ] - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 351831bdb..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info(`[FormProviderC] Application onCreate`); - }, - onDestroy() { - console.info(`[FormProviderC] Application onDestroy`); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index c5a604a52..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; - -@Entry -@Component -struct Index { - private componentName: string = `FormProviderC`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`Fms Main Ability Test`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/BUILD.gn deleted file mode 100644 index 72166fbfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("FormSystemProviderD") { - hap_name = "FormSystemProviderD" - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/Test.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/Test.json deleted file mode 100644 index ba2697bb6..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json deleted file mode 100644 index b1f13b2f1..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsystemproviderd", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsystemproviderd", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "form_module_d", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "service", - "launchType": "standard", - "formsEnabled": true, - "forms": [] - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 67d9addd8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info(`[FormProviderD] Application onCreate`); - }, - onDestroy() { - console.info(`[FormProviderD] Application onDestroy`); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 890ece665..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; - -@Entry -@Component -struct Index { - private componentName: string = `FormProviderD`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`Fms Main Ability Test`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets deleted file mode 100644 index 19e275de9..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { beforeEach, describe, expect, it } from "deccjsunit/index"; - -var onErrorForm_Event = { - events: ["FMS_FormOnError_commonEvent"], -}; -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; -var subscriberFormCastEvent = { - events: ["FMS_FormCast_commonEvent"], -}; -var onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - -var subscriberOnError; -var subscriberOnAcquired; -var subscriberCast; -var subscriberSupply; - -export default function test() { - describe(`FmsAcquiredFormTest`, () => { - - beforeEach(async () => { - subscriberOnError = await commonEvent.createSubscriber(onErrorForm_Event); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberCast = await commonEvent.createSubscriber(subscriberFormCastEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - await sleep(1000); - }) - - /** - * @tc.number: FMS_acquireForm_0200 - * @tc.name: The form host does not have permission to use the form - * @tc.desc: Failed to create a form when verifying that the form host does not have form permission. - */ - it(`FMS_acquireForm_0200`, 0, async (done) => { - console.info(`FMS_acquireForm_0200 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_0200 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("check permission deny, need to request ohos.permission.REQUIRE_FORM."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0200")); - console.info(`FMS_acquireForm_0200 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_0200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostnoperm", - abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_0200 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_0300 - * @tc.name: Failed to add form when parameter formId is wrong. - * @tc.desc: Failed to create form when verifying that the parameter (formId) of creating form is wrong. - */ - it(`FMS_acquireForm_0300`, 0, async (done) => { - console.info(`FMS_acquireForm_0300 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_0300 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0300")); - console.info(`FMS_acquireForm_0300 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_0300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "-1", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_0300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_0400 - * @tc.name: Failed to add form when parameter bundlename is wrong. - * @tc.desc: Form creation failed when verifying the wrong parameter (bundlename) of form creation. - */ - it(`FMS_acquireForm_0400`, 0, async (done) => { - console.info(`FMS_acquireForm_0400 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_0400 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0400")); - console.info(`FMS_acquireForm_0400 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_0400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "-1", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice123", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_0400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_0500 - * @tc.name: Failed to add form when parameter moduleName is wrong. - * @tc.desc: Form creation failed when verifying the wrong parameter (moduleName) of form creation. - */ - it(`FMS_acquireForm_0500`, 0, async (done) => { - console.info(`FMS_acquireForm_0500 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_0500 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0500")); - console.info(`FMS_acquireForm_0500 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_0500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "-1", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry123", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_0500 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_0600 - * @tc.name: Failed to add form when parameter formName is wrong. - * @tc.desc: Form creation failed when verifying the wrong parameter (formName) of form creation. - */ - it(`FMS_acquireForm_0600`, 0, async (done) => { - console.info(`FMS_acquireForm_0600 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_0600 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0600")); - console.info(`FMS_acquireForm_0600 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_0600 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "-1", - "name": "Form_Js001987", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_0600 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_0700 - * @tc.name: Failed to add form when parameter abilityName is wrong. - * @tc.desc: Form creation failed when verifying the wrong parameter (abilityName) of form creation. - */ - it(`FMS_acquireForm_0700`, 0, async (done) => { - console.info(`FMS_acquireForm_0700 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_0700 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0700")); - console.info(`FMS_acquireForm_0700 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_0700 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "-1", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility123", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_0700 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_1000 - * @tc.name: Failed to add form when parameter form dimension is wrong. - * @tc.desc: Form creation failed when verifying the wrong parameter (form dimension) of form creation. - */ - it(`FMS_acquireForm_1000`, 0, async (done) => { - console.info(`FMS_acquireForm_1000 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_1000 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_1000")); - console.info(`FMS_acquireForm_1000 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_1000 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "-1", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "dimension": 4, - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_1000 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_acquireForm_1100 - * @tc.name: When the formId is set to 0, a non cached form is added. - * @tc.desc: Verify that the non cache form can be successfully created. - */ - it(`FMS_acquireForm_1100`, 0, async (done) => { - console.info(`FMS_acquireForm_1100 start`); - let formId1; - let formId2; - - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_1100 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1100")); - formId1 = data.data; - - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1100", done)); - } - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onCreate") { - console.info("====>FMS_acquireForm_1100 onSupplyCallBack====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_1100")); - let retData = JSON.parse(data.parameters.parameters); - - let bundleName = retData.bundleName; - expect(bundleName).assertEqual("com.form.formsystemtestservicea.hmservice"); - let abilityName = retData.abilityName; - expect(abilityName).assertEqual("com.form.formsystemtestservicea.hmservice.FormAbility"); - let moduleName = retData.parameters['ohos.extra.param.key.module_name']; - expect(moduleName).assertEqual("entry"); - let formName = retData.parameters['ohos.extra.param.key.form_name']; - expect(formName).assertEqual("Form_Js001"); - let formDimension = retData.parameters['ohos.extra.param.key.form_dimension']; - expect(formDimension).assertEqual(1); - let tempFormFlag = retData.parameters['ohos.extra.param.key.form_temporary']; - expect(tempFormFlag).assertEqual(false); - - formId2 = retData.parameters['ohos.extra.param.key.form_identity']; - - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1100", done)); - } - } - } - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.info(`FMS_acquireForm_1100 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_1100 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_acquireForm_1200 - * @tc.name: When the formId is set to 0, a non cached form is added. - * @tc.desc: Verify that the non cache form can be successfully created. - */ - it(`FMS_acquireForm_1200`, 0, async (done) => { - console.info(`FMS_acquireForm_1200 start`); - let formId1; - let formId2; - - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_1200 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1200")) - formId1 = data.data; - console.info("!!!====>FMS_acquireForm_1200 onAcquiredCallBack formId1:====>" + formId1); - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1200", done)); - } - } - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onCreate") { - console.info("====>FMS_acquireForm_1200 onSupplyCallBack====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_1200")); - let retData = JSON.parse(data.parameters.parameters); - - let bundleName = retData.bundleName; - expect(bundleName).assertEqual("com.form.formsystemtestservicee.hmservice"); - let abilityName = retData.abilityName; - expect(abilityName).assertEqual("com.form.formsystemtestservicee.hmservice.FormAbility"); - let moduleName = retData.parameters['ohos.extra.param.key.module_name']; - expect(moduleName).assertEqual("entry"); - let formName = retData.parameters['ohos.extra.param.key.form_name']; - expect(formName).assertEqual("Form_Js001"); - let formDimension = retData.parameters['ohos.extra.param.key.form_dimension']; - expect(formDimension).assertEqual(1); - let tempFormFlag = retData.parameters['ohos.extra.param.key.form_temporary']; - expect(tempFormFlag).assertEqual(false); - - formId2 = retData.parameters['ohos.extra.param.key.form_identity']; - console.info("!!!====>FMS_acquireForm_1200 onSupplyCallBack formId2:====>" + formId2); - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1200", done)); - } - } - } - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.info(`FMS_acquireForm_1200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostb", - abilityName: "com.ohos.st.formsystemhostb.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicee.hmservice", - "ability": "com.form.formsystemtestservicee.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_1200 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_1400 - * @tc.name: FormId does not match other parameters when adding a cached form. - * @tc.desc: Failed to create a cached form when verifying that FormId does not match other parameters. - */ - it(`FMS_acquireForm_1400`, 0, async (done) => { - console.info(`FMS_acquireForm_1400 start`); - var formId; - - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_1400 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("the requested form id is not existed on fms."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallBackCache("FMS_acquireForm_1400")); - var commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1400", done)); - } - async function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_1400 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1400")) - formId = data.data; - // add cache form - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_1400 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "1", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_1400 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.info(`FMS_acquireForm_1400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_1400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_1500 - * @tc.name: Add a cached form. - * @tc.desc: Verify that the cached form can be successfully created. - */ - it(`FMS_acquireForm_1500`, 0, async (done) => { - console.info(`FMS_acquireForm_1500 start`); - let formId1; - let formId2; - let onCreateCount = 0; - - function onAcquiredCallBackCache(_, data) { - console.info("!!!====>FMS_acquireForm_1500 onAcquiredCallBackCache data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallBackCache("FMS_acquireForm_1500")); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - formId2 = data.data; - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1500", done)); - } - } - async function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_1500 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1500")) - formId1 = data.data; - // add cache form - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBackCache); - console.info(`FMS_acquireForm_1500 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostb", - abilityName: "com.ohos.st.formsystemhostb.MainAbility", - parameters: { - "formId": formId1, - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_1500 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onCreate") { - console.info("====>FMS_acquireForm_1500 onSupplyCallBack====>" + JSON.stringify(data)); - onCreateCount++; - if (onCreateCount == 2) { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_1500")) - } - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1500", done)); - } - } - } - - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.info(`FMS_acquireForm_1500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_1500 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_acquireForm_1600 - * @tc.name: A single form host (using a single thread) continuously creates 2 normal and 2 temporary forms. - * @tc.desc: Verify that a single host (using a single thread) can successfully create multiple normal - * and temporary forms continuously. - */ - it(`FMS_acquireForm_1600`, 0, async (done) => { - console.info(`FMS_acquireForm_1600 start`); - - function delPublishCallBack_Normal1() { - console.info("!!!====>FMS_acquireForm_1600 delPublishCallBack_Normal1====>"); - setTimeout(function () { - console.info('FMS_acquireForm_1600 delPublishCallBack_Normal1 end'); - FMS_acquireForm_1600_normal2(); - }, 50); - } - function onAcquiredCallBack_Normal1(_, data) { - console.info("!!!====>FMS_acquireForm_1600 onAcquiredCallBack_Normal1 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal1) - var commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhost", - data: data.data - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Normal1); - } - function unSubscribeOnAcquiredCallBack_Normal1() { - console.info("====>FMS_acquireForm_1600 unSubscribeOnAcquiredCallBack_Normal1 CallBack====>"); - } - - async function FMS_acquireForm_1600_normal1() { - console.info(`FMS_acquireForm_1600_normal1 start`); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal1); - console.info(`FMS_acquireForm_1600_normal1 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1600_normal1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1600_normal1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1600_normal1 featureAbility.startAbility end`); - console.info(`FMS_acquireForm_1600_normal1 end`); - } - - function delPublishCallBack_Normal2() { - console.info("!!!====>FMS_acquireForm_1600 delPublishCallBack_Normal2====>"); - setTimeout(function () { - console.info('FMS_acquireForm_1600 delPublishCallBack_Normal2 end'); - FMS_acquireForm_1600_Temp1(); - }, 50); - } - function onAcquiredCallBack_Normal2(_, data) { - console.info("!!!====>FMS_acquireForm_1600 onAcquiredCallBack_Normal2 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal2) - var commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhost", - data: data.data - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Normal2); - } - function unSubscribeOnAcquiredCallBack_Normal2() { - console.info("====>FMS_acquireForm_1600 unSubscribeOnAcquiredCallBack_Normal2====>"); - } - async function FMS_acquireForm_1600_normal2() { - console.info(`FMS_acquireForm_1600_normal2 start`); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal2); - console.info(`FMS_acquireForm_1600_normal2 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1600_normal2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1600_normal2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1600_normal2 featureAbility.startAbility end`); - console.info(`FMS_acquireForm_1600_normal2 end`); - } - - function delPublishCallBack_Temp1() { - console.info("!!!====>FMS_acquireForm_1600 delPublishCallBack_Temp1====>"); - setTimeout(function () { - console.info('FMS_acquireForm_1600 delPublishCallBack_Temp1 end'); - FMS_acquireForm_1600_Temp2(); - }, 50); - } - function onAcquiredCallBack_Temp1(_, data) { - console.info("!!!====>FMS_acquireForm_1600 onAcquiredCallBack_Temp1 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Temp1) - var commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhost", - data: data.data - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Temp1); - } - function unSubscribeOnAcquiredCallBack_Temp1() { - console.info("====>FMS_acquireForm_1600 unSubscribeOnAcquiredCallBack_Temp1====>"); - } - - async function FMS_acquireForm_1600_Temp1() { - console.info(`FMS_acquireForm_1600_Temp1 start`); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Temp1); - console.info(`FMS_acquireForm_1600_Temp1 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1600_Temp1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1600_Temp1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1600_Temp1 featureAbility.startAbility end`); - console.info(`FMS_acquireForm_1600_Temp1 end`); - } - - function delPublishCallBack_Temp2() { - console.info("!!!====>FMS_acquireForm_1600 delPublishCallBack_Temp2====>"); - setTimeout(function () { - console.info('FMS_acquireForm_1600 delPublishCallBack_Temp2 end'); - console.info(`FMS_acquireForm_1600 end`); - done(); - }, 500); - } - function onAcquiredCallBack_Temp2(_, data) { - console.info("!!!====>FMS_acquireForm_1600 onAcquiredCallBack_Temp2 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Temp2) - var commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhost", - data: data.data - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Temp2); - } - function unSubscribeOnAcquiredCallBack_Temp2() { - console.info("====>FMS_acquireForm_1600 unSubscribeOnAcquiredCallBack_Temp2====>"); - } - - async function FMS_acquireForm_1600_Temp2() { - console.info(`FMS_acquireForm_1600_Temp2 start`); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Temp2); - console.info(`FMS_acquireForm_1600_Temp2 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1600_Temp2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1600_Temp2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1600_Temp2 featureAbility.startAbility end`); - console.info(`FMS_acquireForm_1600_Temp2 end`); - } - - FMS_acquireForm_1600_normal1(); - }); - /** - * @tc.number: FMS_acquireForm_1800 - * @tc.name: Multiple form hosts create one normal form and one temporary form respectively. - * @tc.desc: Verify that multiple hosts can successfully create multiple normal and temporary forms respectively. - */ - it(`FMS_acquireForm_1800`, 0, async (done) => { - console.info(`FMS_acquireForm_1800 start`); - - function delPublishCallBack_Normal1() { - console.info("!!!====>FMS_acquireForm_1800 delPublishCallBack_Normal1====>"); - setTimeout(function () { - console.info('FMS_acquireForm_1800 delPublishCallBack_Normal1 end'); - FMS_acquireForm_1800_normal2(); - }, 50); - } - function onAcquiredCallBack_Normal1(_, data) { - console.info("!!!====>FMS_acquireForm_1800 onAcquiredCallBack_Normal1 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal1) - var commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhost", - data: data.data - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Normal1); - } - function unSubscribeOnAcquiredCallBack_Normal1() { - console.info("====>FMS_acquireForm_1800 unSubscribeOnAcquiredCallBack_Normal1 CallBack====>"); - } - - async function FMS_acquireForm_1800_normal1() { - console.info(`FMS_acquireForm_1800_normal1 start`); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal1); - - console.info(`FMS_acquireForm_1800_normal1 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1800_normal1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1800_normal1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1800_normal1 featureAbility.startAbility end`); - console.info(`FMS_acquireForm_1800_normal1 end`); - } - - function delPublishCallBack_Normal2() { - console.info("!!!====>FMS_acquireForm_1800 delPublishCallBack_Normal2====>"); - setTimeout(function () { - console.info('FMS_acquireForm_1800 delPublishCallBack_Normal2 end'); - FMS_acquireForm_1800_Temp1(); - }, 50); - } - function onAcquiredCallBack_Normal2(_, data) { - console.info("!!!====>FMS_acquireForm_1800 onAcquiredCallBack_Normal2 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal2) - var commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostb", - data: data.data - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Normal2); - } - function unSubscribeOnAcquiredCallBack_Normal2() { - console.info("====>FMS_acquireForm_1800 unSubscribeOnAcquiredCallBack_Normal2====>"); - } - async function FMS_acquireForm_1800_normal2() { - console.info(`FMS_acquireForm_1800_normal2 start`); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal2); - - console.info(`FMS_acquireForm_1800_normal2 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostb", - abilityName: "com.ohos.st.formsystemhostb.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1800_normal2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1800_normal2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1800_normal2 featureAbility.startAbility end`); - console.info(`FMS_acquireForm_1800_normal2 end`); - } - - function delPublishCallBack_Temp1() { - console.info("!!!====>FMS_acquireForm_1800 delPublishCallBack_Temp1====>"); - setTimeout(function () { - console.info('FMS_acquireForm_1800 delPublishCallBack_Temp1 end'); - FMS_acquireForm_1800_Temp2(); - }, 50); - } - function onAcquiredCallBack_Temp1(_, data) { - console.info("!!!====>FMS_acquireForm_1800 onAcquiredCallBack_Temp1 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Temp1) - var commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhost", - data: data.data - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Temp1); - } - function unSubscribeOnAcquiredCallBack_Temp1() { - console.info("====>FMS_acquireForm_1800 unSubscribeOnAcquiredCallBack_Temp1====>"); - } - - async function FMS_acquireForm_1800_Temp1() { - console.info(`FMS_acquireForm_1800_Temp1 start`); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Temp1); - console.info(`FMS_acquireForm_1800_Temp1 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1800_Temp1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1800_Temp1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1800_Temp1 featureAbility.startAbility end`); - console.info(`FMS_acquireForm_1800_Temp1 end`); - } - - function delPublishCallBack_Temp2() { - console.info("!!!====>FMS_acquireForm_1800 delPublishCallBack_Temp2====>"); - setTimeout(function () { - console.info('FMS_acquireForm_1800 delPublishCallBack_Temp2 end'); - console.info(`FMS_acquireForm_1800 end`); - done(); - }, 500); - } - function onAcquiredCallBack_Temp2(_, data) { - console.info("!!!====>FMS_acquireForm_1800 onAcquiredCallBack_Temp2 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Temp2) - var commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostb", - data: data.data - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Temp2); - } - function unSubscribeOnAcquiredCallBack_Temp2() { - console.info("====>FMS_acquireForm_1800 unSubscribeOnAcquiredCallBack_Temp2====>"); - } - - async function FMS_acquireForm_1800_Temp2() { - console.info(`FMS_acquireForm_1800_Temp2 start`); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Temp2); - - console.info(`FMS_acquireForm_1800_Temp2 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostb", - abilityName: "com.ohos.st.formsystemhostb.MainAbility", - - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1800_Temp2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1800_Temp2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1800_Temp2 featureAbility.startAbility end`); - console.info(`FMS_acquireForm_1800_Temp2 end`); - } - - FMS_acquireForm_1800_normal1(); - }); - /** - * @tc.number: FMS_acquireForm_1900 - * @tc.name: Add a temporary form when the formId is set to 0. - * @tc.desc: When the verification formId is set to 0, the temporary form is created successfully. - */ - it(`FMS_acquireForm_1900`, 0, async (done) => { - console.info(`FMS_acquireForm_1900 start`); - let formId1; - let formId2; - - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_1900 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1900")) - formId1 = data.data; - - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1900", done)); - } - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onCreate") { - console.info("====>FMS_acquireForm_1900 onSupplyCallBack====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_1900")); - let retData = JSON.parse(data.parameters.parameters); - - let bundleName = retData.bundleName; - expect(bundleName).assertEqual("com.form.formsystemtestservicea.hmservice"); - let abilityName = retData.abilityName; - expect(abilityName).assertEqual("com.form.formsystemtestservicea.hmservice.FormAbility"); - let moduleName = retData.parameters['ohos.extra.param.key.module_name']; - expect(moduleName).assertEqual("entry"); - let formName = retData.parameters['ohos.extra.param.key.form_name']; - expect(formName).assertEqual("Form_Js001"); - let formDimension = retData.parameters['ohos.extra.param.key.form_dimension']; - expect(formDimension).assertEqual(1); - let tempFormFlag = retData.parameters['ohos.extra.param.key.form_temporary']; - expect(tempFormFlag).assertEqual(true); - formId2 = retData.parameters['ohos.extra.param.key.form_identity']; - console.info("!!!====>FMS_acquireForm_1900 onAcquiredCallBack formId2:====>" + formId2); - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_1900", done)); - } - } - } - - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - - console.info(`FMS_acquireForm_1900 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_1900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_1900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_1900 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_2100 - * @tc.name: When creating a temporary form, the formId is specified as the created normal formId. - * @tc.desc: Failed to create a temporary form when verifying that the formId is set to create a normal formId. - */ - it(`FMS_acquireForm_2100`, 0, async (done) => { - console.info(`FMS_acquireForm_2100 start`); - var formId; - - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2100 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallBackCache("FMS_acquireForm_2100")); - var commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_2100", done)); - } - async function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2100 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_2100")) - formId = data.data; - // add cache form - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_2100 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": data.data, - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2100 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.info(`FMS_acquireForm_2100 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2100 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_2200 - * @tc.name: Cast to normal form when the temporary formId is set to negative. - * @tc.desc: Failed to Cast to normal form when the temporary formId is set to negative - */ - it(`FMS_acquireForm_2200`, 0, async (done) => { - console.info(`FMS_acquireForm_2200 start`); - - function onCastCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2200 onCastCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormCast_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2200")) - var commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_2200", done)); - } - - commonEvent.subscribe(subscriberCast, onCastCallBack); - console.info(`FMS_acquireForm_2200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "temporaryId": "-1", - "castForm": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2200 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_2300 - * @tc.name: Cast to normal form when the temporary formIdis set to 0. - * @tc.desc: Failed to convert to normal form when verifying that the temporary formIdis set to 0 - */ - it(`FMS_acquireForm_2300`, 0, async (done) => { - console.info(`FMS_acquireForm_2300 start`); - - function onCastCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2300 onCastCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormCast_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2300")) - var commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_2300", done)); - } - commonEvent.subscribe(subscriberCast, onCastCallBack); - console.info(`FMS_acquireForm_2300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "temporaryId": "0", - "castForm": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_2400 - * @tc.name: Non affiliated temporary form ID to normal form. - * @tc.desc: Failed to convert non affiliated temporary form ID to normal form. - */ - it(`FMS_acquireForm_2400`, 0, async (done) => { - console.info(`FMS_acquireForm_2400 start`); - - function onCastCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2400 onCastCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormCast_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2400")) - var commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_2400", done)); - } - async function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2400 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_2400")) - commonEvent.subscribe(subscriberCast, onCastCallBack); - console.info(`FMS_acquireForm_2400 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostb", - abilityName: "com.ohos.st.formsystemhostb.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "temporaryId": data.data, - "castForm": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2400 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.info(`FMS_acquireForm_2400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_2500 - * @tc.name: cast non-existent temporary formId to normal form. - * @tc.desc: Failed to verify that the temporary formId that does not exist is casted to normal form. - */ - it(`FMS_acquireForm_2500`, 0, async (done) => { - console.info(`FMS_acquireForm_2500 start`); - - function onCastCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2500 onCastCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormCast_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2500")) - var commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_2500", done)); - } - commonEvent.subscribe(subscriberCast, onCastCallBack); - console.info(`FMS_acquireForm_2500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "temporaryId": "123456789", - "castForm": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2500 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_2600 - * @tc.name: When the normal form does not reach the maximum value created by the form, the temporary form changes to the normal form. - * @tc.desc: Verify that when the normal form does not reach the maximum value created by the form. - * the temporary form can be successfully casted to the normal form. - */ - it(`FMS_acquireForm_2600`, 0, async (done) => { - console.info(`FMS_acquireForm_2600 start`); - let formId1; - let formId2; - - function onCastCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2600 onCastCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormCast_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2600")) - formId1 = data.parameters.formId; - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_2600", done)); - } - } - - async function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_2600 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_2600")) - - console.info(`FMS_acquireForm_2600 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "temporaryId": data.data, - "castForm": true, - "isCreate": false - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2600 featureAbility.startAbility again end`); - } - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onCastToNormal") { - console.info("====>FMS_acquireForm_2600 onSupplyCallBack====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_2600")); - formId2 = data.parameters.parameters; - - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_2600", done)); - } - } - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - commonEvent.subscribe(subscriberCast, onCastCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - - console.info(`FMS_acquireForm_2600 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": true, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_2600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_2600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_2600 featureAbility.startAbility end`); - }); - }); -} - -const sleep = async delay => { - return new Promise((resolve, _) => { - setTimeout(async () => { - resolve(0); - }, delay); - }); -}; - -const delPublishCallBack = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000); -} - -const unsubscribeOnErrorCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnErrorCallback====>`); -} - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`====>${tcNumber} unSubscribeOnAcquiredCallback====>`); -} - -const unsubscribeSupplyCallback = (tcNumber) => { - console.info(`====>${tcNumber} unSubscribeSupplyCallback====>`); -} - -const unsubscribeOnErrorCallBackCache = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnErrorCallBackCache CallBack====>`); -} - -const unsubscribeOnAcquiredCallBackCache = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnAcquiredCallBackCache CallBack====>`); -} - -const unsubscribeOnCastCallback = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnCastCallback====>`); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/BUILD.gn deleted file mode 100644 index 03b23e01f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsFormAcquireTest2") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsFormAcquireTest2" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/Test.json deleted file mode 100644 index e84899ea2..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/Test.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formacquiretest2", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormAcquireTest2.hap", - "FormSystemHost.hap", - "FormSystemHostI.hap", - "FormSystemHostJ.hap", - "FormSystemHostNoPerm.hap", - "FormSupplyAppA.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json deleted file mode 100644 index 1b87c0033..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formacquiretest2", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formacquiretest2", - "name": ".FormAcquire2STApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormCast_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent", - "reason": "need use OnError commonEvent" - }, - { - "name": "FMS_FormCast_commonEvent", - "reason": "need use castFrom commonEvent" - }, - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 83dd3d4f8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 37268b475..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 40000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Main Ability Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets deleted file mode 100644 index f3487358e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets +++ /dev/null @@ -1,495 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { beforeEach, describe, expect, it } from "deccjsunit/index"; - -var onErrorForm_Event = { - events: ["FMS_FormOnError_commonEvent"], -}; -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; -var subscriberFormCastEvent = { - events: ["FMS_FormCast_commonEvent"], -}; -var onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - -var subscriberOnError; -var subscriberOnAcquired; -var subscriberCast; -var subscriberSupply; - -export default function test() { - describe(`FmsAcquiredFormTest2`, () => { - - beforeEach(async () => { - subscriberOnError = await commonEvent.createSubscriber(onErrorForm_Event); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberCast = await commonEvent.createSubscriber(subscriberFormCastEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - }) - - /** - * @tc.number: FMS_acquireForm_3800 - * @tc.name: Failed to add form when parameter ability is wrong. - * @tc.desc: Failed to create form when verifying that the parameter (formId) of creating form is wrong. - */ - it(`FMS_acquireForm_3800`, 0, async (done) => { - console.info(`FMS_acquireForm_3800 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_3800 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_3800")); - console.info(`FMS_acquireForm_3800 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_3800 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_3800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_3800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_3800 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_acquireForm_3900 - * @tc.name: Failed to add form when parameter bundleName is wrong. - * @tc.desc: Failed to create form when verifying that the parameter (bundleName) of creating form is wrong. - */ - it(`FMS_acquireForm_3900`, 0, async (done) => { - console.info(`FMS_acquireForm_3900 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_3900 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_3900")); - console.info(`FMS_acquireForm_3900 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_3900 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_3900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_3900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_3900 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_acquireForm_4000 - * @tc.name: When the form specifications are inconsistent, creating the cached form fails. - * @tc.desc: Return failed. - */ - it(`FMS_acquireForm_4000`, 0, async (done) => { - console.info(`FMS_acquireForm_4000 start`); - var formId; - - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4000 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_4000")); - expect(data.data).assertEqual("the form id and form config are not matched."); - - console.info(`FMS_acquireForm_4000 end`); - var commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_4000", done)); - } - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4000 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_4000")) - formId = data.data; - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - - console.info(`FMS_acquireForm_4000 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": data.data, - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "dimension": "2", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_4000 featureAbility.startAbility again end`); - } - function unSubscribeOnAcquiredCallback() { - console.info("====>FMS_acquireForm_4000 OnAcquired UnSubscribe CallBack====>"); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.info(`FMS_acquireForm_4000 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "dimension": "1", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_4000 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_acquireForm_4100 - * @tc.name: Failed to add form when parameter moduleName is wrong. - * @tc.desc: Failed to create form when verifying that the parameter (moduleName) of creating form is wrong. - */ - it(`FMS_acquireForm_4100`, 0, async (done) => { - console.info(`FMS_acquireForm_4100 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4100 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_4100")); - console.info(`FMS_acquireForm_4100 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_4100 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostj", - abilityName: "com.ohos.st.formsystemhostj.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_4100 featureAbility.startAbility end`); - }); - - - /** - * @tc.number: FMS_acquireForm_4200 - * @tc.name: Success to add form when parameter formName is blank. - * @tc.desc: Success to create form when verifying that the parameter (formName) of creating form is success. - */ - it(`FMS_acquireForm_4200`, 0, async (done) => { - console.info(`FMS_acquireForm_4200 start`); - let formId1; - let formId2; - - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4200 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_4200")) - formId1 = data.data; - - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_4200", done)); - } - } - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onCreate") { - console.info("====>FMS_acquireForm_4200 onSupplyCallBack====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_4200")); - let retData = JSON.parse(data.parameters.parameters); - - let formName = retData.parameters['ohos.extra.param.key.form_name']; - expect(formName).assertEqual("Form_Js001"); - formId2 = retData.parameters['ohos.extra.param.key.form_identity']; - console.info("!!!====>FMS_acquireForm_4200 onAcquiredCallBack formId2:====>" + formId2); - if (formId1 && formId2) { - expect(formId1).assertEqual(formId2); - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_4200", done)); - } - } - } - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.info(`FMS_acquireForm_4200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.info(`FMS_acquireForm_4200 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_acquireForm_4300 - * @tc.name: Success to add form when parameter dimension is passed. - * @tc.desc: Success to create form when verifying that the parameter (dimension) of creating form. - */ - it(`FMS_acquireForm_4300`, 0, async (done) => { - console.info(`FMS_acquireForm_4300 start`); - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4300 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_4300")); - console.info(`FMS_acquireForm_4300 end`); - done(); - } - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.info(`FMS_acquireForm_4300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhosti", - abilityName: "com.ohos.st.formsystemhosti.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_4300 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_acquireForm_4400 - * @tc.name: Failed to add form when parameter dimension is not exist. - * @tc.desc: Failed to create form when verifying that the parameter (dimension) of creating form is wrong. - */ - it(`FMS_acquireForm_4400`, 0, async (done) => { - console.info(`FMS_acquireForm_4400 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4400 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_4400")); - expect(data.data).assertEqual("the dimension not exist in the form."); - console.info(`FMS_acquireForm_4400 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_4400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhosti", - abilityName: "com.ohos.st.formsystemhosti.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "dimension": "6", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_4400 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_acquireForm_4900 - * @tc.name: Cast temp form when the formId is created formId. - * @tc.desc: When the verification formId is set to 0, the form is created failed. - */ - it(`FMS_acquireForm_4900`, 0, async (done) => { - console.info(`FMS_acquireForm_4900 start`); - - function onCastCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4900 onCastCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormCast_commonEvent"); - expect(data.data).assertEqual("9"); - commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_4900")) - var commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_acquireForm_4900", done)); - } - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4900 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_4900")) - commonEvent.subscribe(subscriberCast, onCastCallBack); - - console.info(`FMS_acquireForm_4900 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "temporaryId": data.data, - "castForm": true, - "isCreate": false - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_4900 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.info(`FMS_acquireForm_4900 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhost", - abilityName: "com.ohos.st.formsystemhost.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_4900 featureAbility.startAbility end`); - }); - - }); -} - - -const delPublishCallBack = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000); -} - -const unsubscribeOnErrorCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnErrorCallback====>`); -} - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`====>${tcNumber} unSubscribeOnAcquiredCallback====>`); -} - -const unsubscribeSupplyCallback = (tcNumber) => { - console.info(`====>${tcNumber} unSubscribeSupplyCallback====>`); -} - -const unsubscribeOnCastCallback = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnCastCallback====>`); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 3c27a80d1..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsAcquireForm2.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/element/string.json deleted file mode 100644 index bc47049de..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formacquiretest2" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets deleted file mode 100644 index 736dd9dd7..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets +++ /dev/null @@ -1,1168 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import commonEvent from '@ohos.commonEvent'; -import { setTime } from '@ohos.systemTime'; -import { beforeEach, describe, expect, it } from 'deccjsunit/index'; - -const onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; -const onDeletedFormEvent = { - events: ["FMS_FormOnDeleted_commonEvent"], -}; -const onReleasedFormEvent = { - events: ["FMS_FormOnReleased_commonEvent"], -}; -const onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -const deleteForm_Event = "FMS_FormDelete_commonEvent"; - -let subscriberOnAcquired; -let subscriberOnReleased; -let subscriberOnDeleted; -let subscriberSupply; - -export default function test() { - describe(`FmsDeleteFormTest`, () => { - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberOnReleased = await commonEvent.createSubscriber(onReleasedFormEvent); - subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - await sleep(1000); - }); - - /** - * @tc.number: FMS_deleteForm_0200 - * @tc.name: host does not have permission - * @tc.desc: 1.delete the form that formID is 1 - * 2.Verify the result is false - */ - it(`FMS_deleteForm_0200`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0200`; - let formId; - - const onDeletedCallback = async (_, data) => { - console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); - const commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostnoperm", - abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - deleteForm: true, - deleteId: formId, - isCreate: false - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_0300 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.delete the form - * 2.Verify the result is false - */ - it(`FMS_deleteForm_0300`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0300`; - - const onDeletedCallback = async (_, data) => { - console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); - const commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - deleteForm: true, - deleteId: "-1", - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_0400 - * @tc.name: formID id is error(formID = 0) - * @tc.desc: 1.delete the form - * 2.Verify the result is false - */ - it(`FMS_deleteForm_0400`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0400`; - - const onDeletedCallback = async (_, data) => { - console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); - const commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - deleteForm: true, - deleteId: "0", - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_0500 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.host A create a formA - * 2.host B delete the formA - * 2.Verify the result is false - */ - it(`FMS_deleteForm_0500`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0500`; - let formId; - - const onDeletedCallback = async (_, data) => { - console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); - const commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostd", - abilityName: "com.ohos.st.formsystemhostd.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - deleteForm: true, - deleteId: formId, - isCreate: false - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_0600 - * @tc.name: Delete a normal form and the form reference is not 0 after deletion - * @tc.desc: 1.host A create a normal formA - * 2.host B create a form with formA's ID - * 3.delete formA, and verify the result is true - */ - it(`FMS_deleteForm_0600`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0600`; - let formId; - let supplyFlag = false; - - async function delPublishCallback() { - console.info(`${tcNumber} delPublishCallback`); - await sleep(1000); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); - if (supplyFlag) { - deleteFormB(); - expect().assertFail(); - } else { - deleteFormB(); - } - console.info(`${tcNumber} delPublishCallback end`); - } - - async function delPublishCallbackB() { - console.info(`${tcNumber} delPublishCallbackB`); - await sleep(500); - console.info(`${tcNumber} delPublishCallbackB end`); - console.info(`${tcNumber} end`); - done(); - } - - function deleteFormB() { - console.info(`${tcNumber} deleteFormB start`); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostd", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); - console.info(`${tcNumber} deleteFormB end`); - } - - const onAcquiredCallbackB = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - expect(data.data).assertEqual(formId); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - }; - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - await sleep(1000); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostd", - abilityName: "com.ohos.st.formsystemhostd.MainAbility", - parameters: { - formId: formId, - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - const onSupplyCallback = async (_, data) => { - if (data.parameters.kind == "onDestroy") { - console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); - supplyFlag = true; - } - }; - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_0700 - * @tc.name: After deleting a normal form, the form reference is 0. - * After deleting a form, there are still created normal forms in FMS. - * @tc.desc: 1.host A an host B create one normal card respectively - * 2.host A delete the form and verify the result is true - */ - it(`FMS_deleteForm_0700`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0700`; - let formId; - let formIdB; - let supplyFlag = false; - - async function delPublishCallback() { - console.info(`${tcNumber} delPublishCallback`); - await sleep(1000); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); - if (supplyFlag) { - deleteFormB(); - } else { - deleteFormB(); - expect().assertFail(); - } - console.info(`${tcNumber} delPublishCallback end`); - } - - async function delPublishCallbackB() { - console.info(`${tcNumber} delPublishCallbackB`); - await sleep(1000); - console.info(`${tcNumber} delPublishCallbackB end`); - console.info(`${tcNumber} end`); - done(); - } - - function deleteFormB() { - console.info(`${tcNumber} deleteFormB start`); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostd", - data: formIdB - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); - console.info(`${tcNumber} deleteFormB end`); - } - - const onAcquiredCallbackB = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - formIdB = data.data; - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - }; - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - await sleep(1000); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostd", - abilityName: "com.ohos.st.formsystemhostd.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - const onSupplyCallback = async (_, data) => { - if (data.parameters.kind == "onDestroy") { - console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); - expect(data.parameters.parameters).assertEqual(formId); - supplyFlag = true; - } - }; - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_0700_1 - * @tc.name: After deleting a normal form, the form reference is 0. - * After deleting a form, there are still created normal forms in FMS. - * @tc.desc: 1.host A an host B create one normal card respectively - * 2.host A delete the form and verify the result is true - */ - it(`FMS_deleteForm_0700_1`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0700_1`; - let formId; - let formIdB; - let supplyFlag = false; - let supplyFlagUpdate = false; - - // timer speed up - commonEvent.publish(`fms.time_speed`, { code: 900 }, () => { - console.info(`${tcNumber} time speed up`); - }); - await changeTime(10, 29, 55); - - async function delPublishCallback() { - console.info(`${tcNumber} delPublishCallback`); - await sleep(5000); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); - if (supplyFlag && supplyFlagUpdate) { - deleteFormB(); - } else { - deleteFormB(); - expect().assertFail(); - } - console.info(`${tcNumber} delPublishCallback end`); - } - - async function delPublishCallbackB() { - console.info(`${tcNumber} delPublishCallbackB`); - await sleep(1000); - console.info(`${tcNumber} delPublishCallbackB end`); - console.info(`${tcNumber} end`); - done(); - } - - async function deleteFormB() { - console.info(`${tcNumber} deleteFormB start`); - // timer speed reset - commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { - console.info(`${tcNumber} time speed up`); - }); - await sleep(1000); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formIdB - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); - console.info(`${tcNumber} deleteFormB end`); - } - - const onAcquiredCallbackB = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - formIdB = data.data; - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostd", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - }; - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - await sleep(1000); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - const onSupplyCallback = async (_, data) => { - if (data.parameters.kind == "onDestroy") { - console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); - expect(data.parameters.parameters).assertEqual(formId); - supplyFlag = true; - } - if (data.parameters.kind == "onUpdate") { - if (data.parameters.parameters == formId) { - expect().assertFail(); - } else if (data.parameters.parameters == formIdB) { - supplyFlagUpdate = true; - } - } - }; - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostd", - abilityName: "com.ohos.st.formsystemhostd.MainAbility", - parameters: { - formId: "0", - name: "Form_Js002", - bundle: "com.form.formsystemtestserviceb.hmservice", - ability: "com.form.formsystemtestserviceb.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_0700_2 - * @tc.name: After deleting a normal form, the form reference is 0. - * After deleting a form, there are still created normal forms in FMS. - * @tc.desc: 1.host A an host B create one normal card respectively - * 2.host A delete the form and verify the result is true - */ - it(`FMS_deleteForm_0700_2`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0700_2`; - let formId; - let formIdB; - let supplyFlag = false; - let supplyFlagUpdate = false; - - // timer speed up - commonEvent.publish(`fms.time_speed`, { code: 900 }, () => { - console.info(`${tcNumber} time speed up`); - }); - await changeTime(10, 29, 55); - async function delPublishCallback() { - console.info(`${tcNumber} delPublishCallback`); - await sleep(5000); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); - if (supplyFlag && supplyFlagUpdate) { - deleteFormB(); - } else { - deleteFormB(); - expect().assertFail(); - } - console.info(`${tcNumber} delPublishCallback end`); - } - - async function delPublishCallbackB() { - console.info(`${tcNumber} delPublishCallbackB`); - await sleep(1000); - console.info(`${tcNumber} delPublishCallbackB end`); - console.info(`${tcNumber} end`); - done(); - } - - async function deleteFormB() { - console.info(`${tcNumber} deleteFormB start`); - // timer speed reset - commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { - console.info(`${tcNumber} time speed up`); - }); - await sleep(1000); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostd", - data: formIdB - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); - console.info(`${tcNumber} deleteFormB end`); - } - - const onAcquiredCallbackB = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - formIdB = data.data; - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - }; - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - await sleep(1000); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostd", - abilityName: "com.ohos.st.formsystemhostd.MainAbility", - parameters: { - formId: "0", - name: "Form_Js002", - bundle: "com.form.formsystemtestserviceb.hmservice", - ability: "com.form.formsystemtestserviceb.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - const onSupplyCallback = async (_, data) => { - if (data.parameters.kind == "onDestroy") { - console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); - expect(data.parameters.parameters).assertEqual(formId); - supplyFlag = true; - } - if (data.parameters.kind == "onUpdate") { - if (data.parameters.parameters == formId) { - expect().assertFail(); - } else if (data.parameters.parameters == formIdB) { - supplyFlagUpdate = true; - } - } - }; - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_0900 - * @tc.name: Form ID error (FormID does not exist) - * @tc.desc: 1.host create one normal card - * 2.host delete the form - * 3.host delete the form again and verify the result is false - */ - it(`FMS_deleteForm_0900`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0900`; - let formId; - - function onDeletedCallback2(_, data) { - console.info(`${tcNumber} onDeletedCallback2 data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); - expect(data.data != "0").assertEqual(true); - console.info(`${tcNumber} failed to delete form again.`); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - } - - const onDeletedCallback = async (_, data) => { - console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); - expect(data.data).assertEqual(`0`); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); - formId = data.parameters.formId; - subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); - await sleep(1000); - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback2); - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - deleteForm: true, - deleteId: formId, - isCreate: false - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - deleteForm: true, - deleteId: "self", - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_1000 - * @tc.name: You can delete a card after releasing it - * @tc.desc: 1.host create one normal card - * 2.host release the form - * 3.host delete the form and verify the result is true - */ - it(`FMS_deleteForm_1000`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_1000`; - let formId; - - async function onReleasedCallback(_, data) { - console.info(`${tcNumber} onReleasedCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnReleased_commonEvent`); - expect(data.data).assertEqual(`0`); - commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback(tcNumber)); - formId = data.parameters.formId; - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - deleteForm: true, - deleteId: formId, - isCreate: false - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - } - commonEvent.subscribe(subscriberOnReleased, onReleasedCallback); - - const onSupplyCallback = async (_, data) => { - if (data.parameters.kind == "onDestroy") { - console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); - expect(data.parameters.parameters).assertEqual(formId); - await sleep(1000); - console.info(`${tcNumber}onDeletedCallback end`); - console.info(`${tcNumber} end`); - done(); - } - }; - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - "releaseForm": true, - "releaseId": "self", - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_deleteForm_1100 - * @tc.name: When deleting a temporary form, cache data is deleted. - * @tc.desc: 1.host a and b create one temporary card respectively - * 2.host a delete the form and verify the result is true - */ - it(`FMS_deleteForm_1100`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_1100`; - let formId; - let formIdB; - let supplyFlag = false; - - async function delPublishCallback() { - console.info(`${tcNumber} delPublishCallback`); - await sleep(1000); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); - if (supplyFlag) { - deleteFormB(); - } else { - deleteFormB(); - expect().assertFail(); - } - console.info(`${tcNumber} delPublishCallback end`); - } - - async function delPublishCallbackB() { - console.info(`${tcNumber} delPublishCallbackB`); - await sleep(1000); - console.info(`${tcNumber} delPublishCallbackB end`); - console.info(`${tcNumber} end`); - done(); - } - - function deleteFormB() { - console.info(`${tcNumber} deleteFormB start`); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostd", - data: formIdB - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); - console.info(`${tcNumber} deleteFormB end`); - } - - const onAcquiredCallbackB = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - formIdB = data.data; - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - }; - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - await sleep(1000); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostd", - abilityName: "com.ohos.st.formsystemhostd.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: true, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - const onSupplyCallback = async (_, data) => { - if (data.parameters.kind == "onDestroy") { - console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); - expect(data.parameters.parameters).assertEqual(formId); - supplyFlag = true; - } - }; - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: true, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - }); -} - -/** - * Set time - * - * @param hour hour of 24H clock - * @param min minute - * @param second second - */ -const changeTime = async (hour, min, second) => { - console.info(`FMS_deleteForm changeTime start`); - const datetime = new Date(); - const year = datetime.getFullYear(); - const month = datetime.getMonth() + 1; - const day = datetime.getDate(); - const formatTime = year + '-' + fill(month) + '-' + fill(day) - + 'T' + fill(hour) + ':' + fill(min) + ':' + fill(second); - const s = (new Date(formatTime)).getTime(); - console.info(`FMS_deleteForm changeTime formatTime: ${formatTime}`); - console.info(`FMS_deleteForm changeTime s: ${s}`); - - try { - await setTime(s); - console.info(`FMS_deleteForm set time success: ${formatTime}`); - } catch (error) { - console.info(`FMS_deleteForm set time failure: ${error}`); - } - console.info(`FMS_deleteForm changeTime end`); -}; - -const fill = value => { - return (value > 9 ? "" : "0") + value; -}; - -const sleep = async delay => { - return new Promise((resolve, _) => { - setTimeout(async () => { - resolve(0); - }, delay); - }); -}; - -const delPublishCallback = async (tcNumber, done) => { - await sleep(1000); - console.info(`${tcNumber} delPublishCallback end`); - console.info(`${tcNumber} end`); - done(); -}; - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`${tcNumber} Unsubscribe OnAcquired Callback`); -}; - -const unsubscribeOnDeletedCallback = (tcNumber) => { - console.info(`${tcNumber} Unsubscribe OnDeleted Callback`); -}; - -const unsubscribeSupplyCallback = (tcNumber) => { - console.info(`${tcNumber} Unsubscribe Supply Callback`); -}; - -const unsubscribeOnReleasedCallback = (tcNumber) => { - console.info(`${tcNumber} Unsubscribe OnReleased Callback`); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets deleted file mode 100644 index 778b737bb..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets +++ /dev/null @@ -1,436 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import commonEvent from '@ohos.commonEvent'; -import { beforeEach, describe, expect, it } from 'deccjsunit/index'; - -const onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; - -const onDeletedFormEvent = { - events: ["FMS_FormOnDeleted_commonEvent"], -}; - -const onRefreshFormEvent = { - events: ["FMS_FormDynamicRefresh_commonEvent"], -}; - -const onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -const deleteForm_Event = "FMS_FormDelete_commonEvent"; - -let subscriberOnAcquired; -let subscriberOnDeleted; -let subscriberOnRefresh; -let subscriberSupply; - -export default function test() { - describe(`FmsTimeRefreshFormTest`, () => { - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); - subscriberOnRefresh = await commonEvent.createSubscriber(onRefreshFormEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - await sleep(1000); - }); - - /** - * @tc.number: FMS_timedRefresh_0100 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. - * 2.Verify the result of the dynamic timed refresh interface. - */ - it(`FMS_timedRefresh_0100`, 0, async (done) => { - const tcNumber = `FMS_timedRefresh_0100`; - - const onRefreshCallback = async (_, data) => { - console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); - expect(data.data).assertEqual(`7`); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); - const commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.MainAbility", - moduleName: "entry", - temporary: false, - refreshForm: true, - refreshId: "-1", - refreshTime: 5, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_timedRefresh_0200 - * @tc.name: formID id is error(formID == 0) - * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. - * 2.Verify the result of the dynamic timed refresh interface. - */ - it(`FMS_timedRefresh_0200`, 0, async (done) => { - const tcNumber = `FMS_timedRefresh_0200`; - - const onRefreshCallback = async (_, data) => { - console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); - expect(data.data).assertEqual(`7`); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); - const commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.MainAbility", - moduleName: "entry", - temporary: false, - refreshForm: true, - refreshId: "0", - refreshTime: 5, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_timedRefresh_0300 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.The form provider B to invoke the dynamic timed refresh interface. - * 2.Verify the result of the dynamic timed refresh interface. - */ - it(`FMS_timedRefresh_0300`, 0, async (done) => { - const tcNumber = `FMS_timedRefresh_0300`; - let formId; - - const onRefreshCallback = async (_, data) => { - console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); - expect(data.data).assertEqual(`13`); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); - const commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.MainAbility", - moduleName: "entry", - temporary: false, - refreshForm: true, - refreshId: formId, - refreshTime: 5, - isCreate: false - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.MainAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_timedRefresh_0400 - * @tc.name: Form ID error (FormID does not exist) - * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. - * 2.Verify the result of the dynamic timed refresh interface. - */ - it(`FMS_timedRefresh_0400`, 0, async (done) => { - const tcNumber = `FMS_timedRefresh_0400`; - let formId; - - const onRefreshCallback = async (_, data) => { - console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); - expect(data.data).assertEqual(`9`); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); - - const onDeletedCallback = async (_, data) => { - console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); - expect(data.data).assertEqual(`0`); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeDeletedCallback(tcNumber)); - formId = data.parameters.formId; - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.MainAbility", - moduleName: "entry", - temporary: false, - refreshForm: true, - refreshId: formId, - refreshTime: 5, - isCreate: false - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.MainAbility", - moduleName: "entry", - temporary: false, - deleteForm: true, - "deleteId": "self", - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_timedRefresh_0500 - * @tc.name: Incorrect interval for the next refresh (time < 5) - * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. - * 2.Verify the result of the dynamic timed refresh interface. - */ - it(`FMS_timedRefresh_0500`, 0, async (done) => { - const tcNumber = `FMS_timedRefresh_0500`; - - const onRefreshCallback = async (_, data) => { - console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); - expect(data.data).assertEqual(`7`); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); - const commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - }; - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.MainAbility", - moduleName: "entry", - temporary: false, - refreshForm: true, - refreshId: "self", - refreshTime: 1, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_timedRefresh_0600 - * @tc.name: correct interval for the next refresh (time == 5) - * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. - * 2.Verify the result of the dynamic timed refresh interface. - */ - it(`FMS_timedRefresh_0600`, 0, async (done) => { - const tcNumber = `FMS_timedRefresh_0600`; - - const onSupplyCallback = async (_, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormSupply_commonEvent`); - if (data.parameters.kind == "onVisibilityChange") { - console.info(`${tcNumber} onSupplyCallback kind: data.parameters.kind`); - console.info(`${tcNumber} onSupplyCallback error: data.parameters.errorData`); - expect(data.parameters.errorData).assertEqual(`0`); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); - const commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback(tcNumber, done)); - } - }; - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicec.hmservice", - ability: "com.form.formsystemtestservicec.hmservice.MainAbility", - moduleName: "entry", - temporary: false, - "notifyVisibleForms": true, - "notifyVisibleId": "self", - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - }); -} - -const sleep = async delay => { - return new Promise((resolve, _) => { - setTimeout(async () => { - resolve(0); - }, delay); - }); -}; - -const delPublishCallback = async (tcNumber, done) => { - await sleep(1000); - console.info(`${tcNumber} delPublishCallback end`); - console.info(`${tcNumber} end`); - done(); -}; - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`${tcNumber} Unsubscribe OnAcquired Callback`); -}; - -const unsubscribeDeletedCallback = (tcNumber) => { - console.info(`${tcNumber} Unsubscribe Deleted Callback`); -}; - -const unsubscribeSupplyCallback = (tcNumber) => { - console.info(`${tcNumber} Unsubscribe Supply Callback`); -}; - -const unsubscribeOnRefreshCallback = (tcNumber) => { - console.info(`${tcNumber} Unsubscribe OnRefresh Callback`); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/Test.json deleted file mode 100644 index 99cc3da5b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "600000", - "package": "com.ohos.st.formfuzztest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormFuzzTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 97f187805..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate'); - }, - onDestroy() { - console.info('Application onDestroy'); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 0b01f255f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - private componentName: string = `FormSystemFuzzTest`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`${this.componentName}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/CastTempFormFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/CastTempFormFuzz.test.ets deleted file mode 100644 index e89906815..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/CastTempFormFuzz.test.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const castTempFormFuzzTest = (describeName, filterParameter) => { - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_casttempform`; - const promiseName = `FMS_fuzzTest_casttempform`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_casttempform_0100 ~ FMS_fuzzTest_casttempform_0800 - * @tc.desc Check whether the castTempForm interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - try { - formHost.castTempForm(formId, (error, data) => { - console.log(`${callbackName} ${tcNumber} castTempForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_casttempform_0900 ~ FMS_fuzzTest_casttempform_1600 - * @tc.desc Check whether the castTempForm interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); - try { - const data = await formHost.castTempForm(formId); - console.log(`${promiseName} ${tcNumber} castTempForm data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DeleteFormFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DeleteFormFuzz.test.ets deleted file mode 100644 index 0e320a359..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DeleteFormFuzz.test.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const deleteFormFuzzTest = (describeName, filterParameter) => { - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_deleteform`; - const promiseName = `FMS_fuzzTest_deleteform`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_deleteform_0100 ~ FMS_fuzzTest_deleteform_0800 - * @tc.desc Check whether the deleteForm interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - try { - formHost.deleteForm(formId, (error, data) => { - console.log(`${callbackName} ${tcNumber} deleteForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_deleteform_0900 ~ FMS_fuzzTest_deleteform_1600 - * @tc.desc Check whether the deleteForm interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); - try { - const data = await formHost.deleteForm(formId); - console.log(`${promiseName} ${tcNumber} deleteForm data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DisableFormsUpdateFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DisableFormsUpdateFuzz.test.ets deleted file mode 100644 index 94e3cc8f4..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DisableFormsUpdateFuzz.test.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const disableFormsUpdateFuzzTest = (describeName, filterParameter) => { - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_disable`; - const promiseName = `FMS_fuzzTest_disable`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_disable_0100 ~ FMS_fuzzTest_disable_0800 - * @tc.desc Check whether the disableFormsUpdate interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formIds = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`); - try { - formHost.disableFormsUpdate(formIds, (error, data) => { - console.log(`${callbackName} ${tcNumber} disableFormsUpdate data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_disable_0900 ~ FMS_fuzzTest_disable_1600 - * @tc.desc Check whether the disableFormsUpdate interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formIds = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`); - try { - const data = await formHost.disableFormsUpdate(formIds); - console.log(`${promiseName} ${tcNumber} disableFormsUpdate data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/EnableFormsUpdateFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/EnableFormsUpdateFuzz.test.ets deleted file mode 100644 index 3884d6107..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/EnableFormsUpdateFuzz.test.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const enableFormsUpdateFuzzTest = (describeName, filterParameter) => { - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_enable`; - const promiseName = `FMS_fuzzTest_enable`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_enable_0100 ~ FMS_fuzzTest_enable_0800 - * @tc.desc Check whether the enableFormsUpdate interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formIds = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`); - try { - formHost.enableFormsUpdate(formIds, (error, data) => { - console.log(`${callbackName} ${tcNumber} enableFormsUpdate data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_enable_0900 ~ FMS_fuzzTest_enable_1600 - * @tc.desc Check whether the enableFormsUpdate interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formIds = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`); - try { - const data = await formHost.enableFormsUpdate(formIds); - console.log(`${promiseName} ${tcNumber} enableFormsUpdate data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/GetFormsInfoFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/GetFormsInfoFuzz.test.ets deleted file mode 100644 index cafade393..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/GetFormsInfoFuzz.test.ets +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const getFormsInfoFuzzTest = (describeName, filterParameter) => { - const ERR_GET_BUNDLE_FAILED_CODE = 5; - const ERR_GET_BUNDLE_FAILED = `failed to obtain the bundle information`; - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_getinfobundle`; - const promiseName = `FMS_fuzzTest_getinfobundle`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_getinfobundle_0100 ~ FMS_fuzzTest_getinfobundle_0800 - * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const bundleName = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`); - try { - formHost.getFormsInfo(bundleName, (error, data) => { - console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - if (`STRING` === dataType) { - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - } else { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_getinfobundle_0900 ~ FMS_fuzzTest_getinfobundle_1600 - * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const bundleName = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`); - try { - const data = await formHost.getFormsInfo(bundleName); - console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - } else { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } - done(); - } - }); - } - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_getinfomodule`; - const promiseName = `FMS_fuzzTest_getinfomodule`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_getinfomodule_0100 ~ FMS_fuzzTest_getinfomodule_0800 - * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const bundleName = getFuzzData(dataType); - const moduleName = `com.test.module_name_${tcNumber}`; - console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`); - console.log(`${callbackName} ${tcNumber} moduleName typeof: ${typeof moduleName}`); - try { - formHost.getFormsInfo(bundleName, moduleName, (error, data) => { - console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - if (`STRING` === dataType) { - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - } else { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_getinfomodule_0900 ~ FMS_fuzzTest_getinfomodule_1600 - * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const bundleName = getFuzzData(dataType); - const moduleName = `com.test.module_name_${tcNumber}`; - console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`); - console.log(`${promiseName} ${tcNumber} ${describeName} moduleName typeof: ${typeof moduleName}`); - try { - const data = await formHost.getFormsInfo(bundleName, moduleName); - console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - } else { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } - done(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 2) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_getinfomodule_1700 ~ FMS_fuzzTest_getinfomodule_2400 - * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const bundleName = `com.test.bundle_name_${tcNumber}`; - const moduleName = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`); - console.log(`${callbackName} ${tcNumber} moduleName typeof: ${typeof moduleName}`); - try { - formHost.getFormsInfo(bundleName, moduleName, (error, data) => { - console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - if (`STRING` === dataType) { - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - } else { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 3) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_getinfomodule_2500 ~ FMS_fuzzTest_getinfomodule_3200 - * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const bundleName = `com.test.bundle_name_${tcNumber}`; - const moduleName = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`); - console.log(`${promiseName} ${tcNumber} ${describeName} moduleName typeof: ${typeof moduleName}`); - try { - const data = await formHost.getFormsInfo(bundleName, moduleName); - console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - } else { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } - done(); - } - }); - } - }) -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index ebefecdb9..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { castTempFormFuzzTest } from './CastTempFormFuzz.test.ets'; -import { deleteFormFuzzTest } from './DeleteFormFuzz.test.ets'; -import { disableFormsUpdateFuzzTest } from './DisableFormsUpdateFuzz.test.ets'; -import { enableFormsUpdateFuzzTest } from './EnableFormsUpdateFuzz.test.ets'; -import { getFormsInfoFuzzTest } from './GetFormsInfoFuzz.test.ets'; -import { notifyInvisibleFormsFuzzTest } from './NotifyInvisibleFormsFuzz.test.ets'; -import { notifyVisibleFormsFuzzTest } from './NotifyVisibleFormsFuzz.test.ets'; -import { releaseFormFuzzTest } from './ReleaseFormFuzz.test.ets'; -import { requestFormFuzzTest } from './RequestFormFuzz.test.ets'; -import { setFormNextRefreshTimeFuzzTest } from './SetFormNextRefreshTimeFuzz.test.ets'; -import { updateFormFuzzTest } from './UpdateFormFuzz.test.ets'; - -export default function testsuite() { - // FMS_fuzzTest_deleteform - deleteFormFuzzTest(`DeleteFormFuzzTest`, 0); - - // FMS_fuzzTest_releaseform - releaseFormFuzzTest(`ReleaseFormFuzzTest`, 0); - - // FMS_fuzzTest_casttempform - castTempFormFuzzTest(`CastTempFormFuzzTest`, 0); - - // FMS_fuzzTest_invisible - notifyVisibleFormsFuzzTest(`NotifyVisibleFormsFuzzTest`, 0); - - // FMS_fuzzTest_visible - notifyInvisibleFormsFuzzTest(`NotifyInvisibleFormsFuzzTest`, 0); - - // FMS_fuzzTest_requestform - requestFormFuzzTest(`RequestFormFuzzTest`, 0); - - // FMS_fuzzTest_updateform - updateFormFuzzTest(`UpdateFormFuzzTest`, 0); - - // FMS_fuzzTest_setnexttime - setFormNextRefreshTimeFuzzTest(`SetFormNextRefreshTimeFuzzTest`, 0); - - // FMS_fuzzTest_enable - enableFormsUpdateFuzzTest(`EnableFormsUpdateFuzzTest`, 0); - - // FMS_fuzzTest_disable - disableFormsUpdateFuzzTest(`DisableFormsUpdateFuzzTest`, 0); - - // FMS_fuzzTest_getinfobundle - // FMS_fuzzTest_getinfomodule - getFormsInfoFuzzTest(`GetFormsInfoFuzzTest`, 0); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyInvisibleFormsFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyInvisibleFormsFuzz.test.ets deleted file mode 100644 index 89355b845..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyInvisibleFormsFuzz.test.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const notifyInvisibleFormsFuzzTest = (describeName, filterParameter) => { - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_invisible`; - const promiseName = `FMS_fuzzTest_invisible`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_invisible_0100 ~ FMS_fuzzTest_invisible_0800 - * @tc.desc Check whether the notifyInvisibleForms interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formIds = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`); - try { - formHost.notifyInvisibleForms(formIds, (error, data) => { - console.log(`${callbackName} ${tcNumber} notifyInvisibleForms data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_invisible_0900 ~ FMS_fuzzTest_invisible_1600 - * @tc.desc Check whether the notifyInvisibleForms interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formIds = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`); - try { - const data = await formHost.notifyInvisibleForms(formIds); - console.log(`${promiseName} ${tcNumber} notifyInvisibleForms data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyVisibleFormsFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyVisibleFormsFuzz.test.ets deleted file mode 100644 index 6f021082e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyVisibleFormsFuzz.test.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const notifyVisibleFormsFuzzTest = (describeName, filterParameter) => { - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_visible`; - const promiseName = `FMS_fuzzTest_visible`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_visible_0100 ~ FMS_fuzzTest_visible_0800 - * @tc.desc Check whether the notifyVisibleForms interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formIds = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`); - try { - formHost.notifyVisibleForms(formIds, (error, data) => { - console.log(`${callbackName} ${tcNumber} notifyVisibleForms data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_visible_0900 ~ FMS_fuzzTest_visible_1600 - * @tc.desc Check whether the notifyVisibleForms interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formIds = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`); - try { - const data = await formHost.notifyVisibleForms(formIds); - console.log(`${promiseName} ${tcNumber} notifyVisibleForms data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/ReleaseFormFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/ReleaseFormFuzz.test.ets deleted file mode 100644 index e91d1332f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/ReleaseFormFuzz.test.ets +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const releaseFormFuzzTest = (describeName, filterParameter) => { - const ERR_COMMON_CODE = 1; - const ERR_COMMON = `internal error`; - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - const ERR_NOT_EXIST_ID_CODE = 9; - const ERR_NOT_EXIST_ID = `the ID of the form to be operated does not exist`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_releaseform`; - const promiseName = `FMS_fuzzTest_releaseform`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_releaseform_0100 ~ FMS_fuzzTest_releaseform_0800 - * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - try { - formHost.releaseForm(formId, (error, data) => { - console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_releaseform_0900 ~ FMS_fuzzTest_releaseform_1600 - * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); - try { - const data = await formHost.releaseForm(formId); - console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } else { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } - done(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 2) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_releaseform_1700 ~ FMS_fuzzTest_releaseform_2400 - * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - const isReleaseCache = true; - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${callbackName} ${tcNumber} isReleaseCache typeof: ${typeof isReleaseCache}`); - try { - formHost.releaseForm(formId, isReleaseCache, (error, data) => { - console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 3) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_releaseform_2500 ~ FMS_fuzzTest_releaseform_3200 - * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - const isReleaseCache = true; - console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); - console.log(`${promiseName} ${tcNumber} ${describeName} isReleaseCache typeof: ${typeof isReleaseCache}`); - try { - const data = await formHost.releaseForm(formId, isReleaseCache); - console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } else { - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } - done(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 4) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_releaseform_3300 ~ FMS_fuzzTest_releaseform_4000 - * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = `${tcNumber}`; - const isReleaseCache = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${callbackName} ${tcNumber} isReleaseCache typeof: ${typeof isReleaseCache}`); - try { - formHost.releaseForm(formId, isReleaseCache, (error, data) => { - console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - if (`BOOLEAN` === dataType) { - expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE); - expect(error.message).assertEqual(ERR_NOT_EXIST_ID); - } else { - expect(error.code).assertEqual(ERR_COMMON_CODE); - expect(error.message).assertEqual(ERR_COMMON); - } - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 5) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_releaseform_4100 ~ FMS_fuzzTest_releaseform_4800 - * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = `${tcNumber}`; - const isReleaseCache = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); - console.log(`${promiseName} ${tcNumber} ${describeName} isReleaseCache typeof: ${typeof isReleaseCache}`); - try { - const data = await formHost.releaseForm(formId, isReleaseCache); - console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`BOOLEAN` === dataType) { - expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE); - expect(error.message).assertEqual(ERR_NOT_EXIST_ID); - } else { - expect(error.code).assertEqual(ERR_COMMON_CODE); - expect(error.message).assertEqual(ERR_COMMON); - } - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/RequestFormFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/RequestFormFuzz.test.ets deleted file mode 100644 index 681b8c18b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/RequestFormFuzz.test.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const requestFormFuzzTest = (describeName, filterParameter) => { - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_requestform`; - const promiseName = `FMS_fuzzTest_requestform`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_requestform_0100 ~ FMS_fuzzTest_requestform_0800 - * @tc.desc Check whether the requestForm interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - try { - formHost.requestForm(formId, (error, data) => { - console.log(`${callbackName} ${tcNumber} requestForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_requestform_0900 ~ FMS_fuzzTest_requestform_1600 - * @tc.desc Check whether the requestForm interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); - try { - const data = await formHost.requestForm(formId); - console.log(`${promiseName} ${tcNumber} requestForm data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/SetFormNextRefreshTimeFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/SetFormNextRefreshTimeFuzz.test.ets deleted file mode 100644 index fd383cd04..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/SetFormNextRefreshTimeFuzz.test.ets +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formProvider from '@ohos.application.formProvider'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const setFormNextRefreshTimeFuzzTest = (describeName, filterParameter) => { - const ERR_COMMON_CODE = 1; - const ERR_COMMON = `internal error`; - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - const ERR_NOT_EXIST_ID_CODE = 9; - const ERR_NOT_EXIST_ID = `the ID of the form to be operated does not exist`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_setnexttime`; - const promiseName = `FMS_fuzzTest_setnexttime`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_setnexttime_0100 ~ FMS_fuzzTest_setnexttime_0800 - * @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - const nextTime = 5; - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${callbackName} ${tcNumber} nextTime typeof: ${typeof nextTime}`); - try { - formProvider.setFormNextRefreshTime(formId, nextTime, (error, data) => { - console.log(`${callbackName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_setnexttime_0900 ~ FMS_fuzzTest_setnexttime_1600 - * @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - const nextTime = 5; - console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${promiseName} ${tcNumber} nextTime typeof: ${typeof nextTime}`); - try { - const data = await formProvider.setFormNextRefreshTime(formId, nextTime); - console.log(`${promiseName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 2) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_setnexttime_1700 ~ FMS_fuzzTest_setnexttime_2400 - * @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = `${tcNumber}`; - const nextTime = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${callbackName} ${tcNumber} nextTime typeof: ${typeof nextTime}`); - try { - formProvider.setFormNextRefreshTime(formId, nextTime, (error, data) => { - console.log(`${callbackName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - if (`NUMBER` === dataType) { - if (ERR_NOT_EXIST_ID_CODE === error.code) { - expect(error.message).assertEqual(ERR_NOT_EXIST_ID); - } else if (ERR_ADD_INVALID_PARAM_CODE === error.code) { - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } else { - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - } else { - expect(error.code).assertEqual(ERR_COMMON_CODE); - expect(error.message).assertEqual(ERR_COMMON); - } - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 3) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_setnexttime_2500 ~ FMS_fuzzTest_setnexttime_3200 - * @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = `${tcNumber}`; - const nextTime = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${promiseName} ${tcNumber} nextTime typeof: ${typeof nextTime}`); - try { - const data = await formProvider.setFormNextRefreshTime(formId, nextTime); - console.log(`${promiseName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`NUMBER` === dataType) { - if (ERR_NOT_EXIST_ID_CODE === error.code) { - expect(error.message).assertEqual(ERR_NOT_EXIST_ID); - } else if (ERR_ADD_INVALID_PARAM_CODE === error.code) { - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - } else { - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - } else { - expect(error.code).assertEqual(ERR_COMMON_CODE); - expect(error.message).assertEqual(ERR_COMMON); - } - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/UpdateFormFuzz.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/UpdateFormFuzz.test.ets deleted file mode 100644 index dad4c7884..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/UpdateFormFuzz.test.ets +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formProvider from '@ohos.application.formProvider'; -import { describe, expect, it } from 'deccjsunit/index'; -import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; - -export const updateFormFuzzTest = (describeName, filterParameter) => { - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_fuzzTest_updateform`; - const promiseName = `FMS_fuzzTest_updateform`; - const length = DATA_TYPE_LIST.length; - - for (let i = 0; i < length; ++i) { - const tcNumber = `0${(i + 1) * 100}`; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_updateform_0100 ~ FMS_fuzzTest_updateform_0800 - * @tc.desc Check whether the updateForm interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - const formBindingData = {}; - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${callbackName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`); - try { - formProvider.updateForm(formId, formBindingData, (error, data) => { - console.log(`${callbackName} ${tcNumber} updateForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - let tcNumber: any = (i + 1 + length) * 100; - tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_updateform_0900 ~ FMS_fuzzTest_updateform_1600 - * @tc.desc Check whether the updateForm interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = getFuzzData(dataType); - const formBindingData = {}; - console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${promiseName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`); - try { - const data = await formProvider.updateForm(formId, formBindingData); - console.log(`${promiseName} ${tcNumber} updateForm data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 2) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_updateform_1700 ~ FMS_fuzzTest_updateform_2400 - * @tc.desc Check whether the updateForm interface can pass the fuzzy test (by AsyncCallback) - */ - it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = `${tcNumber}`; - const formBindingData = getFuzzData(dataType); - console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${callbackName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`); - try { - formProvider.updateForm(formId, formBindingData, (error, data) => { - console.log(`${callbackName} ${tcNumber} updateForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(data).assertUndefined(); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - }); - } catch (error) { - console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - console.log(`${callbackName} ${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - } - - for (let i = 0; i < length; ++i) { - const tcNumber: any = (i + 1 + length * 3) * 100; - /** - * @tc.name fuzzTest - * @tc.number FMS_fuzzTest_updateform_2500 ~ FMS_fuzzTest_updateform_3200 - * @tc.desc Check whether the updateForm interface can pass the fuzzy test (by Promise) - */ - it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { - const dataType = DATA_TYPE_LIST[i]; - const formId = `${tcNumber}`; - const formBindingData = getFuzzData(dataType); - console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`); - console.log(`${promiseName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`); - try { - const data = await formProvider.updateForm(formId, formBindingData); - console.log(`${promiseName} ${tcNumber} updateForm data: ${JSON.stringify(data)}`); - console.log(`${promiseName} ${tcNumber} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - } - }); - } - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/getParam.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/getParam.ets deleted file mode 100644 index 548b50013..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/getParam.ets +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const REPEAT_COUNT = 2; - -export const DATA_TYPE_LIST = ['ARRAY', 'NUMBER', 'BOOLEAN', 'FUNCTION', 'STRING', 'OBJECT', 'NULL', 'UNDEFINED']; - -var RANDOM_BEGIN_POSITION = 0; -var RANDOM_BEGIN_POSITION_A = 2; -var STRING_RANDOM_LENGTH = 2064; -var BOOLEAN_RANDOM_LENGTH = 2; -var ARRAY_RANDOM_LENGTH = 10; -var ARRAY_RANDOM_TYPE_LENGTH = 3; -var OBJECT_RANDOM_LENGTH = 2; -var FUNCTION_RANDOM_LENGTH = 2; - -//string ascii -var STRING_RANDOM_LENGTH_A = 48; -var STRING_RANDOM_LENGTH_B = 58; -var STRING_RANDOM_LENGTH_C = 65; -var STRING_RANDOM_LENGTH_D = 91; -var STRING_RANDOM_LENGTH_E = 97; -var STRING_RANDOM_LENGTH_F = 122; - -// Return integer random, the range is: [iStart, iEnd) -function getIntegerRandom(iStart, iEnd) { - var decimal = iStart + (iEnd - iStart) * Math.random(); - return Math.floor(decimal); -} - -// return string random, the string length is: [0, 2064) -const stringTest = function () { - // string - var res = ''; - - // string length - var iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, STRING_RANDOM_LENGTH); - for (var iAsciiToChar = RANDOM_BEGIN_POSITION; iAsciiToChar < iNumber; iAsciiToChar++) { - var iNumberString = getIntegerRandom(RANDOM_BEGIN_POSITION, RANDOM_BEGIN_POSITION_A); - - switch (iNumberString) { - case 0: - // get ascii [0-9] - iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_A, STRING_RANDOM_LENGTH_B); - break; - case 1: - // get ascii [A-Z] - iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_C, STRING_RANDOM_LENGTH_D); - break; - case 2: - default: - // get ascii [a-z] - iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_E, STRING_RANDOM_LENGTH_F); - break; - } - // from ascii to char - var asciiToChar = String.fromCharCode(iNumber); - res += asciiToChar; - } - console.log('The stringTest of this fuzzTest random:' + res); - return res; -}; - -// return number random, the number length is: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER] -const numberTest = function () { - const res = getIntegerRandom(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER + 1); - console.log('The numberTest of this fuzzTest random:' + res); - return res; -}; - -// return boolean random, the boolean value is: 0->(false), 1->(true) -const booleanTest = function () { - console.log('The booleanTest of this fuzzTest random'); - return Boolean(getIntegerRandom(RANDOM_BEGIN_POSITION, BOOLEAN_RANDOM_LENGTH)); -}; - -// null -const nullTest = function () { - console.log('The nullTest of this fuzzTest random'); - return null; -}; - -// undefined -const undefinedTest = function () { - console.log('The undefinedTest of this fuzzTest random'); - return undefined; -}; - -// return array random, the array value is: string,number,bool -const arrayTest = function () { - var arrValue = []; - - // array length - var iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, ARRAY_RANDOM_LENGTH); - for (var iArrNumber = 0; iArrNumber < iNumber; iArrNumber++) { - // string,number,bool - iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, ARRAY_RANDOM_TYPE_LENGTH); - switch (iNumber) { - case 0: - arrValue[iArrNumber] = stringTest(); - break; - case 1: - arrValue[iArrNumber] = numberTest(); - break; - case 2: - arrValue[iArrNumber] = booleanTest(); - break; - default: - arrValue[iArrNumber] = ''; - } - } - console.log('The arrayTest of this fuzzTest random:' + arrValue); - return arrValue; -}; - -// return objectTest random, the objectTest value is: null, not null -const objectTest = function () { - var objectA = {}; - var objectb = { id: 'objectTest' }; - var objectB = Object.create(objectb); - - console.log('The objectTest of this fuzzTest random'); - return getIntegerRandom(RANDOM_BEGIN_POSITION, OBJECT_RANDOM_LENGTH) ? objectA : objectB; -}; - -// return functionTest random, the functionTest value is: null, not null -const functionTest = function () { - var functionA = {}; - var functionB = { id: 'functionTest' }; - - console.log('The functionTest of this fuzzTest random'); - return getIntegerRandom(RANDOM_BEGIN_POSITION, FUNCTION_RANDOM_LENGTH) ? functionA : functionB; -}; - -// return fuzz data -const getFuzzData = (datatype: string) => { - switch (datatype) { - case 'ARRAY': - return arrayTest(); - case 'BOOLEAN': - return booleanTest(); - case 'FUNCTION': - return functionTest(); - case 'NULL': - return nullTest(); - case 'NUMBER': - return numberTest(); - case 'OBJECT': - return objectTest(); - case 'STRING': - return stringTest(); - case 'UNDEFINED': - return undefinedTest(); - default: - return stringTest(); - } -}; - -export { getFuzzData, stringTest, numberTest, booleanTest, nullTest, undefinedTest, objectTest, arrayTest, functionTest }; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/Test.json deleted file mode 100644 index 86acc8a94..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formsoneandonetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormsOneAndOneTest.hap", - "FormSystemProviderB.hap", - "FormSystemProviderC.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json deleted file mode 100644 index 5c387f35e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsoneandonetest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsoneandonetest", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 97f187805..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate'); - }, - onDestroy() { - console.info('Application onDestroy'); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 7a2e171b5..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; -import testsuite from '../test/List.test.ets'; - -@Entry -@Component -struct Index { - private componentName: string = `FormsOneAndOneTest`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`${this.componentName}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets deleted file mode 100644 index 109f758e7..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; - -export const getAllFormsInfoTest = (describeName, filterParameter) => { - const ERR_OK_CODE = 0; - const ERR_OK = `success`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_0500 callback`; - const promiseName = `FMS_getFormsInfo_0500 promise`; - - const expectDataB = { - bundleName: 'com.ohos.st.formsystemproviderb', - moduleName: 'form_module_b', - abilityName: 'com.ohos.st.formsystemproviderb.MainAbility', - name: 'FormB_Js001', - description: 'form_description_FormB_Js001', - descriptionId: 20, - type: 1, - jsComponentName: 'card_b', - colorMode: -1, - isDefault: 1, - updateEnabled: 1, - formVisibleNotify: 1, - formConfigAbility: 'abilityb', - updateDuration: 3, - scheduledUpdateTime: '10:30', - defaultDimension: 2, - supportDimensions: [1, 2], - metaData: { customizeData: [{ name: 'originWidgetNameB', value: 'valueB' }] }, - }; - - const expectDataC = { - bundleName: 'com.ohos.st.formsystemproviderc', - moduleName: 'form_module_c', - abilityName: 'com.ohos.st.formsystemproviderc.MainAbility', - name: 'FormC_Js001', - description: 'form_description_FormC_Js001', - descriptionId: 30, - type: 1, - jsComponentName: 'card_c', - colorMode: 1, - isDefault: 1, - updateEnabled: 1, - formVisibleNotify: 1, - formConfigAbility: 'abilityc', - updateDuration: 4, - scheduledUpdateTime: '15:30', - defaultDimension: 3, - supportDimensions: [3, 4], - metaData: { customizeData: [{ name: 'originWidgetNameC', value: 'valueC' }] }, - }; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_0500 - * @tc.desc: Query all form configuration information (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getAllFormsInfo((error, data) => { - console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - console.log(`${callbackName} forms amount: ${data.length}`); - - const dataB = data.filter((form) => { - return `com.ohos.st.formsystemproviderb` === form.bundleName; - }); - console.log(`${callbackName} form dataB: ${JSON.stringify(dataB)}`); - console.log(`${callbackName} formB amount: ${dataB.length}`); - const dataC = data.filter((form) => { - return `com.ohos.st.formsystemproviderc` === form.bundleName; - }); - console.log(`${callbackName} form dataC: ${JSON.stringify(dataC)}`); - console.log(`${callbackName} formC amount: ${dataC.length}`); - - expect(dataB.length).assertEqual(1); - expect(dataC.length).assertEqual(1); - expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); - expect(JSON.stringify(dataC[0])).assertEqual(JSON.stringify(expectDataC)); - expect(error.code).assertEqual(ERR_OK_CODE); - expect(error.message).assertEqual(ERR_OK); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_0500 - * @tc.desc: Query all form configuration information (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getAllFormsInfo(); - console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} forms amount: ${data.length}`); - - const dataB = data.filter((form) => { - return `com.ohos.st.formsystemproviderb` === form.bundleName; - }); - console.log(`${promiseName} form dataB: ${JSON.stringify(dataB)}`); - console.log(`${promiseName} formB amount: ${dataB.length}`); - const dataC = data.filter((form) => { - return `com.ohos.st.formsystemproviderc` === form.bundleName; - }); - console.log(`${promiseName} form dataC: ${JSON.stringify(dataC)}`); - console.log(`${promiseName} formC amount: ${dataC.length}`); - - expect(dataB.length).assertEqual(1); - expect(dataC.length).assertEqual(1); - expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); - expect(JSON.stringify(dataC[0])).assertEqual(JSON.stringify(expectDataC)); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } - }); - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets deleted file mode 100644 index 1f8cb896e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets +++ /dev/null @@ -1,521 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; - -export const getFormsInfoTest = (describeName, filterParameter) => { - const ERR_OK_CODE = 0; - const ERR_OK = `success`; - const ERR_GET_BUNDLE_FAILED_CODE = 5; - const ERR_GET_BUNDLE_FAILED = `failed to obtain the bundle information`; - const ERR_ADD_INVALID_PARAM_CODE = 7; - const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_0900 callback`; - const promiseName = `FMS_getFormsInfo_0900 promise`; - const bundleName = ``; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_0900 - * @tc.desc: Query specific form configuration information by empty bundle name (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_0900 - * @tc.desc: Query specific form configuration information by empty bundle name (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } - }); - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_1000 callback`; - const promiseName = `FMS_getFormsInfo_1000 promise`; - const bundleName = `wrong.bundle.name`; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_1000 - * @tc.desc: Query specific form configuration information by wrong bundle name (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_1000 - * @tc.desc: Query specific form configuration information by wrong bundle name (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } - }); - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_1100 callback`; - const promiseName = `FMS_getFormsInfo_1100 promise`; - const bundleName = `com.ohos.st.formsystemproviderb`; - - const expectDataB = { - bundleName: 'com.ohos.st.formsystemproviderb', - moduleName: 'form_module_b', - abilityName: 'com.ohos.st.formsystemproviderb.MainAbility', - name: 'FormB_Js001', - description: 'form_description_FormB_Js001', - descriptionId: 20, - type: 1, - jsComponentName: 'card_b', - colorMode: -1, - isDefault: 1, - updateEnabled: 1, - formVisibleNotify: 1, - formConfigAbility: 'abilityb', - updateDuration: 3, - scheduledUpdateTime: '10:30', - defaultDimension: 2, - supportDimensions: [1, 2], - metaData: { customizeData: [{ name: 'originWidgetNameB', value: 'valueB' }] }, - }; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_1100 - * @tc.desc: Query specific form configuration information by correct bundle name (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - console.log(`${callbackName} forms amount: ${data.length}`); - - const dataB = data.filter((form) => { - return `com.ohos.st.formsystemproviderb` === form.bundleName; - }); - console.log(`${callbackName} form dataB: ${JSON.stringify(dataB)}`); - console.log(`${callbackName} formB amount: ${dataB.length}`); - - expect(data.length).assertEqual(1); - expect(dataB.length).assertEqual(1); - expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); - expect(error.code).assertEqual(ERR_OK_CODE); - expect(error.message).assertEqual(ERR_OK); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_1100 - * @tc.desc: Query specific form configuration information by correct bundle name (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} forms amount: ${data.length}`); - - const dataB = data.filter((form) => { - return `com.ohos.st.formsystemproviderb` === form.bundleName; - }); - console.log(`${promiseName} form dataB: ${JSON.stringify(dataB)}`); - console.log(`${promiseName} formB amount: ${dataB.length}`); - - expect(data.length).assertEqual(1); - expect(dataB.length).assertEqual(1); - expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } - }); - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_1400 callback`; - const promiseName = `FMS_getFormsInfo_1400 promise`; - const bundleName = ``; - const moduleName = `form_module_c`; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_1400 - * @tc.desc: Query specific form configuration information by empty bundle name and correct module name (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, moduleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_1400 - * @tc.desc: Query specific form configuration information by empty bundle name and correct module name (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName, moduleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } - }); - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_1500 callback`; - const promiseName = `FMS_getFormsInfo_1500 promise`; - const bundleName = `wrong.bundle.name`; - const moduleName = `form_module_c`; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_1500 - * @tc.desc: Query specific form configuration information by wrong bundle name and correct module name (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, moduleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_1500 - * @tc.desc: Query specific form configuration information by wrong bundle name and correct module name (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName, moduleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); - expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } - }); - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_1600 callback`; - const promiseName = `FMS_getFormsInfo_1600 promise`; - const bundleName = `com.ohos.st.formsystemproviderc`; - const moduleName = ``; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_1600 - * @tc.desc: Query specific form configuration information by correct bundle name and empty module name (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, moduleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_1600 - * @tc.desc: Query specific form configuration information by correct bundle name and empty module name (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName, moduleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); - expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } - }); - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_1700 callback`; - const promiseName = `FMS_getFormsInfo_1700 promise`; - const bundleName = `com.ohos.st.formsystemproviderc`; - const moduleName = `wrong.module.name`; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_1700 - * @tc.desc: Query specific form configuration information by correct bundle name and wrong module name (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, moduleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(JSON.stringify(data)).assertEqual(`[]`); - expect(error.code).assertEqual(ERR_OK_CODE); - expect(error.message).assertEqual(ERR_OK); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_1700 - * @tc.desc: Query specific form configuration information by correct bundle name and wrong module name (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName, moduleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - expect(JSON.stringify(data)).assertEqual(`[]`); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } - }); - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_1800 callback`; - const promiseName = `FMS_getFormsInfo_1800 promise`; - const bundleName = `com.ohos.st.formsystemproviderc`; - const moduleName = `form_module_c`; - - const expectDataC = { - bundleName: 'com.ohos.st.formsystemproviderc', - moduleName: 'form_module_c', - abilityName: 'com.ohos.st.formsystemproviderc.MainAbility', - name: 'FormC_Js001', - description: 'form_description_FormC_Js001', - descriptionId: 30, - type: 1, - jsComponentName: 'card_c', - colorMode: 1, - isDefault: 1, - updateEnabled: 1, - formVisibleNotify: 1, - formConfigAbility: 'abilityc', - updateDuration: 4, - scheduledUpdateTime: '15:30', - defaultDimension: 3, - supportDimensions: [3, 4], - metaData: { customizeData: [{ name: 'originWidgetNameC', value: 'valueC' }] }, - }; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_1800 - * @tc.desc: Query specific form configuration information by correct bundle name and correct module name (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, moduleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - console.log(`${callbackName} forms amount: ${data.length}`); - - const dataC = data.filter((form) => { - return `com.ohos.st.formsystemproviderc` === form.bundleName; - }); - console.log(`${callbackName} form dataC: ${JSON.stringify(dataC)}`); - console.log(`${callbackName} formC amount: ${dataC.length}`); - - expect(data.length).assertEqual(1); - expect(dataC.length).assertEqual(1); - expect(JSON.stringify(dataC[0])).assertEqual(JSON.stringify(expectDataC)); - expect(error.code).assertEqual(ERR_OK_CODE); - expect(error.message).assertEqual(ERR_OK); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_1800 - * @tc.desc: Query specific form configuration information by correct bundle name and correct module name (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName, moduleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} forms amount: ${data.length}`); - - const dataC = data.filter((form) => { - return `com.ohos.st.formsystemproviderc` === form.bundleName; - }); - console.log(`${promiseName} form dataC: ${JSON.stringify(dataC)}`); - console.log(`${promiseName} formC amount: ${dataC.length}`); - - expect(data.length).assertEqual(1); - expect(dataC.length).assertEqual(1); - expect(JSON.stringify(dataC[0])).assertEqual(JSON.stringify(expectDataC)); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } - }); - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 464a64cbc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; -import { getFormsInfoTest } from './GetFormsInfo.test.ets'; - -export default function testsuite() { - // FMS_getFormsInfo_0500 - getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); - // FMS_getFormsInfo_0900 - // FMS_getFormsInfo_1000 - // FMS_getFormsInfo_1100 - // FMS_getFormsInfo_1400 - // FMS_getFormsInfo_1500 - // FMS_getFormsInfo_1600 - // FMS_getFormsInfo_1700 fail - // FMS_getFormsInfo_1800 - getFormsInfoTest(`GetFormsInfoTest`, 0); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/Test.json deleted file mode 100644 index 0fac6fee1..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formsoneandtwotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormsOneAndTwoTest.hap", - "FormSystemProviderA.hap", - "FormSystemProviderB.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json deleted file mode 100644 index 61e499a42..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsoneandtwotest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsoneandtwotest", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 97f187805..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate'); - }, - onDestroy() { - console.info('Application onDestroy'); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 3e7b8adf9..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; -import testsuite from '../test/List.test.ets'; - -@Entry -@Component -struct Index { - private componentName: string = `FormsOneAndTwoTest`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`${this.componentName}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets deleted file mode 100644 index 310565712..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; - -export const getAllFormsInfoTest = (describeName, filterParameter) => { - const ERR_OK_CODE = 0; - const ERR_OK = `success`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_0600 callback`; - const promiseName = `FMS_getFormsInfo_0600 promise`; - - const expectDataA01 = { - bundleName: 'com.ohos.st.formsystemprovidera', - moduleName: 'form_module_a', - abilityName: 'com.ohos.st.formsystemprovidera.MainAbility', - name: 'FormA_Js001', - description: 'form_description_FormA_Js001', - descriptionId: 0, - type: 1, - jsComponentName: 'card_a01', - colorMode: 0, - isDefault: 1, - updateEnabled: 1, - formVisibleNotify: 1, - formConfigAbility: 'abilitya01', - updateDuration: 1, - scheduledUpdateTime: '5:30', - defaultDimension: 1, - supportDimensions: [1, 3], - metaData: { customizeData: [{ name: 'originWidgetNameA01', value: 'valueA01' }] }, - }; - - const expectDataA02 = { - bundleName: 'com.ohos.st.formsystemprovidera', - moduleName: 'form_module_a', - abilityName: 'com.ohos.st.formsystemprovidera.MainAbility', - name: 'FormA_Js002', - description: 'form_description_FormA_Js002', - descriptionId: 10, - type: 1, - jsComponentName: 'card_a02', - colorMode: 1, - isDefault: 0, - updateEnabled: 0, - formVisibleNotify: 0, - formConfigAbility: 'abilitya02', - updateDuration: 2, - scheduledUpdateTime: '20:30', - defaultDimension: 4, - supportDimensions: [1, 2, 3, 4], - metaData: { customizeData: [{ name: 'originWidgetNameA02', value: 'valueA02' }] }, - }; - - const expectDataB = { - bundleName: 'com.ohos.st.formsystemproviderb', - moduleName: 'form_module_b', - abilityName: 'com.ohos.st.formsystemproviderb.MainAbility', - name: 'FormB_Js001', - description: 'form_description_FormB_Js001', - descriptionId: 20, - type: 1, - jsComponentName: 'card_b', - colorMode: -1, - isDefault: 1, - updateEnabled: 1, - formVisibleNotify: 1, - formConfigAbility: 'abilityb', - updateDuration: 3, - scheduledUpdateTime: '10:30', - defaultDimension: 2, - supportDimensions: [1, 2], - metaData: { customizeData: [{ name: 'originWidgetNameB', value: 'valueB' }] }, - }; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_0600 - * @tc.desc: Query all form configuration information (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getAllFormsInfo((error, data) => { - console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - console.log(`${callbackName} forms amount: ${data.length}`); - - const dataA = data.filter((form) => { - return `com.ohos.st.formsystemprovidera` === form.bundleName; - }); - console.log(`${callbackName} form dataA: ${JSON.stringify(dataA)}`); - console.log(`${callbackName} formA amount: ${dataA.length}`); - const dataB = data.filter((form) => { - return `com.ohos.st.formsystemproviderb` === form.bundleName; - }); - console.log(`${callbackName} form dataB: ${JSON.stringify(dataB)}`); - console.log(`${callbackName} formB amount: ${dataB.length}`); - - expect(dataA.length).assertEqual(2); - expect(dataB.length).assertEqual(1); - expect(JSON.stringify(dataA[0])).assertEqual(JSON.stringify(expectDataA01)); - expect(JSON.stringify(dataA[1])).assertEqual(JSON.stringify(expectDataA02)); - expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); - expect(error.code).assertEqual(ERR_OK_CODE); - expect(error.message).assertEqual(ERR_OK); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_0600 - * @tc.desc: Query all form configuration information (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getAllFormsInfo(); - console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} forms amount: ${data.length}`); - - const dataA = data.filter((form) => { - return `com.ohos.st.formsystemprovidera` === form.bundleName; - }); - console.log(`${promiseName} form dataA: ${JSON.stringify(dataA)}`); - console.log(`${promiseName} formA amount: ${dataA.length}`); - const dataB = data.filter((form) => { - return `com.ohos.st.formsystemproviderb` === form.bundleName; - }); - console.log(`${promiseName} form dataB: ${JSON.stringify(dataB)}`); - console.log(`${promiseName} formB amount: ${dataB.length}`); - - expect(dataA.length).assertEqual(2); - expect(dataB.length).assertEqual(1); - expect(JSON.stringify(dataA[0])).assertEqual(JSON.stringify(expectDataA01)); - expect(JSON.stringify(dataA[1])).assertEqual(JSON.stringify(expectDataA02)); - expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } - }); - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 6c6ada8b8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; - -export default function testsuite() { - // FMS_getFormsInfo_0600 - getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/Test.json deleted file mode 100644 index 729fb99cb..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formsoneandzerotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormsOneAndZeroTest.hap", - "FormSystemProviderB.hap", - "FormSystemProviderD.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json deleted file mode 100644 index 6d8f937f7..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formsoneandzerotest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formsoneandzerotest", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 97f187805..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate'); - }, - onDestroy() { - console.info('Application onDestroy'); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 282011ccf..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; -import testsuite from '../test/List.test.ets'; - -@Entry -@Component -struct Index { - private componentName: string = `FormsOneAndZeroTest`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`${this.componentName}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets deleted file mode 100644 index 6137a1553..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; - -export const getAllFormsInfoTest = (describeName, filterParameter) => { - const ERR_OK_CODE = 0; - const ERR_OK = `success`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_0400 callback`; - const promiseName = `FMS_getFormsInfo_0400 promise`; - - const expectDataB = { - bundleName: 'com.ohos.st.formsystemproviderb', - moduleName: 'form_module_b', - abilityName: 'com.ohos.st.formsystemproviderb.MainAbility', - name: 'FormB_Js001', - description: 'form_description_FormB_Js001', - descriptionId: 20, - type: 1, - jsComponentName: 'card_b', - colorMode: -1, - isDefault: 1, - updateEnabled: 1, - formVisibleNotify: 1, - formConfigAbility: 'abilityb', - updateDuration: 3, - scheduledUpdateTime: '10:30', - defaultDimension: 2, - supportDimensions: [1, 2], - metaData: { customizeData: [{ name: 'originWidgetNameB', value: 'valueB' }] }, - }; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_0400 - * @tc.desc: Query all form configuration information (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getAllFormsInfo((error, data) => { - console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - console.log(`${callbackName} forms amount: ${data.length}`); - - const dataB = data.filter((form) => { - return `com.ohos.st.formsystemproviderb` === form.bundleName; - }); - console.log(`${callbackName} form dataB: ${JSON.stringify(dataB)}`); - console.log(`${callbackName} formB amount: ${dataB.length}`); - const dataD = data.filter((form) => { - return `com.ohos.st.formsystemproviderd` === form.bundleName; - }); - console.log(`${callbackName} form dataD: ${JSON.stringify(dataD)}`); - console.log(`${callbackName} formD amount: ${dataD.length}`); - - expect(dataB.length).assertEqual(1); - expect(dataD.length).assertEqual(0); - expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); - expect(JSON.stringify(dataD)).assertEqual(`[]`); - expect(error.code).assertEqual(ERR_OK_CODE); - expect(error.message).assertEqual(ERR_OK); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_0400 - * @tc.desc: Query all form configuration information (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getAllFormsInfo(); - console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} forms amount: ${data.length}`); - - const dataB = data.filter((form) => { - return `com.ohos.st.formsystemproviderb` === form.bundleName; - }); - console.log(`${promiseName} form dataB: ${JSON.stringify(dataB)}`); - console.log(`${promiseName} formB amount: ${dataB.length}`); - const dataD = data.filter((form) => { - return `com.ohos.st.formsystemproviderd` === form.bundleName; - }); - console.log(`${promiseName} form dataD: ${JSON.stringify(dataD)}`); - console.log(`${promiseName} formD amount: ${dataD.length}`); - - expect(dataB.length).assertEqual(1); - expect(dataD.length).assertEqual(0); - expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); - expect(JSON.stringify(dataD)).assertEqual(`[]`); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } - }); - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 8ec9f9ce4..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; - -export default function testsuite() { - // FMS_getFormsInfo_0400 - getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/Test.json deleted file mode 100644 index e5cad319e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formswithoutpermtest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormsWithoutPermTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json deleted file mode 100644 index 298cc3790..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formswithoutpermtest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formswithoutpermtest", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 97f187805..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate'); - }, - onDestroy() { - console.info('Application onDestroy'); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index f130dc93f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; -import testsuite from '../test/List.test.ets'; - -@Entry -@Component -struct Index { - private componentName: string = `FormsWithoutPermTest`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`${this.componentName}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets deleted file mode 100644 index 10db014b0..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; - -export const getAllFormsInfoTest = (describeName, filterParameter) => { - const ERR_OK_CODE = 0; - const ERR_OK = `success`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_0200 callback`; - const promiseName = `FMS_getFormsInfo_0200 promise`; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_0200 - * @tc.desc: Query all form configuration information without permission (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getAllFormsInfo((error, data) => { - console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(JSON.stringify(data)).assertEqual(`[]`); - expect(error.code).assertEqual(ERR_OK_CODE); - expect(error.message).assertEqual(ERR_OK); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_0200 - * @tc.desc: Query all form configuration information without permission (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getAllFormsInfo(); - console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); - expect(JSON.stringify(data)).assertEqual(`[]`); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } - }); - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets deleted file mode 100644 index 471bbd19b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; - -export const getFormsInfoTest = (describeName, filterParameter) => { - const ERR_PERMISSION_DENY_CODE = 2; - const ERR_PERMISSION_DENY = `does not have permission to use forms`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_0800 callback`; - const promiseName = `FMS_getFormsInfo_0800 promise`; - const bundleName = `1`; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_0800 - * @tc.desc: Query specific form configuration information by bundle name without permission (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_PERMISSION_DENY_CODE); - expect(error.message).assertEqual(ERR_PERMISSION_DENY); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_0800 - * @tc.desc: Query specific form configuration information by bundle name without permission (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - expect(error.code).assertEqual(ERR_PERMISSION_DENY_CODE); - expect(error.message).assertEqual(ERR_PERMISSION_DENY); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } - }); - }); - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_1300 callback`; - const promiseName = `FMS_getFormsInfo_1300 promise`; - const bundleName = `2`; - const moduleName = `a`; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_1300 - * @tc.desc: Query specific form configuration information by bundle name and module name without permission (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getFormsInfo(bundleName, moduleName, (error, data) => { - console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(error.code).assertEqual(ERR_PERMISSION_DENY_CODE); - expect(error.message).assertEqual(ERR_PERMISSION_DENY); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_1300 - * @tc.desc: Query specific form configuration information by bundle name and module name without permission (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getFormsInfo(bundleName, moduleName); - console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - expect(error.code).assertEqual(ERR_PERMISSION_DENY_CODE); - expect(error.message).assertEqual(ERR_PERMISSION_DENY); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } - }); - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 4c43d6022..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; -import { getFormsInfoTest } from './GetFormsInfo.test.ets'; - -export default function testsuite() { - // FMS_getFormsInfo_0200 - getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); - // FMS_getFormsInfo_0800 - // FMS_getFormsInfo_1300 - getFormsInfoTest(`GetFormsInfoTest`, 0); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/Test.json deleted file mode 100644 index 1b86e823b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formszerotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormsZeroTest.hap", - "FormSystemProviderD.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json deleted file mode 100644 index f34dca2bb..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formszerotest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formszerotest", - "name": ".FormSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 97f187805..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate'); - }, - onDestroy() { - console.info('Application onDestroy'); - }, -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 17c4ec14b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; -import testsuite from '../test/List.test.ets'; - -@Entry -@Component -struct Index { - private componentName: string = `FormsZeroTest`; - - aboutToAppear() { - console.info(`${this.componentName} start run testcase!!!!`); - - featureAbility.getWant() - .then((want: any) => { - console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text(`${this.componentName}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets deleted file mode 100644 index c4458c3d9..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formHost from '@ohos.application.formHost'; -import { describe, expect, it } from 'deccjsunit/index'; - -export const getAllFormsInfoTest = (describeName, filterParameter) => { - const ERR_OK_CODE = 0; - const ERR_OK = `success`; - - describe(`${describeName}`, () => { - const callbackName = `FMS_getFormsInfo_0300 callback`; - const promiseName = `FMS_getFormsInfo_0300 promise`; - - /** - * @tc.name: getFormsInfo - * @tc.number: FMS_getFormsInfo_0300 - * @tc.desc: Query all form configuration information without permission (by AsyncCallback) - */ - it(`${callbackName}`, filterParameter, async (done) => { - console.log(`==========${callbackName} ${describeName} start==========`); - - try { - formHost.getAllFormsInfo((error, data) => { - console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - - const dataD = data.filter((form) => { - return `com.ohos.st.formsystemproviderd` === form.bundleName; - }); - console.log(`${callbackName} form dataD: ${JSON.stringify(dataD)}`); - console.log(`${callbackName} formD amount: ${dataD.length}`); - expect(dataD.length).assertEqual(0); - expect(JSON.stringify(dataD)).assertEqual(`[]`); - expect(error.code).assertEqual(ERR_OK_CODE); - expect(error.message).assertEqual(ERR_OK); - done(); - console.log(`==========${callbackName} ${describeName} end==========`); - }); - } catch (error) { - console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); - console.log(`${callbackName} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.name getFormsInfo - * @tc.number FMS_getFormsInfo_0300 - * @tc.desc: Query all form configuration information without permission (by Promise) - */ - it(`${promiseName}`, filterParameter, async (done) => { - console.log(`==========${promiseName} ${describeName} start==========`); - - try { - const data = await formHost.getAllFormsInfo(); - const dataD = data.filter((form) => { - return `com.ohos.st.formsystemproviderd` === form.bundleName; - }); - console.log(`${callbackName} form dataD: ${JSON.stringify(dataD)}`); - console.log(`${callbackName} formD amount: ${dataD.length}`); - expect(dataD.length).assertEqual(0); - expect(JSON.stringify(dataD)).assertEqual(`[]`); - done(); - console.log(`==========${promiseName} ${describeName} end==========`); - } catch (error) { - console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); - console.log(`${promiseName} should not reach here`); - expect().assertFail(); - } - }); - }); -}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 13a30fbf2..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; - -export default function testsuite() { - // FMS_getFormsInfo_0300 - getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 83dd3d4f8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 0ed78e553..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 60000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Host Death Recipient Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 29aa65899..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsHostDeathRecipient.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json deleted file mode 100644 index e0016b900..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formperformancetest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormPerformanceTest.hap", - "FormSystemHostK.hap", - "FormSupplyAppG.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index f9be09439..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index d105fe704..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 20000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Performance Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets deleted file mode 100644 index a7bcd585a..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets +++ /dev/null @@ -1,940 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the `License`); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an `AS IS` BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import formHost from '@ohos.application.formHost'; -import commonEvent from '@ohos.commonEvent'; -import { getCurrentTime } from '@ohos.systemTime'; -import { beforeEach, describe, expect, it } from 'deccjsunit/index'; - -const onAcquiredEvent = { - events: [`FMS_FormOnAcquired_commonEvent`], -}; -const onSupplyEvent = { - events: [`FMS_FormSupply_commonEvent`], -}; -const formOnDeleteEvent = `FMS_FormDelete_commonEvent`; - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`${tcNumber} unsubscribeOnAcquired callback`); -} -const unsubscribeOnSupplyCallback = (tcNumber) => { - console.info(`${tcNumber} unsubscribeOnSupply callback`); -} -const publishOnDeleteCallback = (tcNumber, done) => { - console.info(`${tcNumber} publishOnDelete callback`); - done(); -} - -let onAcquiredEventSubscriber; -let onSupplyEventSubscriber; - -export default function test() { - describe(`FmsPerformanceTest`, () => { - - beforeEach(async () => { - onAcquiredEventSubscriber = await commonEvent.createSubscriber(onAcquiredEvent); - onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent); - }); - - /** - * @tc.number: FMS_performanceTest_0100 - * @tc.name: Performance test. - * @tc.desc: Create form. - */ - it(`FMS_performanceTest_0100`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0100`; - const timeout = 1000; - let endflag = 0; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - const hostEndTime = data.parameters.time; - const hostTime = hostEndTime - startTime - console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onCreate` == kind) { - const providerEndTime = data.parameters.time; - const providerTime = providerEndTime - startTime; - console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); - expect(providerTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - console.info(`${tcNumber} onSupplyCallback_onCreate end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [supplyFormId] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - } - }); - - const startTime = await getCurrentTime(); - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_0200 - * @tc.name: Performance test. - * @tc.desc: Delete form. - */ - it(`FMS_performanceTest_0200`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0200`; - const timeout = 1000; - let startTime = -1; - let endflag = 0; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - if (`deleteForm` == data.parameters.kind) { - startTime = data.parameters.startTime; - const hostTime = data.parameters.hostTime; - console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback_deleteForm end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - } - }); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onDestroy` == kind) { - setTimeout(() => { - const providerEndTime = data.parameters.time; - const providerTime = providerEndTime - startTime; - console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); - expect(providerTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - console.info(`${tcNumber} onSupplyCallback_onDestroy end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [supplyFormId] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }, 2000); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - deleteForm: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_0300 - * @tc.name: Performance test. - * @tc.desc: Release form. - */ - it(`FMS_performanceTest_0300`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0300`; - const timeout = 1000; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - if (`release` == data.parameters.kind) { - const hostTime = data.parameters.hostTime; - console.info(`${tcNumber} hostTime: ${hostTime}`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback_release end`); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - releaseForm: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_0400 - * @tc.name: Performance test. - * @tc.desc: Cast temp form. - */ - it(`FMS_performanceTest_0400`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0400`; - const timeout = 500; - let startTime = -1; - let endflag = 0; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - if (`castTempForm` == data.parameters.kind) { - startTime = data.parameters.startTime; - const hostTime = data.parameters.hostTime; - console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); - console.info(`${tcNumber} onAcquiredCallback_castTempForm end`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - } - }); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onCastToNormal` == kind) { - setTimeout(() => { - const providerEndTime = data.parameters.time; - const providerTime = providerEndTime - startTime; - console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); - expect(providerTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - console.info(`${tcNumber} onSupplyCallback_onCastToNormal end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [supplyFormId] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }, 2000); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - castTempForm: true, - temporary: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_0500 - * @tc.name: Performance test. - * @tc.desc: Notify visible forms. - */ - it(`FMS_performanceTest_0500`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0500`; - const timeout = 500; - let startTime = -1; - let endflag = 0; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - if (`notifyVisibleForms` == data.parameters.kind) { - startTime = data.parameters.startTime; - const hostTime = data.parameters.hostTime; - console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback_notifyVisibleForms end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - } - }); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : `onVisibilityChange` == kind - ? Object.keys(JSON.parse(data.parameters.parameters))[0] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onVisibilityChange` == kind) { - setTimeout(() => { - const providerEndTime = data.parameters.time; - const providerTime = providerEndTime - startTime; - console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); - expect(providerTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - console.info(`${tcNumber} onSupplyCallback_onVisibilityChange end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [supplyFormId] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }, 2000); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - notifyVisibleForms: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_0600 - * @tc.name: Performance test. - * @tc.desc: Notify invisible forms. - */ - it(`FMS_performanceTest_0600`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0600`; - const timeout = 500; - let startTime = -1; - let endflag = 0; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - if (`notifyInvisibleForms` == data.parameters.kind) { - startTime = data.parameters.startTime; - const hostTime = data.parameters.hostTime; - console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback_notifyInvisibleForms end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - } - }); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : `onVisibilityChange` == kind - ? Object.keys(JSON.parse(data.parameters.parameters))[0] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onVisibilityChange` == kind) { - setTimeout(() => { - const providerEndTime = data.parameters.time; - const providerTime = providerEndTime - startTime; - console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); - expect(providerTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - console.info(`${tcNumber} onSupplyCallback_onVisibilityChange end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [supplyFormId] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }, 2000); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - notifyInvisibleForms: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_0700 - * @tc.name: Performance test. - * @tc.desc: Request forms. - */ - it(`FMS_performanceTest_0700`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0700`; - const timeout = 100; - let startTime = -1; - let endflag = 0; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - if (`request` == data.parameters.kind) { - startTime = data.parameters.startTime; - const hostTime = data.parameters.hostTime; - console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - } - }); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onUpdate` == kind) { - setTimeout(() => { - const providerEndTime = data.parameters.time; - console.info(`${tcNumber} providerTime: ${JSON.stringify(providerEndTime - startTime)}`); - expect(providerEndTime - startTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - console.info(`${tcNumber} onSupplyCallback_onUpdate end`); - - if (++endflag == 2) { - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [supplyFormId] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }, 2000); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - requestForm: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_0800 - * @tc.name: Performance test. - * @tc.desc: Update form. - */ - it(`FMS_performanceTest_0800`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0800`; - const timeout = 100; - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : `onVisibilityChange` == kind - ? Object.keys(JSON.parse(data.parameters.parameters))[0] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onUpdateForm` == kind) { - const providerTime = data.parameters.time; - console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); - expect(providerTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - console.info(`${tcNumber} onSupplyCallback_onUpdateForm end`); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [supplyFormId] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - notifyVisibleForms: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_0900 - * @tc.name: Performance test. - * @tc.desc: Set next refresh time. - */ - it(`FMS_performanceTest_0900`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_0900`; - const timeout = 100; - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : `onVisibilityChange` == kind - ? Object.keys(JSON.parse(data.parameters.parameters))[0] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onSetFormNextRefreshTime` == kind) { - const providerTime = data.parameters.time; - console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); - expect(providerTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - console.info(`${tcNumber} onSupplyCallback_onSetFormNextRefreshTime end`); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [supplyFormId] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }); - - setTimeout(async () => { - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - notifyVisibleForms: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }, 2000); - }); - - /** - * @tc.number: FMS_performanceTest_1000 - * @tc.name: Performance test. - * @tc.desc: Enable update forms. - */ - it(`FMS_performanceTest_1000`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_1000`; - const timeout = 100; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - if (`enableUpdate` == data.parameters.kind) { - const hostTime = data.parameters.hostTime; - console.info(`${tcNumber} hostTime: ${hostTime}`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback_enableUpdate end`); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - enableUpdate: true, - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_1100 - * @tc.name: Performance test. - * @tc.desc: Disable update forms. - */ - it(`FMS_performanceTest_1100`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_1100`; - const timeout = 100; - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); - - if (`disableUpdate` == data.parameters.kind) { - const hostTime = data.parameters.hostTime; - console.info(`${tcNumber} hostTime: ${hostTime}`); - expect(hostTime < timeout).assertEqual(true); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback_disableUpdate end`); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [data.data] - } - }, () => publishOnDeleteCallback(tcNumber, done)); - }, 500); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true, - disableUpdate: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_performanceTest_1300 - * @tc.name: Performance test. - * @tc.desc: Get forms info. - */ - it(`FMS_performanceTest_1300`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_1300`; - const timeout = 10; - - const startTime = await getCurrentTime(); - const data = await formHost.getAllFormsInfo(); - console.info(`${tcNumber} getAllFormsInfo result: ${JSON.stringify(data)}`); - const endTime = await getCurrentTime(); - - console.info(`${tcNumber} hostTime: ${JSON.stringify(endTime - startTime)}`); - expect(endTime - startTime < timeout); - done(); - }); - - /** - * @tc.number: FMS_performanceTest_1400 - * @tc.name: Performance test. - * @tc.desc: Get forms info by bundle. - */ - it(`FMS_performanceTest_1400`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_1400`; - const timeout = 10; - - const startTime = await getCurrentTime(); - const data = await formHost.getFormsInfo(`com.form.formsystemtestserviceg.hmservice`); - console.info(`${tcNumber} getFormsInfoByBundle result: ${JSON.stringify(data)}`); - const endTime = await getCurrentTime(); - - console.info(`${tcNumber} hostTime: ${JSON.stringify(endTime - startTime)}`); - expect(endTime - startTime < timeout); - done(); - }); - - /** - * @tc.number: FMS_performanceTest_1500 - * @tc.name: Performance test. - * @tc.desc: Get forms info by module. - */ - it(`FMS_performanceTest_1500`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_1500`; - const timeout = 10; - - const startTime = await getCurrentTime(); - const data = await formHost.getFormsInfo(`com.form.formsystemtestserviceg.hmservice`, `entry`); - console.info(`${tcNumber} getFormsInfoByModule result: ${JSON.stringify(data)}`); - const endTime = await getCurrentTime(); - - console.info(`${tcNumber} hostTime: ${JSON.stringify(endTime - startTime)}`); - expect(endTime - startTime < timeout); - done(); - }); - - /** - * @tc.number: FMS_performanceTest_1600 - * @tc.name: Performance test. - * @tc.desc: Form System Ready. - */ - it(`FMS_performanceTest_1600`, 0, async (done) => { - const tcNumber = `FMS_performanceTest_1600`; - const timeout = 10; - - const startTime = await getCurrentTime(); - const data = await formHost.isSystemReady(); - console.info(`${tcNumber} isSystemReady result: ${JSON.stringify(data)}`); - const endTime = await getCurrentTime(); - - console.info(`${tcNumber} hostTime: ${JSON.stringify(endTime - startTime)}`); - expect(endTime - startTime < timeout); - done(); - }); - }); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index af887f8d2..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsPerformanceTest.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets deleted file mode 100644 index 9212656dd..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets +++ /dev/null @@ -1,574 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; - -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; -var onDeletedFormEvent = { - events: ["FMS_FormOnDeleted_commonEvent"], -}; -var onReleasedFormEvent = { - events: ["FMS_FormOnReleased_commonEvent"], -}; -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - -var subscriberOnAcquired; -var subscriberOnDeleted; -var subscriberOnReleased; - -export default function test() { - describe(`FmsReleaseFormTest`, () => { - - beforeAll(async (done) => { - done(); - }) - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); - subscriberOnReleased = await commonEvent.createSubscriber(onReleasedFormEvent); - }) - - /** - * @tc.number: FMS_releaseForm_0200 - * @tc.name: host does not have permission - * @tc.desc: 1.release the form that formID is 1 - * 2.Verify the result is false - */ - it(`FMS_releaseForm_0200`, 0, async (done) => { - console.log(`FMS_releaseForm_0200 start`); - let formId; - - function onReleasedCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_0200 onReleasedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0200")); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_releaseForm_0200", done)); - } - - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_0200 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_releaseForm_0200")) - formId = data.data; - commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); - - console.log(`FMS_releaseForm_0200 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostnoperm", - abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "releaseForm" : true, - "releaseId" : formId, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_0200 featureAbility.startAbility again end`); - } - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - - console.log(`FMS_releaseForm_0200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_0200 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_releaseForm_0300 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.release the form - * 2.Verify the result is false - */ - it(`FMS_releaseForm_0300`, 0, async (done) => { - console.log(`FMS_releaseForm_0300 start`); - - function onReleasedCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_0300 onReleasedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0300")); - setTimeout(function () { - console.info('FMS_releaseForm_0300 onReleasedCallBack end'); - console.log(`FMS_releaseForm_0300 end`); - done(); - }, 100); - } - commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); - - console.log(`FMS_releaseForm_0300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "releaseForm" : true, - "releaseId" : "-1", - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_0300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_releaseForm_0400 - * @tc.name: formID id is error(formID = 0) - * @tc.desc: 1.release the form - * 2.Verify the result is false - */ - it(`FMS_releaseForm_0400`, 0, async (done) => { - console.log(`FMS_releaseForm_0400 start`); - - function onReleaseCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_0400 onReleaseCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0400")); - setTimeout(function () { - console.info('FMS_releaseForm_0400 onReleaseCallBack end'); - console.log(`FMS_releaseForm_0400 end`); - done(); - }, 100); - } - commonEvent.subscribe(subscriberOnReleased, onReleaseCallBack); - console.log(`FMS_releaseForm_0400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "releaseForm" : true, - "releaseId" : "0", - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_0400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_releaseForm_0500 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.host A create a formA - * 2.host B release the formA - * 2.Verify the result is false - */ - it(`FMS_releaseForm_0500`, 0, async (done) => { - console.log(`FMS_releaseForm_0500 start`); - let formId; - - function onReleasedCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_0500 onReleasedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0500")); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_releaseForm_0500", done)); - } - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_0500 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_releaseForm_0500")); - formId = data.data; - commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); - console.log(`FMS_releaseForm_0500 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostd", - abilityName: "com.ohos.st.formsystemhostd.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "releaseForm" : true, - "releaseId" : formId, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_0500 featureAbility.startAbility again end`); - } - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.log(`FMS_releaseForm_0500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_0500 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_releaseForm_0600 - * @tc.name: Form ID error (FormID does not exist) - * @tc.desc: 1.host create one normal card - * 2.host delete the form - * 3.host release the form and verify the result is false - */ - it(`FMS_releaseForm_0600`, 0, async (done) => { - console.log(`FMS_releaseForm_0600 start`); - let formId; - - function onReleasedCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_0600 onReleasedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0600")); - let commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_releaseForm_0600", done)); - } - function onDeletedCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_0600 onDeletedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnDeleted_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnDeleted, unsubscribeDeletedCallback) - formId = data.parameters.formId; - commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); - - console.log(`FMS_releaseForm_0600 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "releaseForm" : true, - "releaseId" : formId, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_0600 featureAbility.startAbility again end`); - } - function unsubscribeDeletedCallback() { - console.debug("====>FMS_releaseForm_0600 unsubscribeDeletedCallback====>"); - } - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallBack); - console.log(`FMS_releaseForm_0600 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "deleteForm" : true, - "deleteId" : "self", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_0600 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_releaseForm_1300 - * @tc.name: single host continuously release forms - * @tc.desc: 1.There are 2 forms created by the single host - * 2.single host release 2 forms successfully - */ - it(`FMS_releaseForm_1300`, 0, async (done) => { - console.log(`FMS_releaseForm_1300 start`); - let formIdList = []; - let releasedIdList = []; - let formCount = 2; - let delCount = 0; - - function delPublishCallBack() { - console.info("!!!====>FMS_releaseForm_1300 delPublishCallBack====>"); - delCount++; - if(delCount == formCount) { - setTimeout(function () { - console.info('FMS_releaseForm_1300 delPublishCallBack end'); - console.log(`FMS_releaseForm_1300 end`); - done(); - }, 1000); - } - } - - function onReleasedCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_1300 onReleasedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); - expect(data.data).assertEqual("0"); - let formId = data.parameters.formId; - formIdList.forEach(function(item, index, arr) { - if(item === formId) { - releasedIdList.push(formId); - } - }); - if(releasedIdList.length == formCount) { - commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_1300")); - for(var iIndex = 0; iIndex < releasedIdList.length; iIndex++) { - let commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: releasedIdList[iIndex] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); - } - } - } - function releaseForms() { - console.debug("====>FMS_releaseForm_1300 releaseForms====>"); - commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); - for(var iIndex = 0; iIndex < formIdList.length; iIndex++) { - console.log(`FMS_releaseForm_1300 featureAbility.startAbility start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "releaseForm" : true, - "releaseId" : formIdList[iIndex], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_1300 featureAbility.startAbility end`); - } - } - function onAcquiredCallBack1(_, data) { - console.info("!!!====>FMS_releaseForm_1300 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_releaseForm_1300")); - formIdList.push(data.data); - - releaseForms(); - } - - async function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_1300 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_releaseForm_1300")); - formIdList.push(data.data); - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack1); - - console.log(`FMS_releaseForm_1300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_1300 featureAbility.startAbility end`); - } - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - - console.log(`FMS_releaseForm_1300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_1300 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_releaseForm_1400 - * @tc.name: release temp form - * @tc.desc: 1.host create one temp form - * 2.release the form and judge the result is true - */ - it(`FMS_releaseForm_1400`, 0, async (done) => { - console.log(`FMS_releaseForm_1400 start`); - - function onReleasedCallBack(_, data) { - console.info("!!!====>FMS_releaseForm_1400 onReleasedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_1400")); - - let commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, (delPublishCallBack("FMS_releaseForm_1400", done))); - } - commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); - - console.log(`FMS_releaseForm_1400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : true, - "releaseForm" : true, - "releaseId" : "self", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_releaseForm_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_releaseForm_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_releaseForm_1400 featureAbility.startAbility end`); - }); - }); -} - -const delPublishCallBack = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000); -} - -const unsubscribeOnReleasedCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnReleasedCallback====>`); -} - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/Test.json deleted file mode 100644 index ce142a737..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formstatedisabletest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormStateDisableTest.hap", - "FormSystemHostF.hap", - "FormSystemHostG.hap", - "FormSupplyAppA.hap", - "FormSupplyAppF.hap", - "FormSupplyAppG.hap", - "FormSystemHostNoPerm.hap", - "FormSupplyAppH.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json deleted file mode 100644 index f70589e26..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formstatedisabletest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formstatedisabletest", - "name": ".FormStateSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnState_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent", - "reason": "need use OnError commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent", - "reason": "need use OnDeleted commonEvent" - }, - { - "name": "FMS_FormOnState_commonEvent", - "reason": "need use OnState commonEvent" - }, - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 83dd3d4f8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 445968cfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 30000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Main Ability Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets deleted file mode 100644 index 6696b0bac..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets +++ /dev/null @@ -1,783 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; - -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; - -var onDeletedFormEvent = { - events: ["FMS_FormOnDeleted_commonEvent"], -}; - -var onStateFormEvent = { - events: ["FMS_FormOnState_commonEvent"], -}; - -var onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - -var subscriberOnAcquired; -var subscriberDel; -var subscriberOnState; -var subscriberSupply; - -export default function test() { - describe(`FmsStateFormTest`, () => { - - beforeAll(async (done) => { - done(); - }) - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent); - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - await sleep(1000); - }) - - /** - * @tc.number: FMS_disableFormsUpdate_0200 - * @tc.name: The form user does not have permission. - * @tc.desc: 1.The form user calls the disable update interface. - * 2.Verify the result of the disable update interface. - */ - it(`FMS_disableFormsUpdate_0200`, 0, async (done) => { - console.log(`FMS_disableFormsUpdate_0200 start`); - function onStateCallBack(_, data) { - console.info("!!!====>FMS_disableFormsUpdate_0200 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("2"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0200")); - setTimeout(function () { - console.info('FMS_disableFormsUpdate_0200 onStateCallBack end'); - console.log(`FMS_disableFormsUpdate_0200 end`); - done(); - }, 1000) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_disableFormsUpdate_0200 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostnoperm", - abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : ["1"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_0200 featureAbility.startAbility again end`); - }); - /** - * @tc.number: FMS_disableFormsUpdate_0300 - * @tc.name: The length of the formId list is 0 (no formId) - * @tc.desc: 1.The form user calls the disable update interface. - * 2.Verify the result of the disable update interface. - */ - it(`FMS_disableFormsUpdate_0300`, 0, async (done) => { - console.log(`FMS_disableFormsUpdate_0300 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_disableFormsUpdate_0300 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("7"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0300")) - - setTimeout(function () { - console.info('FMS_disableFormsUpdate_0300 delPublishCallBack end'); - console.log(`FMS_disableFormsUpdate_0300 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_disableFormsUpdate_0300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : [], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate _0300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_disableFormsUpdate_0400 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.The form user calls the disable update interface. - * 2.Verify the result of the disable update interface. - */ - it(`FMS_disableFormsUpdate_0400`, 0, async (done) => { - console.log(`FMS_disableFormsUpdate_0400 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_disableFormsUpdate_0400 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("13"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0400")) - - setTimeout(function () { - console.info('FMS_disableFormsUpdate_0400 delPublishCallBack end'); - console.log(`FMS_disableFormsUpdate_0400 end`); - done(); - }, 100) - } - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_disableFormsUpdate_0400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : ["-1"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate _0400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_disableFormsUpdate_0500 - * @tc.name: formID id is error(formID == 0) - * @tc.desc: 1.The form user calls the disable update interface. - * 2.Verify the result of the disable update interface. - */ - it(`FMS_disableFormsUpdate_0500`, 0, async (done) => { - console.log(`FMS_disableFormsUpdate_0500 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_disableFormsUpdate_0500 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("13"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0500")) - - setTimeout(function () { - console.info('FMS_disableFormsUpdate_0500 delPublishCallBack end'); - console.log(`FMS_disableFormsUpdate_0500 end`); - done(); - }, 100) - } - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_disableFormsUpdate_0500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : ["0"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_0500 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_disableFormsUpdate_0600 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.The form user calls the disable update interface. - * 2.Verify the result of the disable update interface. - */ - it(`FMS_disableFormsUpdate_0600`, 0, async (done) => { - console.info(`FMS_disableFormsUpdate_0600 start`); - let hostFormId; - - const onDisableCallback = (_, data) => { - if (data.parameters.kind != "disable") { - return; - } - console.debug("====>FMS_disableFormsUpdate_0600 onDisableCallback data:====>" + JSON.stringify(data)); - - expect(data.data).assertEqual("13"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnDisableCallback("FMS_disableFormsUpdate_0600")); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_disableFormsUpdate_0600")); - const commonEventPublishData = { - data: hostFormId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_disableFormsUpdate_0600", done)); - } - - const onAcquiredCallBack = async (_, data) => { - console.debug("====>FMS_disableFormsUpdate_0600 onAcquiredCallback data:====>" + JSON.stringify(data)); - hostFormId = data.data; - - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": hostFormId, - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "stateForm": "disable", - "stateIds": [hostFormId], - "isCreate": false - } - } - }).then((res: any) => { - console.debug(`FMS_disableFormsUpdate_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_disableFormsUpdate_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_disableFormsUpdate_0600")); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - commonEvent.subscribe(subscriberOnState, onDisableCallback); - console.info(`FMS_disableFormsUpdate_0600 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.debug(`FMS_disableFormsUpdate_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_disableFormsUpdate_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - }); - /** - * @tc.number: FMS_disableFormsUpdate_0700 - * @tc.name: formID id is error because formId is not exist - * @tc.desc: 1.The form user calls the disable update interface. - * 2.Verify the result of the disable update interface. - */ - it(`FMS_disableFormsUpdate_0700`, 0, async (done) => { - console.info(`FMS_disableFormsUpdate_0700 start`); - let hostFormId; - - const onDisableCallback = (_, data) => { - if (data.parameters.kind != "disable") { - return; - } - console.debug("====>FMS_disableFormsUpdate_0700 onDisableCallback data:====>" + JSON.stringify(data)); - - expect(data.data).assertEqual("13"); - commonEvent.unsubscribe(subscriberOnState, () => { - console.info("====>FMS_disableFormsUpdate_0700 unSubscribeOnDisableCallback====>"); - }); - done(); - } - - const onDeleteCallback = async (_, data) => { - console.debug("====>FMS_disableFormsUpdate_0700 onDeleteCallback data:====>" + JSON.stringify(data)); - hostFormId = data.parameters.formId; - - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "stateForm": "disable", - "stateIds": [hostFormId], - "isCreate": false - } - } - }).then((res: any) => { - console.debug(`FMS_disableFormsUpdate_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_disableFormsUpdate_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - commonEvent.unsubscribe(subscriberDel, () => { - console.info("====>FMS_disableFormsUpdate_0700 unSubscribeDelCallback====>"); - }); - } - - commonEvent.subscribe(subscriberDel, onDeleteCallback); - commonEvent.subscribe(subscriberOnState, onDisableCallback); - console.info(`FMS_disableFormsUpdate_0700 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "deleteForm": true, - "deleteId": "self", - "isCreate": true - } - } - }).then((res: any) => { - console.debug(`FMS_disableFormsUpdate_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_disableFormsUpdate_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - }); - /** - * @tc.number: FMS_disableFormsUpdate_0800 - * @tc.name: The form user has form permission. - * @tc.desc: 1.The form user calls the disable update interface. - * 2.Verify the result of the disable update interface. - */ - it(`FMS_disableFormsUpdate_0800`, 0, async (done) => { - console.log(`FMS_disableFormsUpdate_0800 start`); - let formId; - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_disableFormsUpdate_0800 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - formId = data.parameters.formId; - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0800")); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_disableFormsUpdate_0800", done)); - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_disableFormsUpdate_0800 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_0800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_0800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_0800 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_disableFormsUpdate_0900 - * @tc.name: There are correct and wrong formId in the form ID parameter list. - * @tc.desc: 1.The form user calls the disable update interface. - * 2.Verify the result of the disable update interface. - */ - it(`FMS_disableFormsUpdate_0900`, 0, async (done) => { - console.log(`FMS_disableFormsUpdate_0900 start`); - let formId; - - function OnDisableCallBack(_, data) { - console.info("!!!====>FMS_disableFormsUpdate_0900 OnDisableCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnDisableCallback("FMS_disableFormsUpdate_0900")); - - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_disableFormsUpdate_0900", done)); - } - async function OnEnableCallBack(_, data) { - console.info("!!!====>FMS_disableFormsUpdate_0900 OnEnableCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnEnableCallback("FMS_disableFormsUpdate_0900")); - formId = data.parameters.formId; - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, OnDisableCallBack); - console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : [formId, "0"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbility end`); - } - - commonEvent.subscribe(subscriberOnState, OnEnableCallBack); - console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "enable", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_disableFormsUpdate_1000 - * @tc.name: Set next refresh time is invalid when disable form. (cache data < 1k) - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Call the disableFormsUpdate interface. - * 3.Call the setFormNextRefreshTime interface and verify the form can not refresh. - */ - it(`FMS_disableFormsUpdate_1000`, 0, async (done) => { - console.log(`FMS_disableFormsUpdate_1000 start`); - let formId; - - // timer speed up - commonEvent.publish(`fms.time_speed`, { code: 100 }, () => { - console.log(`FMS_disableFormsUpdate_1000 time speed up`); - }); - - function onSupplyEventCallBack(_, data) { - console.debug("====>FMS_disableFormsUpdate_1000 onSupplyEventCallBack====>" + JSON.stringify(data)); - if ("onUpdate" == data.parameters.kind) { - console.debug("FMS_disableFormsUpdate_1000 error, onUpdate called."); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000")); - expect().assertFail(); - } - } - - function onFormDisableCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_disableFormsUpdate_1000 onFormDisableCallBack====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000")); - expect(data.parameters.kind).assertEqual("disable"); - expect(data.data).assertEqual("0"); - - commonEvent.subscribe(subscriberSupply, onSupplyEventCallBack); - - setTimeout(() => { - // timer reset - commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { - console.log(`FMS_disableFormsUpdate_1000 time reset`); - }); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000")); - }, 9000); - - setTimeout(() => { - console.log(`FMS_disableFormsUpdate_1000 onFormDisableCallBack end`); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_disableFormsUpdate_1000", done)); - }, 10000); - } - - async function onAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000")); - console.debug("====>FMS_disableFormsUpdate_1000 onAcquiredCallBack====>" + JSON.stringify(data)); - expect(data.parameters.kind).assertEqual("visible"); - expect(data.data).assertEqual("0"); - formId = data.parameters.formId; - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); - console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility notify disable start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : [formId], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility notify disable end`); - } - - commonEvent.subscribe(subscriberOnState, onAcquiredCallBack); - console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicef.hmservice", - "ability" : "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true, - "stateIds" : ["self"], - "stateForm" : "visible" - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility servicea end`); - }); - - /** - * @tc.number: FMS_disableFormsUpdate_1100 - * @tc.name: Set next refresh time is invalid when disable form. (cache data > 1k) - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Call the disableFormsUpdate interface. - * 3.Call the setFormNextRefreshTime interface and verify the form can not refresh. - */ - it(`FMS_disableFormsUpdate_1100`, 0, async (done) => { - console.log(`FMS_disableFormsUpdate_1100 start`); - let formId; - - // timer speed up - commonEvent.publish(`fms.time_speed`, { code: 100 }, () => { - console.log(`FMS_disableFormsUpdate_1100 time speed up`); - }); - - function onSupplyEventCallBack(_, data) { - console.debug("====>FMS_disableFormsUpdate_1100 onSupplyEventCallBack====>" + JSON.stringify(data)); - if ("onUpdate" == data.parameters.kind) { - console.debug("FMS_disableFormsUpdate_1100 error, onUpdate called."); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100")); - expect().assertFail(); - } - } - - function onFormDisableCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_disableFormsUpdate_1100 onFormDisableCallBack====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100")); - expect(data.parameters.kind).assertEqual("disable"); - expect(data.data).assertEqual("0"); - - commonEvent.subscribe(subscriberSupply, onSupplyEventCallBack); - - setTimeout(() => { - // timer reset - commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { - console.log(`FMS_disableFormsUpdate_1100 time reset`); - }); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100")); - }, 9000); - - setTimeout(() => { - console.log(`FMS_disableFormsUpdate_1100 onFormDisableCallBack end`); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_disableFormsUpdate_1100", done)); - }, 10000); - } - - async function onAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100")); - console.debug("====>FMS_disableFormsUpdate_1100 onAcquiredCallBack====>" + JSON.stringify(data)); - expect(data.parameters.kind).assertEqual("visible"); - expect(data.data).assertEqual("0"); - formId = data.parameters.formId; - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); - console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility notify disable start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : [formId], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility notify disable end`); - } - - commonEvent.subscribe(subscriberOnState, onAcquiredCallBack); - console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviceg.hmservice", - "ability" : "com.form.formsystemtestserviceg.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true, - "stateIds" : ["self"], - "stateForm" : "visible" - } - } - }).then((res: any) => { - console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility servicea end`); - }); - }); -} - -const sleep = async delay => { - return new Promise((resolve, _) => { - setTimeout(async () => { - resolve(0); - }, delay); - }); -}; - -const delPublishCallback = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000); -} - -const unsubscribeOnStateCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); -} - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); -} - -const unsubscribeOnDisableCallback = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnDisableCallback====>`); -} - -const unsubscribeOnEnableCallback = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnEnableCallback====>`); -} - -const unsubscribeSupplyCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index ea2d993ef..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsFormStateDisable.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 95817e60f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formdisablestatetest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json deleted file mode 100644 index a9ffd9e0f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formstateenabletest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormStateEnableTest.hap", - "FormSystemHostF.hap", - "FormSystemHostG.hap", - "FormSystemHostNoPerm.hap", - "FormSupplyAppA.hap", - "FormSupplyAppE.hap", - "FormSupplyAppF.hap", - "FormSupplyAppH.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json deleted file mode 100644 index 60cf1e361..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formstateenabletest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formstateenabletest", - "name": ".FormStateSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnState_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent", - "reason": "need use OnError commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent", - "reason": "need use OnDeleted commonEvent" - }, - { - "name": "FMS_FormOnState_commonEvent", - "reason": "need use OnState commonEvent" - }, - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 83dd3d4f8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 445968cfc..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 30000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Main Ability Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets deleted file mode 100644 index 0c4153104..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets +++ /dev/null @@ -1,898 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; - -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; - -var onDeletedFormEvent = { - events: ["FMS_FormOnDeleted_commonEvent"], -}; - -var onStateFormEvent = { - events: ["FMS_FormOnState_commonEvent"], -}; - -var onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - -var subscriberOnAcquired; -var subscriberDel; -var subscriberOnState; -var subscriberSupply; - -export default function test() { - describe(`FmsStateFormTest`, () => { - - beforeAll(async (done) => { - done(); - }) - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent); - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - await sleep(1000); - }) - - /** - * @tc.number: FMS_enableFormsUpdate_0200 - * @tc.name: The form user does not have permission. - * @tc.desc: 1.The form user calls the enable update interface. - * 2.Verify the result of the enable update interface. - */ - it(`FMS_enableFormsUpdate_0200`, 0, async (done) => { - console.log(`FMS_enableFormsUpdate_0200 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_enableFormsUpdate_0200 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("2"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0200")); - setTimeout(function () { - console.info('FMS_enableFormsUpdate_0200 onStateCallBack end'); - console.log(`FMS_enableFormsUpdate_0200 end`); - done(); - }, 1000); - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_enableFormsUpdate_0200 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostnoperm", - abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "enable", - "stateIds" : ["1"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_0200 featureAbility.startAbility again end`); - }); - /** - * @tc.number: FMS_enableFormsUpdate_0300 - * @tc.name: The length of the formId list is 0 (no formId) - * @tc.desc: 1.The form user calls the enable update interface. - * 2.Verify the result of the enable update interface. - */ - it(`FMS_enableFormsUpdate_0300`, 0, async (done) => { - console.log(`FMS_enableFormsUpdate_0300 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_enableFormsUpdate_0300 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("7"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0300")) - - setTimeout(function () { - console.info('FMS_enableFormsUpdate_0300 delPublishCallBack end'); - console.log(`FMS_enableFormsUpdate_0300 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_enableFormsUpdate_0300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "enable", - "stateIds" : [], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_0300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_enableFormsUpdate_0400 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.The form user calls the enable update interface. - * 2.Verify the result of the enable update interface. - */ - it(`FMS_enableFormsUpdate_0400`, 0, async (done) => { - console.log(`FMS_enableFormsUpdate_0400 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_enableFormsUpdate_0400 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("13"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0400")) - - setTimeout(function () { - console.info('FMS_enableFormsUpdate_0400 delPublishCallBack end'); - console.log(`FMS_enableFormsUpdate_0400 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_enableFormsUpdate_0400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "enable", - "stateIds" : ["-1"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_0400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_enableFormsUpdate_0500 - * @tc.name: formID id is error(formID == 0) - * @tc.desc: 1.The form user calls the enable update interface. - * 2.Verify the result of the enable update interface. - */ - it(`FMS_enableFormsUpdate_0500`, 0, async (done) => { - console.log(`FMS_enableFormsUpdate_0500 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_enableFormsUpdate_0500 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("13"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0500")) - - setTimeout(function () { - console.info('FMS_enableFormsUpdate_0500 delPublishCallBack end'); - console.log(`FMS_enableFormsUpdate_0500 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_enableFormsUpdate_0500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "enable", - "stateIds" : ["0"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_0500 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_enableFormsUpdate_0600 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.The form user calls the enable update interface. - * 2.Verify the result of the enable update interface. - */ - it(`FMS_enableFormsUpdate_0600`, 0, async (done) => { - console.info(`FMS_enableFormsUpdate_0600 start`); - let hostFormId; - - const onEnableCallback = (_, data) => { - if (data.parameters.kind != "enable") { - return; - } - console.debug("====>FMS_enableFormsUpdate_0600 onEnableCallback data:====>" + JSON.stringify(data)); - - expect(data.data).assertEqual("13"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0600")); - const commonEventPublishData = { - data: hostFormId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_enableFormsUpdate_0600", done)); - } - - const onAcquiredCallBack = async (_, data) => { - console.debug("====>FMS_enableFormsUpdate_0600 onAcquiredCallback data:====>" + JSON.stringify(data)); - hostFormId = data.data; - - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": hostFormId, - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "stateForm": "enable", - "stateIds": [hostFormId], - "isCreate": false - } - } - }).then((res: any) => { - console.debug(`FMS_enableFormsUpdate_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_enableFormsUpdate_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_enableFormsUpdate_0600")); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - commonEvent.subscribe(subscriberOnState, onEnableCallback); - console.info(`FMS_enableFormsUpdate_0600 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.debug(`FMS_enableFormsUpdate_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_enableFormsUpdate_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - }); - /** - * @tc.number: FMS_enableFormsUpdate_0700 - * @tc.name: formID id is error because formId is not exist - * @tc.desc: 1.The form user calls the enable update interface. - * 2.Verify the result of the enable update interface. - */ - it(`FMS_enableFormsUpdate_0700`, 0, async (done) => { - console.info(`FMS_enableFormsUpdate_0700 start`); - let hostFormId; - - const onEnableCallback = (_, data) => { - if (data.parameters.kind != "enable") { - return; - } - console.debug("====>FMS_enableFormsUpdate_0700 onEnableCallback data:====>" + JSON.stringify(data)); - - expect(data.data).assertEqual("13"); - commonEvent.unsubscribe(subscriberOnState, () => { - console.info("====>FMS_enableFormsUpdate_0700 unSubscribeOnEnableCallback====>"); - }); - done(); - } - - const onDeleteCallback = async (_, data) => { - console.debug("====>FMS_enableFormsUpdate_0700 onDeleteCallback data:====>" + JSON.stringify(data)); - hostFormId = data.parameters.formId; - - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "stateForm": "enable", - "stateIds": [hostFormId], - "isCreate": false - } - } - }).then((res: any) => { - console.debug(`FMS_enableFormsUpdate_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_enableFormsUpdate_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - commonEvent.unsubscribe(subscriberDel, () => { - console.info("====>FMS_enableFormsUpdate_0700 unSubscribeDelCallback====>"); - }); - } - - commonEvent.subscribe(subscriberDel, onDeleteCallback); - commonEvent.subscribe(subscriberOnState, onEnableCallback); - console.info(`FMS_enableFormsUpdate_0700 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "deleteForm": true, - "deleteId": "self", - "isCreate": true - } - } - }).then((res: any) => { - console.debug(`FMS_enableFormsUpdate_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_enableFormsUpdate_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - }); - - /** - * @tc.number: FMS_enableFormsUpdate_0900 - * @tc.name: Use -1 form Id and created 2 form card Id notify the form to be invisible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_enableFormsUpdate_0900`, 0, async (done) => { - console.log(`FMS_enableFormsUpdate_0900 start`); - let formIds = []; - - // timer speed up - commonEvent.publish(`fms.time_speed`, { code: 300 }, () => { - console.log(`FMS_enableFormsUpdate_0900 time speed up`); - }); - - function onUpdateCallBack(_, data) { - if (data.parameters.kind == "onUpdate") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_0900 onUpdateCallBack====>" + JSON.stringify(data)); - expect(data.parameters.parameters).assertEqual(formIds[0]); - - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); - - commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { - console.log(`FMS_enableFormsUpdate_0900 time reset`); - }); - - setTimeout(() => { - let commonEventPublishData = { - data: formIds[0] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_enableFormsUpdate_0900", done)); - }, 2000); - } - } - - function onFormEnableCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_0900 onFormEnableCallBack====>" + JSON.stringify(data)); - expect(data.parameters.formId).assertEqual(formIds[0]); - expect(data.parameters.kind).assertEqual("enable"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); - } - - async function onFormDisableCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_0900 onFormDisableCallBack====>" + JSON.stringify(data)); - expect(data.parameters.formId).assertEqual(formIds[0]); - expect(data.parameters.kind).assertEqual("disable"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, onFormEnableCallBack); - commonEvent.subscribe(subscriberSupply, onUpdateCallBack); - - setTimeout(async () => { - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notifyVisible start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "enable", - "stateIds" : formIds, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notifyVisible end`); - }, 10000); - } - - async function onAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); - console.debug("====>FMS_enableFormsUpdate_0900 onAcquiredCallBack====>" + JSON.stringify(data)); - formIds.push(data.data); - - commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notify disable start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : formIds, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notify disable end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicee.hmservice", - "ability" : "com.form.formsystemtestservicee.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility servicea end`); - }); - - /** - * @tc.number: FMS_enableFormsUpdate_1000 - * @tc.name: Use -1 form Id and created 2 form card Id notify the form to be invisible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_enableFormsUpdate_1000`, 0, async (done) => { - console.log(`FMS_enableFormsUpdate_1000 start`); - let formIds = []; - - // timer speed up - commonEvent.publish(`fms.time_speed`, { code: 300 }, () => { - console.log(`FMS_enableFormsUpdate_1000 time speed up`); - }); - - function onUpdateCallBack(_, data) { - if (data.parameters.kind == "onUpdate") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_1000 onUpdateCallBack====>" + JSON.stringify(data)); - expect(data.parameters.parameters).assertEqual(formIds[0]); - - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1000")); - - commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { - console.log(`FMS_enableFormsUpdate_1000 time reset`); - }); - - setTimeout(() => { - let commonEventPublishData = { - data: formIds[0] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_enableFormsUpdate_1000", done)); - }, 2000); - } - } - - function onFormEnableCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_1000 onFormEnableCallBack====>" + JSON.stringify(data)); - expect(data.parameters.formId).assertEqual(formIds[0]); - expect(data.parameters.kind).assertEqual("enable"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1000")); - } - - async function onFormDisableCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_1000 onFormDisableCallBack====>" + JSON.stringify(data)); - expect(data.parameters.formId).assertEqual(formIds[0]); - expect(data.parameters.kind).assertEqual("disable"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1000")); - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, onFormEnableCallBack); - commonEvent.subscribe(subscriberSupply, onUpdateCallBack); - - setTimeout(async () => { - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility notifyVisible start`); - formIds.push("0"); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "enable", - "stateIds" : formIds, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility notifyVisible end`); - }, 10000); - } - - function onAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1000")); - console.debug("====>FMS_enableFormsUpdate_1000 onAcquiredCallBack====>" + JSON.stringify(data)); - formIds.push(data.data); - commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility notify disable start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : formIds, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility notify disable end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicee.hmservice", - "ability" : "com.form.formsystemtestservicee.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility servicea end`); - }); - - /** - * @tc.number: FMS_enableFormsUpdate_1200 - * @tc.name: Use -1 form Id and created 2 form card Id notify the form to be visible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_enableFormsUpdate_1200`, 0, async (done) => { - console.log(`FMS_enableFormsUpdate_1200 start`); - let formIds = new Array(); - let count = 0; - - // timer speed up - commonEvent.publish(`fms.time_speed`, { code: 300 }, () => { - console.log(`FMS_enableFormsUpdate_1200 time speed up`); - }); - - function delPublishCallBack1(_, data) { - console.info("!!!====>FMS_enableFormsUpdate_1200 delPublishCallBack1====>" + JSON.stringify(data)); - setTimeout(function () { - console.info('FMS_enableFormsUpdate_1200 delPublishCallBack1 end'); - console.log(`FMS_enableFormsUpdate_1200 end`); - }, 1000); - } - function delPublishCallBack2(_, data) { - console.info("!!!====>FMS_enableFormsUpdate_1200 delPublishCallBack2====>" + JSON.stringify(data)); - setTimeout(function () { - console.info('FMS_enableFormsUpdate_1200 delPublishCallBack2 end'); - console.log(`FMS_enableFormsUpdate_1200 end`); - done(); - }, 1000); - } - - function onUpdateCallBack(_, data) { - if (data.parameters.kind == "onUpdate") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_1200 onUpdateCallBack====>" + JSON.stringify(data)); - expect(formIds.includes(data.parameters.parameters)).assertEqual(true); - - ++count; - if (count == 2) { - console.debug("====>FMS_enableFormsUpdate_1200 OK====>"); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); - - commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { - console.log(`FMS_enableFormsUpdate_1200 time reset`); - }); - - setTimeout(() => { - let commonEventPublishData1 = { - data: formIds[0] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData1, delPublishCallBack1); - let commonEventPublishData2 = { - data: formIds[1] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack2); - }, 2000); - } - } - } - - function onFormEnableCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_1200 onFormEnableCallBack====>" + JSON.stringify(data)); - expect(data.parameters.kind).assertEqual("enable"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); - } - - async function onFormDisableCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_1200 onFormDisableCallBack====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, onFormEnableCallBack); - commonEvent.subscribe(subscriberSupply, onUpdateCallBack); - setTimeout(async () => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility notifyVisible start`); - formIds.push("0"); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "enable", - "stateIds" : formIds, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility notifyVisible end`); - }, 10000); - } - - async function onSecondAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); - console.debug("====>FMS_enableFormsUpdate_1200 onSecondAcquiredCallBack====>" + JSON.stringify(data)); - formIds.push(data.data); - console.debug("====>FMS_enableFormsUpdate_1200 formIds====>" + formIds); - - commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); - - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility notify disable start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "disable", - "stateIds" : formIds, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility notify disable end`); - } - - async function onFirstAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); - console.debug("====>FMS_enableFormsUpdate_1200 onFirstAcquiredCallBack====>" + JSON.stringify(data)); - formIds.push(data.data); - - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onSecondAcquiredCallBack); - - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility serviceb start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviceh.hmservice", - "ability" : "com.form.formsystemtestserviceh.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility serviceb end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onFirstAcquiredCallBack); - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicee.hmservice", - "ability" : "com.form.formsystemtestservicee.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility servicea end`); - }); - }); -} - -const sleep = async delay => { - return new Promise((resolve, _) => { - setTimeout(async () => { - resolve(0); - }, delay); - }); -}; - -const delPublishCallback = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000); -} - -const unsubscribeOnStateCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); -} - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); -} - -const unsubscribeSupplyCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 076280f46..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsFormStateEnable.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d3a7164e2..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formenablestatetest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/Test.json deleted file mode 100644 index e1ca3b3d5..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/Test.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formstatenotifyinvisibletest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormStateNotifyInvisibleTest.hap", - "FormSystemHostF.hap", - "FormSystemHostG.hap", - "FormSystemHostNoPerm.hap", - "FormSupplyAppA.hap", - "FormSupplyAppF.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json deleted file mode 100644 index ce10856f7..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formstatenotifyinvisibletest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formstatenotifyinvisibletest", - "name": ".FormStateSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnState_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent", - "reason": "need use OnError commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent", - "reason": "need use OnDeleted commonEvent" - }, - { - "name": "FMS_FormOnState_commonEvent", - "reason": "need use OnState commonEvent" - }, - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 83dd3d4f8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 5c5eb0b2f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 10000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Main Ability Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets deleted file mode 100644 index b11cd430d..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets +++ /dev/null @@ -1,538 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { describe, beforeEach, expect, it } from "deccjsunit/index"; - -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; - -var onDeletedFormEvent = { - events: ["FMS_FormOnDeleted_commonEvent"], -}; - -var onStateFormEvent = { - events: ["FMS_FormOnState_commonEvent"], -}; - -var onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - -var subscriberOnAcquired; -var subscriberDel; -var subscriberOnState; -var subscriberSupply; - -export default function test() { - describe(`FmsStateFormTest`, () => { - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent); - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - await sleep(1000); - }) - - /** - * @tc.number: FMS_notifyInvisibleForms_0200 - * @tc.name: The form user does not have permission. - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_0200`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_0200 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0200 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("2"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0200")); - setTimeout(function () { - console.info('FMS_notifyInvisibleForms_0200 onStateCallBack end'); - console.log(`FMS_notifyInvisibleForms_0200 end`); - done(); - }, 1000) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyInvisibleForms_0200 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostnoperm", - abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : ["1"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0200 featureAbility.startAbility again end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_0300 - * @tc.name: The length of the formId list is 0 (no formId) - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_0300`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_0300 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0300 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("7"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0300")) - - setTimeout(function () { - console.info('FMS_notifyInvisibleForms_0300 delPublishCallBack end'); - console.log(`FMS_notifyInvisibleForms_0300 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyInvisibleForms_0300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : [], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_0400 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_0400`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_0400 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0400 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0400")) - - setTimeout(function () { - console.info('FMS_notifyInvisibleForms_0400 delPublishCallBack end'); - console.log(`FMS_notifyInvisibleForms_0400 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyInvisibleForms_0400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : ["-1"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_0500 - * @tc.name: formID id is error(formID == 0) - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_0500`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_0500 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0500 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0500")) - - setTimeout(function () { - console.info('FMS_notifyInvisibleForms_0500 delPublishCallBack end'); - console.log(`FMS_notifyInvisibleForms_0500 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyInvisibleForms_0500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : ["0"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0500 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_0600 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_0600`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_0600 start`); - let formId; - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0600 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0600")); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyInvisibleForms_0600", done)); - } - - async function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0600 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_notifyInvisibleForms_0600")) - formId = data.data; - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : [formId], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_0700 - * @tc.name: form has been deleted - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_0700`, 0, async (done) => { - console.info(`FMS_notifyInvisibleForms_0700 start`); - let hostFormId; - - const onSupplyCallback = (_, data) => { - if (data.parameters.kind != "onVisibilityChange") { - return; - } - console.debug("====>FMS_notifyInvisibleForms_0700 onSupplyCallback data:====>" + JSON.stringify(data)); - expect().assertFail(); - } - - const onInvisibleCallback = (_, data) => { - if (data.parameters.kind != "invisible") { - return; - } - console.debug("====>FMS_notifyInvisibleForms_0700 onInvisibleCallback data:====>" + JSON.stringify(data)); - - expect(data.data).assertEqual("0"); - expect(data.parameters.formId).assertEqual(hostFormId); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0700")); - setTimeout(() => { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_0700")); - done(); - }, 2000); - } - - const onDeleteCallback = async (_, data) => { - console.debug("====>FMS_notifyInvisibleForms_0700 onDeleteCallback data:====>" + JSON.stringify(data)); - hostFormId = data.parameters.formId; - - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "stateForm": "invisible", - "stateIds": [hostFormId], - "isCreate": false - } - } - }).then((res: any) => { - console.debug(`FMS_notifyInvisibleForms_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_notifyInvisibleForms_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - commonEvent.unsubscribe(subscriberDel, () => { - console.info("====>FMS_notifyInvisibleForms_0700 unSubscribeDelCallback====>"); - }); - } - - commonEvent.subscribe(subscriberDel, onDeleteCallback); - commonEvent.subscribe(subscriberOnState, onInvisibleCallback); - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - console.info(`FMS_notifyInvisibleForms_0700 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "deleteForm": true, - "deleteId": "self", - "isCreate": true - } - } - }).then((res: any) => { - console.debug(`FMS_notifyInvisibleForms_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_notifyInvisibleForms_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_0800 - * @tc.name: The form provider is the system application and config When form visiblenotify is true, - * the form provider can be notified that the form is invisible. - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_0800`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_0800 start`); - let formIdInvisible; - let formIdVisible; - let onSupplyCount = 0; - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyInvisibleForms_0800 onSupplyCallBack====>" + JSON.stringify(data)); - onSupplyCount++; - if (onSupplyCount == 2) { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_0800")); - } - if (formIdInvisible && formIdVisible) { - let commonEventPublishData = { - data: formIdInvisible - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyInvisibleForms_0800", done)); - } - } - } - - function OnInvisibleCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0800 OnInvisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - formIdInvisible = data.parameters.formId; - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0800")); - if (formIdInvisible && formIdVisible && onSupplyCount == 2) { - let commonEventPublishData = { - data: formIdInvisible - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyInvisibleForms_0800", done)); - } - } - async function onVisibleCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0800 onVisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0800")); - formIdVisible = data.parameters.formId; - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, OnInvisibleCallBack); - console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : [formIdVisible], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnState, onVisibleCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbility end`); - }); - }); -} - -const sleep = async delay => { - return new Promise((resolve, _) => { - setTimeout(async () => { - resolve(0); - }, delay); - }); -}; - -const delPublishCallback = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000); -} - -const unsubscribeOnStateCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); -} - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); -} - -const unsubscribeSupplyCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 03a00d675..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsFormStateNotifyInvisible.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 3c18b675c..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "forminvisiblestatetest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/BUILD.gn b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/BUILD.gn deleted file mode 100644 index aa217f7aa..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsFormStateNotifyInvisibleTest2") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsFormStateNotifyInvisibleTest2" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/Test.json deleted file mode 100644 index 23b63b48d..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/Test.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formstatenotifyinvisibletest2", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormStateNotifyInvisibleTest2.hap", - "FormSystemHostG.hap", - "FormSupplyAppA.hap", - "FormSupplyAppB.hap", - "FormSupplyAppD.hap", - "FormSupplyAppF.hap", - "FormSupplyAppNS.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json deleted file mode 100644 index 27a08f66e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formstatenotifyinvisibletest2", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formstatenotifyinvisibletest2", - "name": ".FormStateSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnState_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent", - "reason": "need use OnError commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent", - "reason": "need use OnDeleted commonEvent" - }, - { - "name": "FMS_FormOnState_commonEvent", - "reason": "need use OnState commonEvent" - }, - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 83dd3d4f8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 5c5eb0b2f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 10000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Main Ability Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets deleted file mode 100644 index 65bacd7e0..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets +++ /dev/null @@ -1,817 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { beforeEach, describe, expect, it } from "deccjsunit/index"; - -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; - -var onStateFormEvent = { - events: ["FMS_FormOnState_commonEvent"], -}; - -var onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - -var subscriberOnAcquired; -var subscriberOnState; -var subscriberSupply; - -export default function test() { - - describe(`FmsStateFormTest`, () => { - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - await sleep(1000); - }) - - /** - * @tc.number: FMS_notifyInvisibleForms_0900 - * @tc.name: There are correct and wrong formId in the form ID parameter list - * that informs that the form is invisible. - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_0900`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_0900 start`); - let formIdInvisible; - let formIdVisible; - let onSupplyCount = 0; - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyInvisibleForms_0900 onSupplyCallBack====>" + JSON.stringify(data)); - onSupplyCount++; - if (onSupplyCount == 2) { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_0900")); - } - if (formIdInvisible && formIdVisible) { - let commonEventPublishData = { - data: formIdInvisible - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyInvisibleForms_0900", done)); - } - } - } - - function OnInvisibleCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0900 OnInvisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - formIdInvisible = data.parameters.formId; - commonEvent.unsubscribe(subscriberOnState, unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0900")); - if (formIdInvisible && formIdVisible && onSupplyCount == 2) { - let commonEventPublishData = { - data: formIdInvisible - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyInvisibleForms_0900", done)); - } - } - async function onVisibleCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_0900 onVisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0900")); - formIdVisible = data.parameters.formId; - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, OnInvisibleCallBack); - console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : [formIdVisible, "0"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnState, onVisibleCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_1000 - * @tc.name: When the form provider is not a system application, notify the form to be invisible - * and do not pull up the form provider. - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_1000`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_1000 start`); - - function onVisibleCallBack(_, data) { - if (data.parameters.kind != "invisible") { - return; - } - console.info("!!!====>FMS_notifyInvisibleForms_1000 onVisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - - setTimeout(function () { - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1000")); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1000")); - - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyInvisibleForms_0900", done)); - }, 2000); - } - function onSupplyEventCallBack(_, data) { - if (data.parameters.kind != "onVisibilityChange") { - return; - } - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1000")); - console.debug("====>FMS_notifyInvisibleForms_1000 onSupplyEventCallBack====>" + JSON.stringify(data)); - console.log(`FMS_notifyInvisibleForms_1000 error`); - expect().assertFail(); - } - commonEvent.subscribe(subscriberOnState, onVisibleCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyEventCallBack); - console.log(`FMS_notifyInvisibleForms_1000 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicenotsysapp.hmservice", - "ability" : "com.form.formsystemtestservicenotsysapp.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_1000 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_1100 - * @tc.name: When formVisibleNotify is false in config.json, - * the form provider will not be pulled when the card is invisible. - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_1100`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_1100 start`); - let supplyFlag = false; - let formIdInvisible; - let formIdVisible; - - function delPublishCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1100 delPublishCallBack====>"); - setTimeout(function () { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1100")); - if (supplyFlag) { - expect().assertFail(); - } - console.info('FMS_notifyInvisibleForms_1100 delPublishCallBack end'); - console.log(`FMS_notifyInvisibleForms_1100 end`); - done(); - }, 1000); - } - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyInvisibleForms_1100 onSupplyCallBack====>" + JSON.stringify(data)); - supplyFlag = true; - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1100")); - - if (formIdInvisible && formIdVisible) { - let commonEventPublishData = { - data: formIdInvisible - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); - } - } - } - - function OnInvisibleCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1100 OnInvisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - formIdInvisible = data.parameters.formId; - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1100")); - if (formIdInvisible && formIdVisible) { - let commonEventPublishData = { - data: formIdInvisible - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); - } - } - async function onVisibleCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1100 onVisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1100")); - formIdVisible = data.parameters.formId; - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, OnInvisibleCallBack); - - console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviced.hmservice", - "ability" : "com.form.formsystemtestserviced.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : [formIdVisible], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnState, onVisibleCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviced.hmservice", - "ability" : "com.form.formsystemtestserviced.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_1200 - * @tc.name: When formVisibleNotify in config.json is true, - * the provider can be notified of the visibility of the form. - * @tc.desc: 1. The form is created successfully. - * 2. The invisible interface is invoked successfully, - * and the visibility notification of form providers A and B is triggered. - * The formId is the same as the created formId, and the visibility status is invisible. - */ - it(`FMS_notifyInvisibleForms_1200`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_1200 start`); - let formId1; - let formId2; - let delCount = 0; - let onSupplyCount = 0; - - function delPublishCallBack() { - console.info("!!!====>FMS_notifyInvisibleForms_1200 delPublishCallBack====>"); - delCount++; - if (delCount == 2) { - setTimeout(function () { - console.info('FMS_notifyInvisibleForms_1200 delPublishCallBack end'); - console.info('FMS_notifyInvisibleForms_1200 end'); - done(); - }, 500); - } - } - function onAcquiredCallBack_Normal1(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1200 onAcquiredCallBack_Normal1 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal1) - formId1 = data.data; - - FMS_notifyInvisibleForms_1200_normal2(); - } - function unSubscribeOnAcquiredCallBack_Normal1() { - console.debug("====>FMS_notifyInvisibleForms_1200 unSubscribeOnAcquiredCallBack_Normal1 CallBack====>"); - } - - async function FMS_notifyInvisibleForms_1200_normal1() { - console.log(`FMS_notifyInvisibleForms_1200_normal1 start`); - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal1); - console.log(`FMS_notifyInvisibleForms_1200_normal1 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1200_normal1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1200_normal1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.log(`FMS_notifyInvisibleForms_1200_normal1 featureAbility.startAbility end`); - console.log(`FMS_notifyInvisibleForms_1200_normal1 end`); - } - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1200 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1200")) - console.info("!!!====>FMS_notifyInvisibleForms_1200 onStateCallBack formId1:====>" + formId1); - console.info("!!!====>FMS_notifyInvisibleForms_1200 onStateCallBack formId2:====>" + formId2); - console.info("!!!====>FMS_notifyInvisibleForms_1200 onStateCallBack onSupplyCount:====>" + onSupplyCount); - if (formId1 && formId2 && onSupplyCount == 2) { - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); - let commonEventPublishData2 = { - data: formId2 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack); - } - } - - async function onAcquiredCallBack_Normal2(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1200 onAcquiredCallBack_Normal2 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal2); - formId2 = data.data; - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyInvisibleForms_1200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : [formId1, formId2], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_1200 featureAbility.startAbility end`); - } - function unSubscribeOnAcquiredCallBack_Normal2() { - console.debug("====>FMS_notifyInvisibleForms_1200 unSubscribeOnAcquiredCallBack_Normal2====>"); - } - async function FMS_notifyInvisibleForms_1200_normal2() { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal2); - console.log(`FMS_notifyInvisibleForms_1200_normal2 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviceb.hmservice", - "ability" : "com.form.formsystemtestserviceb.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1200_normal2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1200_normal2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.log(`FMS_notifyInvisibleForms_1200_normal2 featureAbility.startAbility end`); - } - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyInvisibleForms_1200 onSupplyCallBack====>" + JSON.stringify(data)); - let parameters = JSON.parse(data.parameters.parameters); - if(parameters[formId1]) { - expect(parameters[formId1]).assertEqual(2); - } - if(parameters[formId2]) { - expect(parameters[formId2]).assertEqual(2); - } - - onSupplyCount++; - if (onSupplyCount == 2) { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1200")); - } - if (formId1 && formId2) { - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); - let commonEventPublishData2 = { - data: formId2 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack); - } - } - } - - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - FMS_notifyInvisibleForms_1200_normal1(); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_1300 - * @tc.name: When formVisibleNotify is true in config.json, - * the form provider will be pulled when the card is invisible. - * @tc.desc: 1.The form user calls the invisible notification interface. - * 2.Verify the result of the invisible notification interface. - */ - it(`FMS_notifyInvisibleForms_1300`, 0, async (done) => { - console.info(`FMS_notifyInvisibleForms_1300 start`); - let hostFormId; - let providerFormId; - let counter = 0; - - const delPublishCallback = (_, data) => { - console.info("!!!====>FMS_notifyInvisibleForms_1300 delPublishCallback====>"); - setTimeout(() => { - expect(hostFormId).assertEqual(providerFormId); - console.info('FMS_notifyInvisibleForms_1300 delPublishCallback end'); - console.info(`FMS_notifyInvisibleForms_1300 end`); - done(); - }, 1000); - } - - const onSupplyCallback = (_, data) => { - if (data.parameters.kind != "onVisibilityChange") { - return; - } - console.debug("====>FMS_notifyInvisibleForms_1300 onSupplyCallback data:====>" + JSON.stringify(data)); - providerFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; - const visibilityStatus = JSON.parse(data.parameters.parameters)[providerFormId]; - - expect(visibilityStatus).assertEqual(2); - commonEvent.unsubscribe(subscriberSupply, () => { - console.info("====>FMS_notifyInvisibleForms_1300 unSubscribeSupplyCallback====>"); - }); - if (++counter == 2) { - const commonEventPublishData = { - data: providerFormId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - } - } - - const onInvisibleCallback = (_, data) => { - if (data.parameters.kind != "invisible") { - return; - } - console.debug("====>FMS_notifyInvisibleForms_1300 onInvisibleCallback data:====>" + JSON.stringify(data)); - hostFormId = data.parameters.formId; - - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => { - console.info("====>FMS_notifyInvisibleForms_1300 unSubscribeOnInvisibleCallback====>"); - }); - if (++counter == 2) { - const commonEventPublishData = { - data: hostFormId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - } - } - - commonEvent.subscribe(subscriberOnState, onInvisibleCallback); - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - console.info(`FMS_notifyInvisibleForms_1300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "stateForm": "invisible", - "stateIds": ["self"], - "isCreate": true - } - } - }).then((res: any) => { - console.debug(`FMS_notifyInvisibleForms_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_notifyInvisibleForms_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - }); - - /** - * @tc.number: FMS_notifyInvisibleForms_1400 - * @tc.name: Use -1 form Id and created 2 form card Id notify the form to be invisible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyInvisibleForms_1400`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_1400 start`); - let formIds = new Array(); - let count = 0; - - function delPublishCallBack1(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1400 delPublishCallBack1====>" + JSON.stringify(data)); - setTimeout(function () { - console.info('FMS_notifyInvisibleForms_1400 delPublishCallBack1 end'); - console.log(`FMS_notifyInvisibleForms_1400 end`); - }, 1000); - } - function delPublishCallBack2(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1400 delPublishCallBack2====>" + JSON.stringify(data)); - setTimeout(function () { - console.info('FMS_notifyInvisibleForms_1400 delPublishCallBack2 end'); - console.log(`FMS_notifyInvisibleForms_1400 end`); - done(); - }, 1000); - } - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyInvisibleForms_1400 onSupplyCallBack====>" + JSON.stringify(data)); - - let retFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; - const visibilityStatus = JSON.parse(data.parameters.parameters)[retFormId]; - expect(formIds.includes(retFormId)).assertTrue(); - expect(visibilityStatus).assertEqual(2); - - ++count; - if (count == 2) { - console.debug("====>FMS_notifyInvisibleForms_1400 OK====>"); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1400")); - - let commonEventPublishData1 = { - data: formIds[0] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData1, delPublishCallBack1); - let commonEventPublishData2 = { - data: formIds[1] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack2); - } - } - } - - async function onSecondAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1400")); - console.debug("====>FMS_notifyInvisibleForms_1400 onSecondAcquiredCallBack====>" + JSON.stringify(data)); - formIds.push(data.data); - formIds.push("-1"); - console.debug("====>FMS_notifyInvisibleForms_1400 formIds====>" + formIds); - - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility notifyInVisible start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : formIds, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility notifyInVisible end`); - } - - async function onFirstAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1400")); - console.debug("====>FMS_notifyInvisibleForms_1400 onFirstAcquiredCallBack====>" + JSON.stringify(data)); - formIds.push(data.data); - - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onSecondAcquiredCallBack); - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility serviceb start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviceb.hmservice", - "ability" : "com.form.formsystemtestserviceb.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility serviceb end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onFirstAcquiredCallBack); - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility servicea end`); - }); - /** - * @tc.number: FMS_notifyInvisibleForms_1500 - * @tc.name: The size of invisible form ids in the notification form array exceeds 32. - * @tc.desc: 1. Failed to invoke the invisibility interface (parameter error). - */ - it(`FMS_notifyInvisibleForms_1500`, 0, async (done) => { - console.log(`FMS_notifyInvisibleForms_1500 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyInvisibleForms_1500 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("7"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1500")) - - setTimeout(function () { - console.info('FMS_notifyInvisibleForms_1500 delPublishCallBack end'); - console.log(`FMS_notifyInvisibleForms_1500 end`); - done(); - }, 100) - } - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyInvisibleForms_1500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : [ - "1","2","3","4","5","6","7","8","9","10","11","12","13","14", - "15","16","17","18","19","20","21","22","23","24","25","26", - "27","28","29","30","31","32","33" - ], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyInvisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyInvisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyInvisibleForms_1500 featureAbility.startAbility end`); - }); - }); -} - -const sleep = async delay => { - return new Promise((resolve, _) => { - setTimeout(async () => { - resolve(0); - }, delay); - }); -}; - -const delPublishCallback = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000); -} - -const unsubscribeOnStateCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); -} - -const unsubscribeSupplyCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 6a25dbcbb..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsFormStateNotifyInvisible2.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 3c18b675c..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "forminvisiblestatetest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/Test.json deleted file mode 100644 index a2bdae2a2..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/Test.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.ohos.st.formstatenotifyvisibletest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormStateNotifyVisibleTest.hap", - "FormSystemHostF.hap", - "FormSystemHostG.hap", - "FormSystemHostNoPerm.hap", - "FormSupplyAppA.hap", - "FormSupplyAppB.hap", - "FormSupplyAppD.hap", - "FormSupplyAppE.hap", - "FormSupplyAppF.hap", - "FormSupplyAppG.hap", - "FormSupplyAppH.hap", - "FormSupplyAppNS.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json deleted file mode 100644 index 1cfc6433e..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formstatenotifyvisibletest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formstatenotifyvisibletest", - "name": ".FormStateSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnState_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent", - "reason": "need use OnError commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent", - "reason": "need use OnDeleted commonEvent" - }, - { - "name": "FMS_FormOnState_commonEvent", - "reason": "need use OnState commonEvent" - }, - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 83dd3d4f8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 5c5eb0b2f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 10000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Main Ability Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets deleted file mode 100644 index 0f9446e08..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets +++ /dev/null @@ -1,1376 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; - -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; - -var onStateFormEvent = { - events: ["FMS_FormOnState_commonEvent"], -}; - -var onSupplyEvent = { - events: ["FMS_FormSupply_commonEvent"], -}; - -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - -var subscriberOnAcquired; -var subscriberOnState; -var subscriberSupply; - -export default function test() { - describe(`FmsStateFormTest`, () => { - - beforeAll(async (done) => { - done(); - }) - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - await sleep(1000); - }) - - - /** - * @tc.number: FMS_notifyVisibleForms_0200 - * @tc.name: The form user does not have permission. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_0200`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_0200 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_0200 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("2"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0200")); - setTimeout(function () { - console.info('FMS_notifyVisibleForms_0200 onStateCallBack end'); - console.log(`FMS_notifyVisibleForms_0200 end`); - done(); - }, 1000) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyVisibleForms_0200 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostnoperm", - abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["1"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_0200 featureAbility.startAbility again end`); - }); - /** - * @tc.number: FMS_notifyVisibleForms_0300 - * @tc.name: The length of the formId list is 0 (no formId) - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_0300`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_0300 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_0300 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("7"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0300")); - - setTimeout(function () { - console.info('FMS_notifyVisibleForms_0300 delPublishCallBack end'); - console.log(`FMS_notifyVisibleForms_0300 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyVisibleForms_0300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : [], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_0300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyVisibleForms_0400 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_0400`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_0400 start`); - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_0400 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0400")) - - setTimeout(function () { - console.info('FMS_notifyVisibleForms_0400 delPublishCallBack end'); - console.log(`FMS_notifyVisibleForms_0400 end`); - done(); - }, 100) - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyVisibleForms_0400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["-1"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_0400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyVisibleForms_0500 - * @tc.name: formID id is error(formID == 0) - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_0500`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_0500 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_0500 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0500")) - - setTimeout(function () { - console.info('FMS_notifyVisibleForms_0500 delPublishCallBack end'); - console.log(`FMS_notifyVisibleForms_0500 end`); - done(); - }, 100); - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyVisibleForms_0500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["0"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_0500 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyVisibleForms_0600 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_0600`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_0600 start`); - let formId; - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_0600 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0600")); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyVisibleForms_0600", done)); - } - async function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_0600 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_notifyVisibleForms_0600")) - formId = data.data; - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : [formId], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyVisibleForms_0700 - * @tc.name: Form ID error (FormID does not exist) - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_0700`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_0700 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_0700 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0700")); - - setTimeout(function () { - console.info('FMS_notifyVisibleForms_0700 onStateCallBack end'); - console.log(`FMS_notifyVisibleForms_0700 end`); - done(); - }, 100); - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyVisibleForms_0700 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["123456789"], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_0700 featureAbility.startAbility again end`); - }); - /** - * @tc.number: FMS_notifyVisibleForms_1000 - * @tc.name: The form provider is the system application and config When form visiblenotify is true, - * the form provider can be notified that the form is visible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_1000`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1000 start`); - let formIdInvisible; - let formIdVisible; - let onSupplyCount = 0; - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyVisibleForms_1000 onSupplyCallBack====>" + JSON.stringify(data)); - onSupplyCount++; - if (onSupplyCount == 2) { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1000")); - } - if (formIdInvisible && formIdVisible) { - let commonEventPublishData = { - data: formIdInvisible - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyVisibleForms_1000", done)); - } - } - } - - function onVisibleCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1000 onVisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - formIdVisible = data.parameters.formId; - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1000")); - if (formIdInvisible && formIdVisible && onSupplyCount == 2) { - let commonEventPublishData = { - data: formIdInvisible - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyVisibleForms_1000", done)); - } - } - async function OnInvisibleCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1000 OnInvisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1000")) - formIdInvisible = data.parameters.formId; - - subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); - commonEvent.subscribe(subscriberOnState, onVisibleCallBack); - console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : [formIdInvisible], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbility again end`); - } - - commonEvent.subscribe(subscriberOnState, OnInvisibleCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "invisible", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyVisibleForms_1100 - * @tc.name: Use 0 and created form card Id notify the form to be visible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_1100`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1100 start`); - let assertFormId; - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1100")); - console.debug("====>FMS_notifyVisibleForms_1100 onSupplyCallBack====>" + JSON.stringify(data)); - let formId = Object.keys(JSON.parse(data.parameters.parameters))[0]; - const visibilityStatus = JSON.parse(data.parameters.parameters)[formId]; - expect(formId).assertEqual(assertFormId); - expect(visibilityStatus).assertEqual(1); - - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyVisibleForms_1000", done)); - } - } - - function onVisibleCallBack(_, data) { - if (data.parameters.kind != "visible") { - return; - } - console.info("!!!====>FMS_notifyVisibleForms_1100 onVisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - assertFormId = data.parameters.formId; - - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1100")); - } - - commonEvent.subscribe(subscriberOnState, onVisibleCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.log(`FMS_notifyVisibleForms_1100 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["self", "0"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1100 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_notifyVisibleForms_1200 - * @tc.name: When the form provider is not a system application, notify the form to be visible - * and do not pull up the form provider. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_1200`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1200 start`); - - function onVisibleCallBack(_, data) { - if (data.parameters.kind != "visible") { - return; - } - console.info("!!!====>FMS_notifyVisibleForms_1200 onVisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - - setTimeout(function () { - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1200")); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1200")); - - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyVisibleForms_1200", done)); - }, 2000); - } - function onSupplyEventCallBack(_, data) { - if (data.parameters.kind != "onVisibilityChange") { - return; - } - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1200")); - console.debug("====>FMS_notifyVisibleForms_1200 onSupplyEventCallBack====>" + JSON.stringify(data)); - console.log(`FMS_notifyVisibleForms_1200 error`); - expect().assertFail(); - } - - commonEvent.subscribe(subscriberOnState, onVisibleCallBack); - commonEvent.subscribe(subscriberSupply, onSupplyEventCallBack); - console.log(`FMS_notifyVisibleForms_1200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicenotsysapp.hmservice", - "ability" : "com.form.formsystemtestservicenotsysapp.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1200 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_notifyVisibleForms_1300 - * @tc.name: Provider onVisibleChange can not be called when formVisibleNotify is false. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the onVisibleChange interface. - */ - it(`FMS_notifyVisibleForms_1300`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1300 start`); - - function OnVisibleCallBack(_, data) { - if (data.parameters.kind != "visible") { - return; - } - console.info("!!!====>FMS_notifyVisibleForms_1300 OnVisibleCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1300")); - - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyVisibleForms_1300", done)); - } - - commonEvent.subscribe(subscriberOnState, OnVisibleCallBack); - console.log(`FMS_notifyVisibleForms_1300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviced.hmservice", - "ability" : "com.form.formsystemtestserviced.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : ["self"], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_notifyVisibleForms_1400 - * @tc.name: formVisibleNotify in config.json is true, - * it can notify the form provider that the form is not visible. - * @tc.desc: 1. The card is created successfully. - * 2. The visibility interface is successfully invoked. - * The visibility notification of form provider A is triggered, - * and the formId is the same as that of the created formId. - */ - it(`FMS_notifyVisibleForms_1400`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1400 start`); - let supplyFlag = false; - let formId1; - let formId2; - let delCount = 0; - let onSupplyCount = 0; - - function delPublishCallBack() { - console.info("!!!====>FMS_notifyVisibleForms_1400 delPublishCallBack====>"); - delCount++; - if (delCount == 2) { - setTimeout(function () { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1400")); - if (supplyFlag) { - expect().assertFail(); - } - console.info('FMS_notifyVisibleForms_1400 delPublishCallBack end'); - console.info('FMS_notifyVisibleForms_1400 end'); - done(); - }, 1000); - } - } - function onAcquiredCallBack_Normal1(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1400 onAcquiredCallBack_Normal1 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal1) - formId1 = data.data; - - FMS_notifyVisibleForms_1400_normal2(); - } - function unSubscribeOnAcquiredCallBack_Normal1() { - console.debug("====>FMS_notifyVisibleForms_1400 unSubscribeOnAcquiredCallBack_Normal2====>"); - } - async function FMS_notifyVisibleForms_1400_normal1() { - console.log(`FMS_notifyVisibleForms_1400_normal1 start`); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal1); - console.log(`FMS_notifyVisibleForms_1400_normal1 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1400_normal1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1400_normal1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.log(`FMS_notifyVisibleForms_1400_normal1 featureAbility.startAbility end`); - console.log(`FMS_notifyVisibleForms_1400_normal1 end`); - } - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1400 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1400")) - console.info("!!!====>FMS_notifyVisibleForms_1400 onStateCallBack formId1:====>" + formId1); - console.info("!!!====>FMS_notifyVisibleForms_1400 onStateCallBack formId2:====>" + formId2); - console.info("!!!====>FMS_notifyVisibleForms_1400 onStateCallBack onSupplyCount:====>" + onSupplyCount); - if (formId1 && formId2 && onSupplyCount == 1) { - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); - let commonEventPublishData2 = { - data: formId2 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack); - } - } - - async function onAcquiredCallBack_Normal2(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1400 onAcquiredCallBack_Normal2 data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal2); - formId2 = data.data; - - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - - console.log(`FMS_notifyVisibleForms_1400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : [formId1,formId2], - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1400 featureAbility.startAbility end`); - } - function unSubscribeOnAcquiredCallBack_Normal2() { - console.debug("====>FMS_notifyVisibleForms_1400 unSubscribeOnAcquiredCallBack_Normal2====>"); - } - async function FMS_notifyVisibleForms_1400_normal2() { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal2); - console.log(`FMS_notifyVisibleForms_1400_normal2 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviced.hmservice", - "ability" : "com.form.formsystemtestserviced.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1400_normal2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1400_normal2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - - console.log(`FMS_notifyVisibleForms_1400_normal2 featureAbility.startAbility end`); - } - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyVisibleForms_1400 onSupplyCallBack====>" + JSON.stringify(data)); - let parameters = JSON.parse(data.parameters.parameters); - if(parameters[formId1]) { - expect(parameters[formId1]).assertEqual(1); - } - if(parameters[formId2]) { - expect(parameters[formId2]).assertEqual(1); - } - - onSupplyCount++; - if (onSupplyCount == 2) { - supplyFlag = true; - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1400")); - } - - if (formId1 && formId2) { - let commonEventPublishData = { - data: formId1 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); - let commonEventPublishData2 = { - data: formId2 - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack); - } - } - } - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - FMS_notifyVisibleForms_1400_normal1(); - }); - /** - * @tc.number: FMS_notifyVisibleForms_1500 - * @tc.name: Created provider A and B form card, notify the form to be visible 3times. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_1500`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1500 start`); - let formIds = new Array(); - let count = 0; - - function delPublishCallBack1(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1500 delPublishCallBack1====>" + JSON.stringify(data)); - setTimeout(function () { - console.info('FMS_notifyVisibleForms_1500 delPublishCallBack1 end'); - console.log(`FMS_notifyVisibleForms_1500 end`); - }, 1000); - } - function delPublishCallBack2(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1500 delPublishCallBack2====>" + JSON.stringify(data)); - setTimeout(function () { - console.info('FMS_notifyVisibleForms_1500 delPublishCallBack2 end'); - console.log(`FMS_notifyVisibleForms_1500 end`); - done(); - }, 1000); - } - - function onInVisibleSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyVisibleForms_1500 onInVisibleSupplyCallBack====>" + JSON.stringify(data)); - - let retFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; - const visibilityStatus = JSON.parse(data.parameters.parameters)[retFormId]; - expect(formIds.includes(retFormId)).assertTrue(); - expect(visibilityStatus).assertEqual(2); - - ++count; - if (count == 12) { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); - let commonEventPublishData1 = { - data: formIds[0] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData1, delPublishCallBack1); - let commonEventPublishData2 = { - data: formIds[1] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack2); - } - } - } - - async function onVisibleSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyVisibleForms_1500 onVisibleSupplyCallBack====>" + JSON.stringify(data)); - - let retFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; - const visibilityStatus = JSON.parse(data.parameters.parameters)[retFormId]; - expect(formIds.includes(retFormId)).assertTrue(); - expect(visibilityStatus).assertEqual(1); - - ++count; - if (count == 6) { - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); - subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); - commonEvent.subscribe(subscriberSupply, onInVisibleSupplyCallBack); - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyInvisible start`); - for (var i = 0; i < 3; i++) { - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "stateForm": "invisible", - "stateIds": formIds, - "isCreate": false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - } - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyInvisible end`); - } - } - } - - async function onAcquiredCallBack2(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); - console.debug("====>FMS_notifyVisibleForms_1500 onAcquiredCallBack2====>" + JSON.stringify(data)); - formIds.push(data.data); - console.debug("====>FMS_notifyVisibleForms_1500 formIds====>" + formIds); - - commonEvent.subscribe(subscriberSupply, onVisibleSupplyCallBack); - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyVisible start`); - for (var i = 0; i < 3; i++) { - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "stateForm": "visible", - "stateIds": formIds, - "isCreate": false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - } - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyVisible end`); - } - - async function onAcquiredCallBack1(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); - console.debug("====>FMS_notifyVisibleForms_1500 onAcquiredCallBack1====>" + JSON.stringify(data)); - formIds.push(data.data); - console.debug("====>FMS_notifyVisibleForms_1500 formIds====>" + JSON.stringify(formIds)); - - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack2); - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility serviceb start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviceb.hmservice", - "ability" : "com.form.formsystemtestserviceb.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility serviceb end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack1); - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility servicea end`); - }); - - /** - * @tc.number: FMS_notifyVisibleForms_1600 - * @tc.name: Use -1 and created form card Id notify the form to be visible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_1600`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1600 start`); - let formIds = new Array(); - let count = 0; - - function delPublishCallBack1(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1600 delPublishCallBack1====>" + JSON.stringify(data)); - setTimeout(function () { - console.info('FMS_notifyVisibleForms_1600 delPublishCallBack1 end'); - console.log(`FMS_notifyVisibleForms_1600 end`); - }, 1000); - } - function delPublishCallBack2(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1600 delPublishCallBack2====>" + JSON.stringify(data)); - setTimeout(function () { - console.info('FMS_notifyVisibleForms_1600 delPublishCallBack2 end'); - console.log(`FMS_notifyVisibleForms_1600 end`); - done(); - }, 1000); - } - - function onSupplyCallBack(_, data) { - if (data.parameters.kind == "onVisibilityChange") { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - console.debug("====>FMS_notifyVisibleForms_1600 onSupplyCallBack====>" + JSON.stringify(data)); - - let retFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; - const visibilityStatus = JSON.parse(data.parameters.parameters)[retFormId]; - expect(formIds.includes(retFormId)).assertTrue(); - expect(visibilityStatus).assertEqual(1); - - ++count; - if (count == 2) { - console.debug("====>FMS_notifyVisibleForms_1600 OK====>"); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); - - let commonEventPublishData1 = { - data: formIds[0] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData1, delPublishCallBack1); - let commonEventPublishData2 = { - data: formIds[1] - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack2); - } - } - } - - async function onSecondAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_notifyVisibleForms_1500")); - console.debug("====>FMS_notifyVisibleForms_1600 onSecondAcquiredCallBack====>" + JSON.stringify(data)); - formIds.push(data.data); - formIds.push("-1"); - console.debug("====>FMS_notifyVisibleForms_1600 formIds====>" + formIds); - - commonEvent.subscribe(subscriberSupply, onSupplyCallBack); - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility notifyVisible start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "name", - "bundle" : "bundle", - "ability" : "ability", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : formIds, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility notifyVisible end`); - } - - async function onFirstAcquiredCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_notifyVisibleForms_1500")); - console.debug("====>FMS_notifyVisibleForms_1600 onFirstAcquiredCallBack====>" + JSON.stringify(data)); - formIds.push(data.data); - - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - commonEvent.subscribe(subscriberOnAcquired, onSecondAcquiredCallBack); - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility serviceb start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestserviceb.hmservice", - "ability" : "com.form.formsystemtestserviceb.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility serviceb end`); - } - - commonEvent.subscribe(subscriberOnAcquired, onFirstAcquiredCallBack); - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility servicea end`); - }); - - /** - * @tc.number: FMS_notifyVisibleForms_1700 - * @tc.name: Use -1 and created form card Id notify the form to be visible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_1700`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1700 start`); - - function onFormVisibleCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1700")); - console.debug("====>FMS_notifyVisibleForms_1700 onFirstAcquiredCallBack====>" + JSON.stringify(data)); - expect(data.parameters.kind).assertEqual("visible"); - expect(data.data).assertEqual("0"); - - setTimeout(function () { - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback("FMS_notifyVisibleForms_1700", done)); - }, 2000); - } - - function onFormSupplyCallBack(_, data) { - expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1700")); - console.debug("====>FMS_notifyVisibleForms_1700 onFormSupplyCallBack====>" + JSON.stringify(data)); - if (data.parameters.kind == "onVisibilityChange") { - console.debug("====>FMS_notifyVisibleForms_1700 error"); - expect().assertFail(); - } - } - - commonEvent.subscribe(subscriberOnState, onFormVisibleCallBack); - commonEvent.subscribe(subscriberSupply, onFormSupplyCallBack); - console.log(`FMS_notifyVisibleForms_1700 featureAbility.startAbility servicea start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true, - "isStartOtherApp" : true, - "otherAppState" : "visible" - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1700 featureAbility.startAbility servicea end`); - }); - - /** - * @tc.number: FMS_notifyVisibleForms_1800 - * @tc.name: When formVisibleNotify is true in config.json, - * the form provider will be pulled when the card is visible. - * @tc.desc: 1.The form user calls the visible notification interface. - * 2.Verify the result of the visible notification interface. - */ - it(`FMS_notifyVisibleForms_1800`, 0, async (done) => { - console.info(`FMS_notifyVisibleForms_1800 start`); - let hostFormId; - let providerFormId; - let counter = 0; - - const delPublishCallback = (_, data) => { - console.info("!!!====>FMS_notifyVisibleForms_1800 delPublishCallback====>"); - setTimeout(() => { - expect(hostFormId).assertEqual(providerFormId); - console.info('FMS_notifyVisibleForms_1800 delPublishCallback end'); - console.info(`FMS_notifyVisibleForms_1800 end`); - done(); - }, 1000); - } - - const onSupplyCallback = (_, data) => { - if (data.parameters.kind != "onVisibilityChange") { - return; - } - console.debug("====>FMS_notifyVisibleForms_1800 onSupplyCallback data:====>" + JSON.stringify(data)); - providerFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; - const visibilityStatus = JSON.parse(data.parameters.parameters)[providerFormId]; - - expect(visibilityStatus).assertEqual(1); - commonEvent.unsubscribe(subscriberSupply, () => { - console.info("====>FMS_notifyVisibleForms_1800 unSubscribeSupplyCallback====>"); - }); - if (++counter == 2) { - const commonEventPublishData = { - data: providerFormId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - } - } - - const onVisibleCallback = (_, data) => { - if (data.parameters.kind != "visible") { - return; - } - console.debug("====>FMS_notifyVisibleForms_1800 onVisibleCallback data:====>" + JSON.stringify(data)); - hostFormId = data.parameters.formId; - - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnState, () => { - console.info("====>FMS_notifyVisibleForms_1800 unSubscribeOnVisibleCallback====>"); - }); - if (++counter == 2) { - const commonEventPublishData = { - data: hostFormId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - } - } - - commonEvent.subscribe(subscriberOnState, onVisibleCallback); - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - console.info(`FMS_notifyVisibleForms_1800 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicef.hmservice", - "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", - "moduleName": "entry", - "temporary": false, - "stateForm": "visible", - "stateIds": ["self"], - "isCreate": true - } - } - }).then((res: any) => { - console.debug(`FMS_notifyVisibleForms_1800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.debug(`FMS_notifyVisibleForms_1800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - }); - /** - * @tc.number: FMS_notifyVisibleForms_1900 - * @tc.name: The size of visible form ids in the notification form array exceeds 32. - * @tc.desc: 1. Failed to invoke the visibility interface (parameter error). - */ - it(`FMS_notifyVisibleForms_1900`, 0, async (done) => { - console.log(`FMS_notifyVisibleForms_1900 start`); - - function onStateCallBack(_, data) { - console.info("!!!====>FMS_notifyVisibleForms_1900 onStateCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1900")) - - setTimeout(function () { - console.info('FMS_notifyVisibleForms_1900 delPublishCallBack end'); - console.log(`FMS_notifyVisibleForms_1900 end`); - done(); - }, 100); - } - - commonEvent.subscribe(subscriberOnState, onStateCallBack); - console.log(`FMS_notifyVisibleForms_1900 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostg", - abilityName: "com.ohos.st.formsystemhostg.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName" : "entry", - "temporary" : false, - "stateForm" : "visible", - "stateIds" : [ - "1","2","3","4","5","6","7","8","9","10","11","12","13","14", - "15","16","17","18","19","20","21","22","23","24","25","26", - "27","28","29","30","31","32","33" - ], - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_notifyVisibleForms_1900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_notifyVisibleForms_1900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_notifyVisibleForms_1900 featureAbility.startAbility end`); - }); - }); -} - -const sleep = async delay => { - return new Promise((resolve, _) => { - setTimeout(async () => { - resolve(0); - }, delay); - }); -}; - -const delPublishCallback = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000); -} - -const unsubscribeOnStateCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); -} - -const unsubscribeSupplyCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); -} - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index b460da51f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsFormStateNotifyVisible.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 708abba6f..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formvisiblestatetest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/Test.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/Test.json deleted file mode 100644 index cbe0fc6b0..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/Test.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "360000", - "package": "com.ohos.st.formstresstest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsFormStressTest.hap", - "FormSystemHostK.hap", - "FormSupplyAppF.hap", - "FormSupplyAppG.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json deleted file mode 100644 index 60041de48..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.st.formstresstest", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.st.formstresstest", - "name": ".FormStressSTApp", - "mainAbility": ".MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnDeleted_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnAcquired_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnError_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormCast_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormSupply_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormOnRequest_commonEvent" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "FMS_FormDelete_commonEvent" - } - ], - "reqPermissions": [ - { - "name": "FMS_FormOnAcquired_commonEvent", - "reason": "need use onAcquired commonEvent" - }, - { - "name": "FMS_FormOnDeleted_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "FMS_FormOnError_commonEvent", - "reason": "need use OnError commonEvent" - }, - { - "name": "FMS_FormCast_commonEvent", - "reason": "need use castFrom commonEvent" - }, - { - "name": "FMS_FormSupply_commonEvent", - "reason": "need use FormSupply commonEvent" - }, - { - "name": "FMS_FormOnReleased_commonEvent" - }, - { - "name": "FMS_FormOnRequest_commonEvent" - }, - { - "name": "FMS_FormDelete_commonEvent", - "reason": "need use delete commonEvent" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name": "ohos.permission.CLEAN_APPLICATION_DATA" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 83dd3d4f8..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('[FormComponent] Application onCreate') - }, - onDestroy() { - console.info('[FormComponent] Application onDestroy') - }, -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 41b66c213..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-nocheck -import featureAbility from "@ohos.ability.featureAbility"; -import file from '@system.file'; -import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; -import testsuite from "../test/List.test.ets"; - -@Entry -@Component -struct Index { - - aboutToAppear() { - - console.info("[FormComponent] start run testcase!!!!"); - - featureAbility.getWant() - .then((want: any) => { - console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); - const core = Core.getInstance(); - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }); - core.addService('expect', expectExtend); - const reportExtend = new ReportExtend(file); - core.addService('report', reportExtend); - core.init(); - core.subscribeEvent('task', reportExtend); - const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 10000; - console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); - configService.setConfig(want.parameters); - testsuite(); - core.execute(); - }) - .catch((error: any) => { - console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Fms Stress Test') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets deleted file mode 100644 index 69cd613b9..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets +++ /dev/null @@ -1,670 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the `License`); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an `AS IS` BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from '@ohos.ability.featureAbility'; -import formHost from '@ohos.application.formHost'; -import commonEvent from '@ohos.commonEvent'; -import { beforeEach, describe, expect, it } from 'deccjsunit/index'; - -const onDeletedEvent = { - events: [`FMS_FormOnDeleted_commonEvent`] -} -const onAcquiredEvent = { - events: [`FMS_FormOnAcquired_commonEvent`] -}; -const onSupplyEvent = { - events: [`FMS_FormSupply_commonEvent`] -}; -const formOnDeleteEvent = `FMS_FormDelete_commonEvent`; - -const unsubscribeOnDeletedCallback = (tcNumber, done) => { - console.info(`${tcNumber} unsubscribeOnDeleted Callback`); - done(); -} -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.info(`${tcNumber} unsubscribeOnAcquired Callback`); -} -const unsubscribeOnSupplyCallback = (tcNumber) => { - console.info(`${tcNumber} unsubscribeOnSupply Callback`); -} -const publishOnDeleteCallback = (tcNumber) => { - console.info(`${tcNumber} publishOnDelete Callback`); -} - -let onDeletedEventSubscriber; -let onAcquiredEventSubscriber; -let onSupplyEventSubscriber; - -export default function test() { - describe(`FmsStressTest`, () => { - - beforeEach(async () => { - onDeletedEventSubscriber = await commonEvent.createSubscriber(onDeletedEvent); - onAcquiredEventSubscriber = await commonEvent.createSubscriber(onAcquiredEvent); - onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent); - }); - - const subscribeDeletedEvent = (tcNumber, expectedDeletedFormAmount, done) => { - commonEvent.subscribe(onDeletedEventSubscriber, async (err, data) => { - const formIds = data.parameters.formIds; - const deletedFormAmount = data.parameters.deletedFormAmount; - console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onDeletedCallback formIds: ${formIds}`); - - expect(expectedDeletedFormAmount).assertEqual(deletedFormAmount); - expect(err.code).assertEqual(0); - console.info(`${tcNumber} onDeletedCallback end`); - commonEvent.unsubscribe(onDeletedEventSubscriber, () => unsubscribeOnDeletedCallback(tcNumber, done)); - }); - } - - /** - * @tc.number: FMS_stressTest_0100 - * @tc.name: Create form test. - * @tc.desc: OnCreate form interface working well. - */ - it(`FMS_stressTest_0100`, 0, async (done) => { - const tcNumber = `FMS_stressTest_0100`; - - subscribeDeletedEvent(tcNumber, 1, done); - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - const formId = data.data; - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); - - expect(err.code).assertEqual(0); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(formId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onAcquiredCallback end`); - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestservicef.hmservice`, - ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_stressTest_0200 - * @tc.name: Host release form test. - * @tc.desc: releaseForm method working well. - */ - it(`FMS_stressTest_0200`, 0, async (done) => { - const tcNumber = `FMS_stressTest_0200`; - - subscribeDeletedEvent(tcNumber, 1, done); - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - const kind = data.parameters.kind; - const formId = data.parameters.formId; - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); - - expect(err.code).assertEqual(0); - if (`release` == kind) { - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestservicef.hmservice`, - ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, - moduleName: `entry`, - isCreate: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - } else { - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(formId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onAcquiredCallback end`); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestservicef.hmservice`, - ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, - moduleName: `entry`, - releaseForm: true, - isCreate: true, - temporary: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_stressTest_0300 - * @tc.name: Host cast temp form test. - * @tc.desc: castTempForm method working well. - */ - it(`FMS_stressTest_0300`, 0, async (done) => { - const tcNumber = `FMS_stressTest_0300`; - - subscribeDeletedEvent(tcNumber, 1, done); - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - const kind = data.parameters.kind; - const formId = data.parameters.formId; - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); - - expect(err.code).assertEqual(0); - if (`castTempForm` == kind) { - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: formId, - name: `Form_Js001`, - bundle: `com.form.formsystemtestservicef.hmservice`, - ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, - moduleName: `entry` - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(formId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onAcquiredCallback end`); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestservicef.hmservice`, - ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, - moduleName: `entry`, - castTempForm: true, - isCreate: true, - temporary: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_stressTest_0500 - * @tc.name: Provider set form next refresh time test. - * @tc.desc: setFormNextRefreshTime method working well. - */ - it(`FMS_stressTest_0500`, 0, async (done) => { - const tcNumber = `FMS_stressTest_0500`; - - subscribeDeletedEvent(tcNumber, 1, done); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : `onVisibilityChange` == kind - ? Object.keys(JSON.parse(data.parameters.parameters))[0] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onSetFormNextRefreshTime` == kind) { - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(supplyFormId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onSupplyCallback end`); - } - }); - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - const kind = data.parameters.kind; - const formId = data.parameters.formId; - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); - - if (`notifyVisibleForms` == kind) { - expect(err.code).assertEqual(0); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback end`); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - notifyVisibleForms: true, - isCreate: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_stressTest_0700 - * @tc.name: Host request form test. - * @tc.desc: requestForm method working well. - */ - it(`FMS_stressTest_0700`, 0, async (done) => { - const tcNumber = `FMS_stressTest_0700`; - - subscribeDeletedEvent(tcNumber, 1, done); - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - const kind = data.parameters.kind; - const formId = data.parameters.formId; - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); - - if (`request` == kind) { - expect(err.code).assertEqual(0); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(formId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onAcquiredCallback end`); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestservicef.hmservice`, - ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, - moduleName: `entry`, - requestForm: true, - isCreate: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_stressTest_0900 - * @tc.name: Provider update form test. - * @tc.desc: updateForm method working well. - */ - it(`FMS_stressTest_0900`, 0, async (done) => { - const tcNumber = `FMS_stressTest_0900`; - - subscribeDeletedEvent(tcNumber, 1, done); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : `onVisibilityChange` == kind - ? Object.keys(JSON.parse(data.parameters.parameters))[0] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onUpdateForm` == kind) { - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(supplyFormId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onSupplyCallback end`); - } - }); - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - const kind = data.parameters.kind; - const formId = data.parameters.formId; - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); - - if (`notifyVisibleForms` == kind) { - expect(err.code).assertEqual(0); - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback end`); - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - notifyVisibleForms: true, - isCreate: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_stressTest_1100 - * @tc.name: Host notify form's visibility test. - * @tc.desc: notifyVisibleForms and notifyInvisibleForms method working well. - */ - it(`FMS_stressTest_1100`, 0, async (done) => { - const tcNumber = `FMS_stressTest_1100`; - let hostCounter = 0; - let providerCounter = 0; - - subscribeDeletedEvent(tcNumber, 1, done); - - commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { - console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - const kind = data.parameters.kind; - const supplyFormId = `onCreate` == kind - ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] - : `onVisibilityChange` == kind - ? Object.keys(JSON.parse(data.parameters.parameters))[0] - : data.parameters.parameters; - console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); - - if (`onVisibilityChange` == kind) { - if (++providerCounter == 2) { - commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(supplyFormId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onSupplyCallback end`); - } - } - }); - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - const kind = data.parameters.kind; - const formId = data.parameters.formId; - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); - - if (`notifyVisibleForms` == kind) { - expect(err.code).assertEqual(0); - if (++hostCounter == 2) { - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback end`); - } - } else if (`notifyInvisibleForms` == kind) { - expect(err.code).assertEqual(0); - if (++hostCounter == 2) { - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - console.info(`${tcNumber} onAcquiredCallback end`); - } - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestserviceg.hmservice`, - ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, - moduleName: `entry`, - notifyVisibility: true, - isCreate: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_stressTest_1300 - * @tc.name: Forms update test. - * @tc.desc: enableFormsUpdate and disableFormsUpdate method working well. - */ - it(`FMS_stressTest_1300`, 0, async (done) => { - const tcNumber = `FMS_stressTest_1300`; - let hostCounter = 0; - - subscribeDeletedEvent(tcNumber, 1, done); - - commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { - const kind = data.parameters.kind; - const formId = data.parameters.formId; - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); - console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); - - if (`enableUpdate` == kind) { - expect(err.code).assertEqual(0); - if (++hostCounter == 2) { - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(formId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onAcquiredCallback end`); - } - } else if (`disableUpdate` == kind) { - expect(err.code).assertEqual(0); - if (++hostCounter == 2) { - commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); - setTimeout(() => { - commonEvent.publish(formOnDeleteEvent, { - parameters: { - formIds: [].concat(formId) - } - }, () => publishOnDeleteCallback(tcNumber)); - }, 500); - console.info(`${tcNumber} onAcquiredCallback end`); - } - } - }); - - try { - const res = await featureAbility.startAbility({ - want: { - bundleName: `com.ohos.st.formsystemhostk`, - abilityName: `com.ohos.st.formsystemhostk.MainAbility`, - parameters: { - formId: `0`, - name: `Form_Js001`, - bundle: `com.form.formsystemtestservicef.hmservice`, - ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, - moduleName: `entry`, - update: true, - isCreate: true - } - } - }); - console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); - } catch (error) { - console.info(`${tcNumber} error: ${JSON.stringify(error)}`); - console.info(`${tcNumber} should not reach here`); - expect().assertFail(); - } - }); - - /** - * @tc.number: FMS_stressTest_1700 - * @tc.name: Get forms info test. - * @tc.desc: getAllFormsInfo and getFormsInfo method working well. - */ - it(`FMS_stressTest_1700`, 0, async (done) => { - const tcNumber = `FMS_stressTest_1700`; - - let allFormsInfo = await formHost.getAllFormsInfo(); - const providerBundleNameList = [ - `com.form.formsystemtestservicef.hmservice`, - `com.form.formsystemtestserviceg.hmservice` - ]; - - console.info(`${tcNumber} getAllFormsInfo: ${JSON.stringify(allFormsInfo)}`); - console.info(`${tcNumber} before filter size: ${JSON.stringify(allFormsInfo.length)}`); - allFormsInfo = allFormsInfo.filter((formsInfo) => providerBundleNameList.includes(formsInfo.bundleName)); - console.info(`${tcNumber} after filter size: ${JSON.stringify(allFormsInfo.length)}`); - expect(allFormsInfo.length).assertEqual(3); - - allFormsInfo.forEach(async (formsInfo, index) => { - const providerFormsInfo1 = await formHost.getFormsInfo(formsInfo.bundleName); - const providerFormsInfo2 = await formHost.getFormsInfo(formsInfo.bundleName, formsInfo.moduleName); - - console.info(`${tcNumber} getFormsInfo: ${JSON.stringify(providerFormsInfo1)}`); - console.info(`${tcNumber} getFormsInfo: ${JSON.stringify(providerFormsInfo2)}`); - expect(providerFormsInfo1.bundleName).assertEqual(providerFormsInfo2.bundleName); - - if (index == allFormsInfo.length - 1) { - done(); - } - }); - }); - - /** - * @tc.number: FMS_stressTest_1800 - * @tc.name: Form system ready test. - * @tc.desc: isSystemReady method working well. - */ - it(`FMS_stressTest_1800`, 0, async (done) => { - const tcNumber = `FMS_stressTest_1800`; - - const systemstatus = await formHost.isSystemReady(); - console.info(`${tcNumber} systemstatus: ${JSON.stringify(systemstatus)}`); - expect(systemstatus).assertEqual(0); - done(); - }); - }); -} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/List.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/List.test.ets deleted file mode 100644 index 8d8417a94..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import test from './FmsStress.test.ets'; - -export default function testsuite() { - test(); -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 9346b4a60..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "formsttest" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets b/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets deleted file mode 100644 index cbbf8958b..000000000 --- a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets +++ /dev/null @@ -1,707 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import featureAbility from "@ohos.ability.featureAbility"; -import commonEvent from '@ohos.commonEvent'; -import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; - -var onAcquiredForm_Event = { - events: ["FMS_FormOnAcquired_commonEvent"], -}; -var onDeletedFormEvent = { - events: ["FMS_FormOnDeleted_commonEvent"], -}; -var onUpdateRefreshEvent = { - events: ["FMS_FormUpdateRefresh_commonEvent"], -}; -var onRequestFormEvent = { - events: ["FMS_FormOnRequest_commonEvent"], -}; - -var deleteForm_Event = "FMS_FormDelete_commonEvent"; - - -var subscriberOnAcquired; -var subscriberOnDeleted; -var subscriberOnRefresh; -var subscriberOnRequest; - -export default function test() { - describe(`FmsUpdateRefreshFormTest`, () => { - - beforeAll(async (done) => { - done(); - }) - - beforeEach(async () => { - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); - subscriberOnRefresh = await commonEvent.createSubscriber(onUpdateRefreshEvent); - subscriberOnRequest = await commonEvent.createSubscriber(onRequestFormEvent); - }) - - /** - * @tc.number: FMS_updateForm_0100 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.The form provider A to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_updateForm_0100`, 0, async (done) => { - console.log(`FMS_updateForm_0100 start`); - - function onRefreshCallBack(_, data) { - console.info("!!!====>FMS_updateForm_0100 onRefreshCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0100")); - - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_updateForm_0100", done)); - } - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); - console.log(`FMS_updateForm_0100 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "updateForm" : true, - "updateId" : "-1", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_updateForm_0100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_updateForm_0100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_updateForm_0100 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_updateForm_0200 - * @tc.name: formID id is error(formID == 0) - * @tc.desc: 1.The form provider A to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_updateForm_0200`, 0, async (done) => { - console.log(`FMS_updateForm_0200 start`); - - function onRefreshCallBack(_, data) { - console.info("!!!====>FMS_updateForm_0200 onRefreshCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0200")); - - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_updateForm_0200", done)); - } - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); - console.log(`FMS_updateForm_0200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "updateForm" : true, - "updateId" : "0", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_updateForm_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_updateForm_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_updateForm_0200 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_updateForm_0300 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.The form provider B to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_updateForm_0300`, 0, async (done) => { - console.log(`FMS_updateForm_0300 start`); - let formId; - - function onRefreshCallBack(_, data) { - console.info("!!!====>FMS_updateForm_0300 onRefreshCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0300")); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_updateForm_0300", done)); - } - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_updateForm_0300 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_updateForm_0300")); - formId = data.data; - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); - - console.log(`FMS_updateForm_0300 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "updateForm" : true, - "updateId" : formId, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_updateForm_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_updateForm_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_updateForm_0300 featureAbility.startAbility again end`); - } - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.log(`FMS_updateForm_0300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_updateForm_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_updateForm_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_updateForm_0300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_updateForm_0400 - * @tc.name: Form ID error (FormID does not exist) - * @tc.desc: 1.The form provider A to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_updateForm_0400`, 0, async (done) => { - console.log(`FMS_updateForm_0400 start`); - let formId; - - function onRefreshCallBack(_, data) { - console.info("!!!====>FMS_updateForm_0400 onRefreshCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0400")); - setTimeout(function () { - console.info('FMS_updateForm_0400 onRefreshCallBack end'); - console.log(`FMS_updateForm_0400 end`); - done(); - }, 1000); - } - function onDeletedCallBack(_, data) { - console.info("!!!====>FMS_updateForm_0400 onDeletedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnDeleted_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeDeletedCallback("FMS_updateForm_0400")); - formId = data.parameters.formId; - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); - - console.log(`FMS_updateForm_0400 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "updateForm" : true, - "updateId" : formId, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_updateForm_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_updateForm_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_updateForm_0400 featureAbility.startAbility again end`); - } - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallBack); - console.log(`FMS_updateForm_0400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "deleteForm" : true, - "deleteId" : "self", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_updateForm_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_updateForm_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_updateForm_0400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_updateForm_0500 - * @tc.name: The jsonData of form in the provider is empty. - * @tc.desc: 1.The form provider A to invoke the intiative timed refresh interface. - */ - it(`FMS_updateForm_0500`, 0, async (done) => { - console.log(`FMS_updateForm_0500 start`); - - function onRefreshCallBack(_, data) { - console.info("!!!====>FMS_updateForm_0500 onRefreshCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0500")); - - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_updateForm_0500", done)); - } - commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); - console.log(`FMS_updateForm_0500 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "updateForm" : true, - "updateId" : "self", - "jsonEmpty" : true, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_updateForm_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_updateForm_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_updateForm_0500 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_hostRefresh_0100 - * @tc.name: formID id is error(formID < 0) - * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_hostRefresh_0100`, 0, async (done) => { - console.log(`FMS_hostRefresh_0100 start`); - - function onRequestCallBack(_, data) { - console.info("!!!====>FMS_hostRefresh_0100 onRequestCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0100")); - - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_hostRefresh_0100", done)); - } - commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); - console.log(`FMS_hostRefresh_0100 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "requestForm" : true, - "requestId" : "-1", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_hostRefresh_0100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_hostRefresh_0100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_hostRefresh_0100 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_hostRefresh_0200 - * @tc.name: formID id is error(formID == 0) - * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_hostRefresh_0200`, 0, async (done) => { - console.log(`FMS_hostRefresh_0200 start`); - - function onRequestCallBack(_, data) { - console.info("!!!====>FMS_hostRefresh_0200 onRequestCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0200")); - - let commonEventPublishData = { - data: data.parameters.formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_hostRefresh_0200", done)); - } - commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); - console.log(`FMS_hostRefresh_0200 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "requestForm" : true, - "requestId" : "0", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_hostRefresh_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_hostRefresh_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_hostRefresh_0200 featureAbility.startAbility end`); - }); - - /** - * @tc.number: FMS_hostRefresh_0300 - * @tc.name: formID id is error because formId is not self - * @tc.desc: 1.The form user B to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_hostRefresh_0300`, 0, async (done) => { - console.log(`FMS_hostRefresh_0300 start`); - let formId; - - function onRequestCallBack(_, data) { - console.info("!!!====>FMS_hostRefresh_0300 onRequestCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRefreshCallback("FMS_hostRefresh_0300")); - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_hostRefresh_0300", done)); - } - - function onAcquiredCallBack(_, data) { - console.info("!!!====>FMS_hostRefresh_0300 onAcquiredCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_hostRefresh_0300")); - formId = data.data; - commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); - - console.log(`FMS_hostRefresh_0300 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "requestForm" : true, - "requestId" : formId, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_hostRefresh_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_hostRefresh_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_hostRefresh_0300 featureAbility.startAbility again end`); - } - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); - console.log(`FMS_hostRefresh_0300 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_hostRefresh_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_hostRefresh_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_hostRefresh_0300 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_hostRefresh_0400 - * @tc.name: Form ID error (FormID does not exist) - * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_hostRefresh_0400`, 0, async (done) => { - console.log(`FMS_hostRefresh_0400 start`); - let formId; - - function onRequestCallBack(_, data) { - console.info("!!!====>FMS_hostRefresh_0400 onRequestCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0400")); - setTimeout(function () { - console.info('FMS_hostRefresh_0400 onRequestCallBack end'); - console.log(`FMS_hostRefresh_0400 end`); - done(); - }, 10); - } - function onDeletedCallBack(_, data) { - console.info("!!!====>FMS_hostRefresh_0400 onDeletedCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnDeleted_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeDeletedCallback("FMS_hostRefresh_0400")); - formId = data.parameters.formId; - commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); - - console.log(`FMS_hostRefresh_0400 featureAbility.startAbility again start`); - featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "requestForm" : true, - "requestId" : formId, - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_hostRefresh_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_hostRefresh_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_hostRefresh_0400 featureAbility.startAbility again end`); - } - commonEvent.subscribe(subscriberOnDeleted, onDeletedCallBack); - console.log(`FMS_hostRefresh_0400 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostf", - abilityName: "com.ohos.st.formsystemhostf.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "deleteForm" : true, - "deleteId" : "self", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_hostRefresh_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_hostRefresh_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_hostRefresh_0400 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_hostRefresh_0600 - * @tc.name: The form user has no form permission. - * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. - * 2.Verify the result of the intiative timed refresh interface. - */ - it(`FMS_hostRefresh_0600`, 0, async (done) => { - console.log(`FMS_hostRefresh_0600 start`); - - function onRequestCallBack(_, data) { - console.info("!!!====>FMS_hostRefresh_0600 onRequestCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); - expect(data.data != "0").assertEqual(true); - commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0600")); - - setTimeout(function () { - console.info('FMS_hostRefresh_0600 onRequestCallBack end'); - console.log(`FMS_hostRefresh_0600 end`); - done(); - }, 1000) - } - - commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); - console.log(`FMS_hostRefresh_0600 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostnoperm", - abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "requestForm" : true, - "requestId" : "1", - "isCreate" : false - } - } - }).then((res: any) => { - console.log(`FMS_hostRefresh_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_hostRefresh_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_hostRefresh_0600 featureAbility.startAbility end`); - }); - /** - * @tc.number: FMS_hostRefresh_0700 - * @tc.name: Refresh form successfully by the form user. - * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. - * 2.Verify that pulling up the form provider. - */ - it(`FMS_hostRefresh_0700`, 0, async (done) => { - console.log(`FMS_hostRefresh_0700 start`); - let formId; - - function onRequestCallBack(_, data) { - console.info("!!!====>FMS_hostRefresh_0700 onRequestCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); - expect(data.data).assertEqual("0"); - commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0700")); - formId = data.parameters.formId; - let commonEventPublishData = { - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack("FMS_hostRefresh_0700", done)); - } - - commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); - - console.log(`FMS_hostRefresh_0700 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhoste", - abilityName: "com.ohos.st.formsystemhoste.MainAbility", - parameters: { - "formId" : "0", - "name" : "Form_Js001", - "bundle" : "com.form.formsystemtestservicea.hmservice", - "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", - "moduleName" : "entry", - "temporary" : false, - "requestForm" : true, - "requestId" : "self", - "isCreate" : true - } - } - }).then((res: any) => { - console.log(`FMS_hostRefresh_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.log(`FMS_hostRefresh_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.log(`FMS_hostRefresh_0700 featureAbility.startAbility end`); - }); - }); -} - -const delPublishCallBack = async (tcNumber, done) => { - console.info(`${tcNumber} delPublishCallBack start`); - setTimeout(function () { - console.info(`${tcNumber} delPublishCallBack end`); - done(); - }, 1000) -} - -const unsubscribeOnRequestCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnRequestCallback CallBack====>`); -} - -const unsubscribeOnRefreshCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnRefreshCallback CallBack====>`); -} - -const unsubscribeDeletedCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeDeletedCallback====>`); -} - -const unsubscribeOnAcquiredCallback = (tcNumber) => { - console.debug(`====>${tcNumber} unsubscribeOnAcquiredCallback CallBack====>`); -} diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/app.json b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/app.json deleted file mode 100755 index 401aac005..000000000 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.acts.killprocesswithaccountpackage", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/Test.json b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 8a70e879c..000000000 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbilityT onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbilityT onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbilityT onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbilityT onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbilityT onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbilityT onBackground") - } -}; diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json deleted file mode 100755 index fb28a8715..000000000 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "com.acts.killprocesswithaccountpackage", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.killprocesswithaccountpackage.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/app.js deleted file mode 100755 index 875191631..000000000 --- a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/element/string.json deleted file mode 100755 index d405647b9..000000000 --- a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts b/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts deleted file mode 100755 index 1cd97264e..000000000 --- a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -export default class SecondAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_NewWant SecondAbility onCreate") - globalThis.abilityWant = want; - commonEvent.publish("onCreateSecond_To_Test_CommonEvent", () => { - console.log("ACTS_NewWant Publish CallBack onCreateSecond_To_Test_CommonEvent") - }); - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_NewWant SecondAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_NewWant SecondAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - - commonEvent.publish("onWindowStageCreateSecond_To_Test_CommonEvent", () => { - console.log("ACTS_NewWant Publish CallBack onWindowStageCreateSecond_To_Test_CommonEvent") - }); - } - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_NewWant SecondAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - var connId; - console.log("ACTS_NewWant SecondAbility onForeground") - if (globalThis.abilityWant.action == 'startSingleton0400') - { - globalThis.abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.MainAbility", - action:"startStandard0400" - }, (error, data) => { - console.log('ACTS_NewWant SecondAbility onForeground - startAbility start standard: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - } - if (globalThis.abilityWant.action == 'startSingleton0300') - { - globalThis.abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.MainAbility", - action:"restartSingleton" - }, (error, data) => { - console.log('ACTS_NewWant SecondAbility onForeground - startAbility restart standard: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - } - if (globalThis.abilityWant.action == 'startHapA0500') { - globalThis.abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapb.MainAbility", - action: "restartHapB" - }, (error, data) => { - console.log('ACTS_NewWant SecondAbility onForeground - startAbility restart HapB: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - } - if (globalThis.abilityWant.action == 'startHapA0600') { - globalThis.abilityContext.startAbility({ - bundleName: "com.example.newwanthapa", - abilityName: "com.example.newwanthapc.MainAbility", - action: "restartHapC" - }, (error, data) => { - console.log('ACTS_NewWant SecondAbility onForeground - startAbility restart HapC: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - } - if (globalThis.abilityWant.action == 'startSecondAbility0700') { - globalThis.abilityContext.startAbility( - { - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.MainAbility", - action: "startMainAbility0700" - }, (error, data) => { - console.log('ACTS_NewWant SecondAbility onForeground - startAbility startMainAbility0700: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }); - } - if (globalThis.abilityWant.action == 'startSecondAbility0800') { - globalThis.abilityContext.startAbility( - { - bundleName: "com.example.newwanthapapi7", - abilityName: "com.example.newwanthapapi7.MainAbility", - action: "startapi70800" - }, (error, data) => { - console.log('ACTS_NewWant SecondAbility onForeground - startAbility startapi70800: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }); - } - commonEvent.publish("onForegroundSecond_To_Test_CommonEvent", () => { - console.log("ACTS_NewWant SecondAbility Publish CallBack onForegroundSecond_To_Test_CommonEvent") - }); - } - - onBackground() { - // Ability has back to background - console.log("ACTS_NewWant SecondAbility onBackground") - } - - onNewWant(want) { - // Ability has brought to foreground when it already in foreground - console.log("ACTS_NewWant SecondAbility onNewWant") - globalThis.abilityWant = want; - console.log("ACTS_NewWant SecondAbility onNewWant deviceId :" + want.deviceId) - console.log("ACTS_NewWant SecondAbility onNewWant bundleName :" + want.bundleName) - console.log("ACTS_NewWant SecondAbility onNewWant abilityName :" + want.abilityName) - console.log("ACTS_NewWant SecondAbility onNewWant uri :" + want.uri) - console.log("ACTS_NewWant SecondAbility onNewWant type :" + want.type) - console.log("ACTS_NewWant SecondAbility onNewWant flags :" + want.flags) - console.log("ACTS_NewWant SecondAbility onNewWant action :" + want.action) - var publishData = { - data: want.action - } - commonEvent.publish("onNewWantSecond_To_Test_CommonEvent", publishData,() => { - console.log("ACTS_NewWant SecondAbility Publish CallBack onNewWantSecond_To_Test_CommonEvent") - }); - } -}; diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index f94961847..000000000 --- a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets b/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100755 index fb3f76a5e..000000000 --- a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,653 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' -import missionManager from '@ohos.application.missionManager' -import appManager from '@ohos.application.appManager' - -const MAX_MISSION_NUM = 1024; -var subscriberInfo = { - events: ['onCreateMain_To_Test_CommonEvent', - 'onWindowStageCreateMain_To_Test_CommonEvent', - 'onForegroundMain_To_Test_CommonEvent', - 'onNewWantMain_To_Test_CommonEvent', - 'onCreateSecond_To_Test_CommonEvent', - 'onWindowStageCreateSecond_To_Test_CommonEvent', - 'onForegroundSecond_To_Test_CommonEvent', - 'onNewWantSecond_To_Test_CommonEvent', - ], -}; - -function getMissionId() { - return new Promise(async (resolve, reject) => { - var missionId = -1; - var missionInfos = await missionManager.getMissionInfos('', MAX_MISSION_NUM); - console.log('======>ACTS_NewWant_Test getMissionId missionInfos<=======' + missionInfos); - for (let i = 0; i < missionInfos.length; i++) { - console.log('getMissionId result: ' + i + '= ' + JSON.stringify(missionInfos[i])) - if ((missionInfos[i].want.abilityName == "com.example.newwanttest.MainAbility") && - (missionInfos[i].runningState == 0)) { - missionId = missionInfos[i].missionId; - break; - } - } - console.log('======>ACTS_NewWant_Test getMissionId resolve missionId<=======' + missionId); - resolve(missionId); - }) -} - -export default function abilityTest(abilityContext) { - describe('ActsNewWantTest', function () { - - afterEach(async (done) => { - - var testMissionId; - testMissionId = await getMissionId(); - console.log('======>ACTS_NewWant_Test afterEach test missionId<=======' + testMissionId); - await missionManager.moveMissionToFront(testMissionId); - console.log('======>ACTS_NewWant_Test afterEach test move<======='); - - await appManager.killProcessesByBundleName("com.example.newwanthapapi7"); - await appManager.killProcessesByBundleName("com.example.newwanthapa"); - await appManager.killProcessesByBundleName("com.example.newwanthap"); - - done(); - }) - - /** - * @tc.number: ACTS_NewWant_Test_0100 - * @tc.name: Starting standard Ability for the first time does not trigger onNewWant. - * @tc.desc: Starting standard Ability for the first time does not trigger onNewWant. - */ - it('ACTS_NewWant_Test_0100', 0, async function (done) { - console.log("ACTS_NewWant_Test_0100 --- start") - var Subscriber; - var flagOnCreate = 0; - var flagOnWindowStageCreate = 0; - var flagOnForeground = 0; - var flagOnNewWant = 0; - - abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.MainAbility" - }, (error, data) => { - console.log('ACTS_NewWant_Test_0100 - startAbility start standard: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_NewWant_Test_0100====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - - console.debug("ACTS_NewWant_Test_0100====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_NewWant_Test_0100====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - switch (data.event) { - case 'onCreateMain_To_Test_CommonEvent': - flagOnCreate++; - break; - case 'onWindowStageCreateMain_To_Test_CommonEvent': - flagOnWindowStageCreate++; - break; - case 'onForegroundMain_To_Test_CommonEvent': - flagOnForeground++; - break; - case 'onNewWantMain_To_Test_CommonEvent': - flagOnNewWant++; - break; - } - console.debug("ACTS_NewWant_Test_0100====>flagOnCreate:====>" - + flagOnCreate) - console.debug("ACTS_NewWant_Test_0100====>flagOnWindowStageCreate:====>" - + flagOnWindowStageCreate) - console.debug("ACTS_NewWant_Test_0100====>flagOnForeground:====>" - + flagOnForeground) - console.debug("ACTS_NewWant_Test_0100====>flagOnNewWant:====>" - + flagOnNewWant) - if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 - && flagOnForeground == 1 && flagOnNewWant == 0) { - expect(flagOnCreate).assertEqual(1); - expect(flagOnWindowStageCreate).assertEqual(1); - expect(flagOnForeground).assertEqual(1); - expect(flagOnNewWant).assertEqual(0); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - - function UnSubscribeCallback() { - console.debug("ACTS_NewWant_Test_0100====>UnSubscribe CallBack====>"); - done(); - } - }) - - /** - * @tc.number: ACTS_NewWant_Test_0200 - * @tc.name: Starting singleton Ability for the first time does not trigger onNewWant. - * @tc.desc: Starting singleton Ability for the first time does not trigger onNewWant. - */ - it('ACTS_NewWant_Test_0200', 0, async function (done) { - console.log("ACTS_NewWant_Test_0200 --- start") - var Subscriber; - var flagOnCreate = 0; - var flagOnWindowStageCreate = 0; - var flagOnForeground = 0; - var flagOnNewWant = 0; - - abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.SecondAbility" - }, (error, data) => { - console.log('ACTS_NewWant_Test_0200 - startAbility start singleton: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_NewWant_Test_0200====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - - console.debug("ACTS_NewWant_Test_0200====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_NewWant_Test_0200====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - switch (data.event) { - case 'onCreateSecond_To_Test_CommonEvent': - flagOnCreate++; - break; - case 'onWindowStageCreateSecond_To_Test_CommonEvent': - flagOnWindowStageCreate++; - break; - case 'onForegroundSecond_To_Test_CommonEvent': - flagOnForeground++; - break; - case 'onNewWantSecond_To_Test_CommonEvent': - flagOnNewWant++; - break; - } - console.debug("ACTS_NewWant_Test_0200====>flagOnCreate:====>" - + flagOnCreate) - console.debug("ACTS_NewWant_Test_0200====>flagOnWindowStageCreate:====>" - + flagOnWindowStageCreate) - console.debug("ACTS_NewWant_Test_0200====>flagOnForeground:====>" - + flagOnForeground) - console.debug("ACTS_NewWant_Test_0200====>flagOnNewWant:====>" - + flagOnNewWant) - if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 - && flagOnForeground == 1 && flagOnNewWant == 0) { - expect(flagOnCreate).assertEqual(1); - expect(flagOnWindowStageCreate).assertEqual(1); - expect(flagOnForeground).assertEqual(1); - expect(flagOnNewWant).assertEqual(0); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - - function UnSubscribeCallback() { - console.debug("ACTS_NewWant_Test_0200====>UnSubscribe CallBack====>"); - done(); - } - }) - - /** - * @tc.number: ACTS_NewWant_Test_0300 - * @tc.name: Starting standard ability the second time does not trigger onNewWant. - * @tc.desc: Starting standard ability the second time does not trigger onNewWant. - */ - it('ACTS_NewWant_Test_0300', 0, async function (done) { - console.log("ACTS_NewWant_Test_0300 --- start") - var Subscriber; - var flagOnCreate = 0; - var flagOnWindowStageCreate = 0; - var flagOnForeground = 0; - var flagOnNewWant = 0; - - abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.MainAbility", - action: "startStandard0300" - }, (error, data) => { - console.log('ACTS_NewWant_Test_0300 - startAbility start standard: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_NewWant_Test_0300====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - - console.debug("ACTS_NewWant_Test_0300====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_NewWant_Test_0300====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - switch (data.event) { - case 'onCreateMain_To_Test_CommonEvent': - flagOnCreate++; - break; - case 'onWindowStageCreateMain_To_Test_CommonEvent': - flagOnWindowStageCreate++; - break; - case 'onForegroundMain_To_Test_CommonEvent': - flagOnForeground++; - break; - case 'onNewWantMain_To_Test_CommonEvent': - flagOnNewWant++; - break; - } - console.debug("ACTS_NewWant_Test_0300====>flagOnCreate:====>" - + flagOnCreate) - console.debug("ACTS_NewWant_Test_0300====>flagOnWindowStageCreate:====>" - + flagOnWindowStageCreate) - console.debug("ACTS_NewWant_Test_0300====>flagOnForeground:====>" - + flagOnForeground) - console.debug("ACTS_NewWant_Test_0300====>flagOnNewWant:====>" - + flagOnNewWant) - - if (flagOnCreate == 2 && flagOnWindowStageCreate == 2 - && flagOnForeground == 2 && flagOnNewWant == 0) { - expect(flagOnCreate).assertEqual(2); - expect(flagOnWindowStageCreate).assertEqual(2); - expect(flagOnForeground).assertEqual(2); - expect(flagOnNewWant).assertEqual(0); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - function UnSubscribeCallback() { - console.debug("ACTS_NewWant_Test_0300====>UnSubscribe CallBack====>"); - done(); - } - }) - - /** - * @tc.number: ACTS_NewWant_Test_0400 - * @tc.name: Two abilities of the same hap - * @tc.desc: Starting singleton ability the second time does triggers onNewWant. - */ - it('ACTS_NewWant_Test_0400', 0, async function (done) { - console.log("ACTS_NewWant_Test_0400 --- start") - var Subscriber; - var flagOnCreate = 0; - var flagOnWindowStageCreate = 0; - var flagOnForeground = 0; - var flagOnNewWant = 0; - - abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.SecondAbility", - action: "startSingleton0400" - }, (error, data) => { - console.log('ACTS_NewWant_Test_0400 - startAbility start singleton: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_NewWant_Test_0400====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - - console.debug("ACTS_NewWant_Test_0400====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_NewWant_Test_0400====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - switch (data.event) { - case 'onCreateSecond_To_Test_CommonEvent': - flagOnCreate++; - break; - case 'onWindowStageCreateSecond_To_Test_CommonEvent': - flagOnWindowStageCreate++; - break; - case 'onForegroundSecond_To_Test_CommonEvent': - flagOnForeground++; - break; - case 'onNewWantSecond_To_Test_CommonEvent': - flagOnNewWant++; - expect(data.data).assertEqual('restartSingleton'); - break; - } - console.debug("ACTS_NewWant_Test_0400====>flagOnCreate:====>" - + flagOnCreate) - console.debug("ACTS_NewWant_Test_0400====>flagOnWindowStageCreate:====>" - + flagOnWindowStageCreate) - console.debug("ACTS_NewWant_Test_0400====>flagOnForeground:====>" - + flagOnForeground) - console.debug("ACTS_NewWant_Test_0400====>flagOnNewWant:====>" - + flagOnNewWant) - - if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 - && flagOnForeground == 2 && flagOnNewWant == 1) { - expect(flagOnCreate).assertEqual(1); - expect(flagOnWindowStageCreate).assertEqual(1); - expect(flagOnForeground).assertEqual(2); - expect(flagOnNewWant).assertEqual(1); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - - function UnSubscribeCallback() { - console.debug("ACTS_NewWant_Test_0400====>UnSubscribe CallBack====>"); - done(); - } - }) - - /** - * @tc.number: ACTS_NewWant_Test_0500 - * @tc.name: Two haps of the same app - * @tc.desc: Starting singleton ability the second time does triggers onNewWant. - */ - it('ACTS_NewWant_Test_0500', 0, async function (done) { - console.log("ACTS_NewWant_Test_0500 --- start") - var Subscriber; - var flagOnCreate = 0; - var flagOnWindowStageCreate = 0; - var flagOnForeground = 0; - var flagOnNewWant = 0; - - abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapb.MainAbility", - action: "startHapB" - }, (error, data) => { - console.log('ACTS_NewWant_Test_0500 - startAbility start HapB: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_NewWant_Test_0500====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - - console.debug("ACTS_NewWant_Test_0500====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_NewWant_Test_0500====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - switch (data.event) { - case 'onCreateMain_To_Test_CommonEvent': - flagOnCreate++; - break; - case 'onWindowStageCreateMain_To_Test_CommonEvent': - flagOnWindowStageCreate++; - break; - case 'onForegroundMain_To_Test_CommonEvent': - flagOnForeground++; - break; - case 'onNewWantMain_To_Test_CommonEvent': - flagOnNewWant++; - expect(data.data).assertEqual('restartHapB'); - break; - } - console.debug("ACTS_NewWant_Test_0500====>flagOnCreate:====>" - + flagOnCreate) - console.debug("ACTS_NewWant_Test_0500====>flagOnWindowStageCreate:====>" - + flagOnWindowStageCreate) - console.debug("ACTS_NewWant_Test_0500====>flagOnForeground:====>" - + flagOnForeground) - console.debug("ACTS_NewWant_Test_0500====>flagOnNewWant:====>" - + flagOnNewWant) - - if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 - && flagOnForeground == 2 && flagOnNewWant == 1) { - expect(flagOnCreate).assertEqual(1); - expect(flagOnWindowStageCreate).assertEqual(1); - expect(flagOnForeground).assertEqual(2); - expect(flagOnNewWant).assertEqual(1); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - - function UnSubscribeCallback() { - console.debug("ACTS_NewWant_Test_0500====>UnSubscribe CallBack====>"); - done(); - } - }) - - /** - * @tc.number: ACTS_NewWant_Test_0600 - * @tc.name: Cross-application - * @tc.desc: Starting singleton ability the second time does triggers onNewWant. - */ - it('ACTS_NewWant_Test_0600', 0, async function (done) { - console.log("ACTS_NewWant_Test_0600 --- start") - var Subscriber; - var flagOnCreate = 0; - var flagOnWindowStageCreate = 0; - var flagOnForeground = 0; - var flagOnNewWant = 0; - - abilityContext.startAbility({ - bundleName: "com.example.newwanthapa", - abilityName: "com.example.newwanthapc.MainAbility", - action: "startHapC" - }, (error, data) => { - console.log('ACTS_NewWant_Test_0600 - startAbility start HapC: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_NewWant_Test_0600====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - - console.debug("ACTS_NewWant_Test_0600====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_NewWant_Test_0600====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - switch (data.event) { - case 'onCreateMain_To_Test_CommonEvent': - flagOnCreate++; - break; - case 'onWindowStageCreateMain_To_Test_CommonEvent': - flagOnWindowStageCreate++; - break; - case 'onForegroundMain_To_Test_CommonEvent': - flagOnForeground++; - break; - case 'onNewWantMain_To_Test_CommonEvent': - flagOnNewWant++; - expect(data.data).assertEqual('restartHapC'); - break; - } - console.debug("ACTS_NewWant_Test_0600====>flagOnCreate:====>" - + flagOnCreate) - console.debug("ACTS_NewWant_Test_0600====>flagOnWindowStageCreate:====>" - + flagOnWindowStageCreate) - console.debug("ACTS_NewWant_Test_0600====>flagOnForeground:====>" - + flagOnForeground) - console.debug("ACTS_NewWant_Test_0600====>flagOnNewWant:====>" - + flagOnNewWant) - - if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 - && flagOnForeground == 2 && flagOnNewWant == 1) { - expect(flagOnCreate).assertEqual(1); - expect(flagOnWindowStageCreate).assertEqual(1); - expect(flagOnForeground).assertEqual(2); - expect(flagOnNewWant).assertEqual(1); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - - function UnSubscribeCallback() { - console.debug("ACTS_NewWant_Test_0600====>UnSubscribe CallBack====>"); - done(); - } - }) - - /** - * @tc.number: ACTS_NewWant_Test_0700 - * @tc.name: Service ability - * @tc.desc: Starting singleton ability the second time does triggers onNewWant. - */ - it('ACTS_NewWant_Test_0700', 0, async function (done) { - console.log("ACTS_NewWant_Test_0700 --- start") - var Subscriber; - var flagOnCreate = 0; - var flagOnWindowStageCreate = 0; - var flagOnForeground = 0; - var flagOnNewWant = 0; - - abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.SecondAbility", - action: "startSecondAbility0700" - }, (error, data) => { - console.log('ACTS_NewWant_Test_0700 - startAbility start SecondAbility: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_NewWant_Test_0700====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - - console.debug("ACTS_NewWant_Test_0700====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_NewWant_Test_0700====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - switch (data.event) { - case 'onCreateSecond_To_Test_CommonEvent': - flagOnCreate++; - break; - case 'onWindowStageCreateSecond_To_Test_CommonEvent': - flagOnWindowStageCreate++; - break; - case 'onForegroundSecond_To_Test_CommonEvent': - flagOnForeground++; - break; - case 'onNewWantSecond_To_Test_CommonEvent': - flagOnNewWant++; - expect(data.data).assertEqual('restartSecondAbility0700'); - break; - } - console.debug("ACTS_NewWant_Test_0700====>flagOnCreate:====>" - + flagOnCreate) - console.debug("ACTS_NewWant_Test_0700====>flagOnWindowStageCreate:====>" - + flagOnWindowStageCreate) - console.debug("ACTS_NewWant_Test_0700====>flagOnForeground:====>" - + flagOnForeground) - console.debug("ACTS_NewWant_Test_0700====>flagOnNewWant:====>" - + flagOnNewWant) - - if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 - && flagOnForeground == 2 && flagOnNewWant == 1) { - expect(flagOnCreate).assertEqual(1); - expect(flagOnWindowStageCreate).assertEqual(1); - expect(flagOnForeground).assertEqual(2); - expect(flagOnNewWant).assertEqual(1); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - function UnSubscribeCallback() { - console.debug("ACTS_NewWant_Test_0700====>UnSubscribe CallBack====>"); - done(); - } - }) - - /** - * @tc.number: ACTS_NewWant_Test_0800 - * @tc.name: API8 startup API7 - * @tc.desc: Starting singleton ability the second time does triggers onNewWant. - */ - it('ACTS_NewWant_Test_0800', 0, async function (done) { - console.log("ACTS_NewWant_Test_0800 --- start") - var Subscriber; - var flagOnCreate = 0; - var flagOnWindowStageCreate = 0; - var flagOnForeground = 0; - var flagOnNewWant = 0; - - abilityContext.startAbility({ - bundleName: "com.example.newwanthap", - abilityName: "com.example.newwanthapa.SecondAbility", - action: "startSecondAbility0800" - }, (error, data) => { - console.log('ACTS_NewWant_Test_0800 - startAbility start SecondAbility: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }) - - commonEvent.createSubscriber(subscriberInfo).then(async (data) => { - console.debug("ACTS_NewWant_Test_0800====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function SubscribeCallBack(err, data) { - - console.debug("ACTS_NewWant_Test_0800====>Subscribe CallBack data:====>" - + JSON.stringify(data)); - console.debug("ACTS_NewWant_Test_0800====>Subscribe CallBack data.event:====>" - + JSON.stringify(data.event)); - switch (data.event) { - case 'onCreateSecond_To_Test_CommonEvent': - flagOnCreate++; - break; - case 'onWindowStageCreateSecond_To_Test_CommonEvent': - flagOnWindowStageCreate++; - break; - case 'onForegroundSecond_To_Test_CommonEvent': - flagOnForeground++; - break; - case 'onNewWantSecond_To_Test_CommonEvent': - flagOnNewWant++; - expect(data.data).assertEqual('restartSecondAbility0800'); - break; - } - console.debug("ACTS_NewWant_Test_0800====>flagOnCreate:====>" - + flagOnCreate) - console.debug("ACTS_NewWant_Test_0800====>flagOnWindowStageCreate:====>" - + flagOnWindowStageCreate) - console.debug("ACTS_NewWant_Test_0800====>flagOnForeground:====>" - + flagOnForeground) - console.debug("ACTS_NewWant_Test_0800====>flagOnNewWant:====>" - + flagOnNewWant) - - if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 - && flagOnForeground == 2 && flagOnNewWant == 1) { - expect(flagOnCreate).assertEqual(1); - expect(flagOnWindowStageCreate).assertEqual(1); - expect(flagOnForeground).assertEqual(2); - expect(flagOnNewWant).assertEqual(1); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - } - function UnSubscribeCallback() { - console.debug("ACTS_NewWant_Test_0800====>UnSubscribe CallBack====>"); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index 64b2a602e..000000000 --- a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import abilityTest from './Ability.test.ets' - - -export default function testsuite(context) { - - abilityTest(context) - -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/app.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/app.json deleted file mode 100755 index 5ce28640c..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsabilitypermissiontest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/Test.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/Test.json deleted file mode 100755 index 40ee14906..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/Test.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.example.actsabilitypermissiontest", - "shell-timeout": "300000" - }, - "kits": [ - { - "test-file-name": [ - "ActsSystemAppATest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSystemAppATest.hap->/system/app/ActsSystemAppATest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm switch -i 101" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSystemAppOneRelyHap.hap->/system/app/ActsSystemAppOneRelyHap.hap" - ] - }, - { - "test-file-name": [ - "ActsSystemAppOneRelyHap.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/*.hap" - ] - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 8084b50ef..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100755 index d33842fda..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne1() { - console.debug("====>Publish CallBack ACTS_ThirdPartyAbilityPermission_0100_CommonEvent====>"); - globalThis.ability2Context.terminateSelf(); - console.debug("====>close this context====>") -} - - -export default class MainAbility2 extends Ability { - - onCreate(want, launchParam) { - console.log("MainAbility2 onCreate") - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - windowStage.setUIContent(this.context, "pages/index/index2", null) - globalThis.ability2Context = this.context; - commonEvent.publish("ACTS_AbilityPermission_0100_Start_CommonEvent", PublishCallBackOne1); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility2 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility2 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility2 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets deleted file mode 100755 index 1155a2657..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// @ts-nocheck -import osaccount from '@ohos.account.osaccount' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' -var AbilityPermission1 = { - events: ["ACTS_AbilityPermission_0100_Start_CommonEvent"] -} -var AbilityPermission3 = { - events: ["ACTS_AbilityPermission_0300_Start_CommonEvent"] -} -var AbilityPermission4 = { - events: ["ACTS_AbilityPermission_0400_Start_CommonEvent"] -} -var AbilityPermission6 = { - events: ["ACTS_AbilityPermission_0600_Start_CommonEvent"] -} -const START_ABILITY_TIMEOUT = 3000; -export default function abilityPermissionTest(abilityContext) { - describe('ActsAbilityPermissionTest', function () { - var osAccountManager = osaccount.getAccountManager(); - var userA; - var userB; - beforeAll(async function(done){ - osAccountManager.getOsAccountLocalIdFromProcess().then((data)=>{ - userA = data - userB=userA+1 - console.log("userA=====>"+userA) - done() - }); - - }) - afterAll(async function(done){ - await osAccountManager.removeOsAccount(userB, (err)=>{ - console.debug("====>remove localId: " + userB + " err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - }) - - /* - * @tc.number: ACTS_AbilityPermission_0100 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Start an ability that belongs to the current user with the current user - */ - it('ACTS_AbilityPermission_0100', 0, async function (done) { - console.log("ACTS_AbilityPermission_0100====>callback start====>") - var Subscriber; - var flag = true; - - function SubscribeCallBack(err, data) { - console.debug("ACTS_AbilityPermission_0100====>Subscribe CallBack data:====>" + JSON.stringify(data)); - expect(data.event == 'ACTS_AbilityPermission_0100_Start_CommonEvent').assertTrue() - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(AbilityPermission1).then(async (data) => { - console.debug("ACTS_AbilityPermission_0100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbility_100====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsabilitypermissiontest', - abilityName: 'com.example.actsabilitypermissiontest.MainAbility2' - }, userA, () => { - console.debug("====>startAbility end_100====>"); - }) - }) - - function UnSubscribeCallback() { - flag = false - console.debug("ACTS_AbilityPermission_0100====>UnSubscribe CallBack====>"+flag); - done(); - } - setTimeout(()=>{ - if (flag == true) { - expect().assertFail(); - console.debug('in ACTS_AbilityPermission_0100====>timeout====>'+flag); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - console.debug('ACTS_AbilityPermission_0100====>timeout====>'); - }, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number: ACTS_AbilityPermission_0300 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Start an ability under user U101 with the current user - */ - it('ACTS_AbilityPermission_0300', 0, async function (done) { - console.log("ACTS_AbilityPermission_0300====>callback start====>") - var Subscriber - var flag = 0; - console.debug("====>get AccountManager finish===="); - - function SubscribeCallBack(err, data) { - console.debug("ACTS_AbilityPermission_0300====>Subscribe CallBack data:====>" + JSON.stringify(data)); - expect(data.event == 'ACTS_AbilityPermission_0300_Start_CommonEvent').assertTrue() - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - commonEvent.createSubscriber(AbilityPermission3).then(async (data) => { - console.debug("ACTS_AbilityPermission_0300====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbility_0300====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actssystemappuonehundredonerelytest', - abilityName: 'com.example.actssystemappuonehundredonerelytest.MainAbility' - }, userA ).then().catch((err) => { - console.debug("ACTS_AbilityPermission_0300====>" + err) - - console.debug("====>startAbility end_0300====>"); - }) - }) - function UnSubscribeCallback() { - if(flag == 0) { - expect().assertFail(); - } - console.debug("ACTS_AbilityPermission_0300====>UnSubscribe CallBack====>"); - done(); - } - function timeout() { - console.debug('ACTS_AbilityPermission_0300====>timeout====>'); - if(flag == 0){ - flag = 1; - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number: ACTS_AbilityPermission_0400 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Bind an Ability to which you belong with the current user - */ - it('ACTS_AbilityPermission_0400', 0, async function (done) { - console.log("ACTS_AbilityPermission_0400====>callback start====>") - let Subscriber - var flag = true - - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_AbilityPermission_0400_Start_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - abilityContext.disconnectAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - } - - function onConnectCallback(element, remote) { - console.log('ACTS_AbilityPermission_0400_Start_CommonEvent onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_AbilityPermission_0400_Start_CommonEvent onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_AbilityPermission_0400_Start_CommonEvent - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - commonEvent.createSubscriber(AbilityPermission4).then(async (data) => { - console.debug("====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actsabilitypermissiontest', - abilityName: 'com.example.actsabilitypermissiontest.ServiceAbility', - action: "StartAbilityPromise" - }, userA, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - done() - } - - function timeout() { - console.debug('in ACTS_AbilityPermission_0400_Start_CommonEvent timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_AbilityPermission_0400_Start_CommonEvent - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number: ACTS_AbilityPermission_0600 - * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start - * @tc.desc: Bind a U101 Ability with the current user - */ - it('ACTS_AbilityPermission_0600', 0, async function (done) { - console.log("ACTS_AbilityPermission_0600====>callback start====>") - let Subscriber - let connId - function onConnectCallbackC(element, remote) { - console.log('ACTS_AbilityPermission_0600_Start_CommonEvent onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_AbilityPermission_0600_Start_CommonEvent onConnectCallback====> remote=' + JSON.stringify(remote)); - expect().assertFail(); - } - function onDisconnectCallbackC(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - function onFailedCallbackC(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - function SubscribeCallBackF(err, data) { - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - } - function UnSubscribeCallbackF() { - console.debug("====>UnSubscribeCallback====>"); - } - commonEvent.createSubscriber(AbilityPermission6).then(async (data) => { - console.debug("====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBackF); - }) - console.debug("====>0600start connectAbility====>"); - connId = await abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actssystemappuonehundredonerelytest', - abilityName: 'com.example.actssystemappuonehundredonerelytest.ServiceAbility', - action: "StartAbilityPromise" - }, userA, { - onConnect: onConnectCallbackC, - onDisconnect: onDisconnectCallbackC, - onFailed: onFailedCallbackC - }) - console.debug("====>number is====>" + JSON.stringify(connId)); - setTimeout(() =>{ - console.debug('in ACTS_AbilityPermission_0600_Start_CommonEvent timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallbackF) - done() - }, START_ABILITY_TIMEOUT); - }) - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/List.test.ets b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index c3f15765b..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import abilityPermissionText from './AbilityPermission.test.ets' - -export default function testsuite(context) { - abilityPermissionText(context) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/module.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/module.json deleted file mode 100755 index ddbd5e118..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/module.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "module": { - "name": "com.example.actsabilitypermissiontest", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsabilitypermissiontest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - }, - { - "name": "com.example.actsabilitypermissiontest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actsabilitypermissiontest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - }, - { - "name":"ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.INTERACT_ACROSS)LOCAL_ACCOUNTS_EXTENSION", - "reason":"need use ohos.permission.INTERACT_ACROSS)LOCAL_ACCOUNTS_EXTENSION" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ] - } -} diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/app.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/app.json deleted file mode 100755 index 18517fb49..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.acts.pmvendorappa", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/Test.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index bca5b9f27..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne3() { - console.debug("====>Publish CallBack ACTS_StartAbility_0300_CommonEvent====>"); - setTimeout(globalThis.abilityContext.terminateSelfWithResult(()=>{ - console.debug("====>terminateSelfWithResult succese====>") - }),1000) -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - commonEvent.publish("ACTS_AbilityPermission_0300_Start_CommonEvent", PublishCallBackOne3); - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json deleted file mode 100755 index 4368135e3..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "module": { - "name": "com.example.actssystemappuonehundredonerelytest", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actssystemappuonehundredonerelytest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actssystemappuonehundredonerelytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ] - } -} diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/app.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/app.json deleted file mode 100755 index 6ee778915..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multiinstancehapa", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/Test.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index c7512768c..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_Process_MultiInstance_HapAA MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_Process_MultiInstance_HapAA MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_Process_MultiInstance_HapAA MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - - commonEvent.publish("HapAA_To_Test_CommonEvent", () => { - console.log("ACTS_Process_MultiInstance_HapAA Publish CallBack HapAA_To_Test_CommonEvent") - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_Process_MultiInstance_HapAA MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_Process_MultiInstance_HapAA MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("ACTS_Process_MultiInstance_HapAA MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json deleted file mode 100755 index 446592a4a..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "com.example.multiinstancehapaa", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.multiinstancehapaa.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/app.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/app.json deleted file mode 100755 index 6ee778915..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multiinstancehapa", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/Test.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index a470e0e68..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_Process_MultiInstance_HapAB MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_Process_MultiInstance_HapAB MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_Process_MultiInstance_HapAB MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - - commonEvent.publish("HapAB_To_Test_CommonEvent", () => { - console.log("ACTS_Process_MultiInstance_HapAB Publish CallBack HapAB_To_Test_CommonEvent") - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_Process_MultiInstance_HapAB MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_Process_MultiInstance_HapAB MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("ACTS_Process_MultiInstance_HapAB MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json deleted file mode 100755 index 3193a5605..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "module": { - "name": "com.example.multiinstancehapab", - "process": "com.example.multiinstancehapb", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.multiinstancehapab.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/app.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/app.json deleted file mode 100755 index 76222f851..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multiinstancehapb", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/Test.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index dd5939225..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -let connectionId = -1; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - - let context = this.context; - - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_Process_MultiInstance_HapBA MainAbility onForeground") - commonEvent.publish("HapBA_To_Test_CommonEvent", () => { - console.log("ACTS_Process_MultiInstance_HapBA Publish CallBack HapBA_To_Test_CommonEvent") - }); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json deleted file mode 100755 index e1da94c04..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "com.example.multiinstancehapba", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.multiinstancehapba.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/app.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/app.json deleted file mode 100755 index 76222f851..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multiinstancehapb", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/Test.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 0d81d7587..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -let connectionId = -1; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - - let context = this.context; - - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_Process_MultiInstance_HapBB MainAbility onForeground") - commonEvent.publish("HapBB_To_Test_CommonEvent", () => { - console.log("ACTS_Process_MultiInstance_HapBB Publish CallBack HapBB_To_Test_CommonEvent") - }); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json deleted file mode 100755 index e4b42227e..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "com.example.multiinstancehapbb", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.multiinstancehapbb.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/app.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/app.json deleted file mode 100755 index 76222f851..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multiinstancehapb", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/Test.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 0e5544d92..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -let connectionId = -1; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - - let context = this.context; - - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_Process_MultiInstance_HapBC MainAbility onForeground") - commonEvent.publish("HapBC_To_Test_CommonEvent", () => { - console.log("ACTS_Process_MultiInstance_HapBC Publish CallBack HapBC_To_Test_CommonEvent") - }); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json deleted file mode 100755 index d2d2f4065..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "module": { - "name": "com.example.multiinstancehapbc", - "process": "com.example.multiinstancehapc", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.multiinstancehapbc.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/app.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/app.json deleted file mode 100755 index 76222f851..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multiinstancehapb", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/Test.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index b15976050..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -let connectionId = -1; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - - let context = this.context; - - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_Process_MultiInstance_HapBD MainAbility onForeground") - commonEvent.publish("HapBD_To_Test_CommonEvent", () => { - console.log("ACTS_Process_MultiInstance_HapBD Publish CallBack HapBD_To_Test_CommonEvent") - }); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json deleted file mode 100755 index 63cfcda75..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "module": { - "name": "com.example.multiinstancehapbd", - "process": "com.example.multiinstancehapc", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.multiinstancehapbd.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/app.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/app.json deleted file mode 100755 index 76222f851..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multiinstancehapb", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/Test.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 099b49aa8..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -let connectionId = -1; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - - let context = this.context; - - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_Process_MultiInstance_HapBE MainAbility onForeground") - commonEvent.publish("HapBE_To_Test_CommonEvent", () => { - console.log("ACTS_Process_MultiInstance_HapBE Publish CallBack HapBE_To_Test_CommonEvent") - }); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json deleted file mode 100755 index 0e86d9f94..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "module": { - "name": "com.example.multiinstancehapbe", - "process": "com.example.multiinstancehapa", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.multiinstancehapbe.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/app.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/app.json deleted file mode 100755 index 76222f851..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.multiinstancehapb", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/Test.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 89d0d0dd5..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' - -let connectionId = -1; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - - let context = this.context; - - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ACTS_Process_MultiInstance_HapBF MainAbility onForeground") - commonEvent.publish("HapBF_To_Test_CommonEvent", () => { - console.log("ACTS_Process_MultiInstance_HapBF Publish CallBack HapBF_To_Test_CommonEvent") - }); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json deleted file mode 100755 index e3a2ad35e..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "module": { - "name": "com.example.multiinstancehapbf", - "process": "com.example.multiinstancehapb", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.multiinstancehapbf.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/BUILD.gn b/aafwk/aafwk_standard/stage/BUILD.gn deleted file mode 100644 index 6a0cb7132..000000000 --- a/aafwk/aafwk_standard/stage/BUILD.gn +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("stage") { - testonly = true - if (is_standard_system) { - deps = [ - "actslifecyclemultihap2test:ActsLifecycleMultiHap2Test", - "actslifecyclemultihap3test:ActsLifecycleMultiHap3Test", - "actslifecyclemultihaptest:ActsLifecycleMultiHapTest", - "actslifecyclesinglehaptest:ActsLifecycleSingleHapTest", - ] - } -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/app.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/app.json deleted file mode 100644 index dbcb3167b..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.lifecycletest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/resources/base/element/string.json deleted file mode 100644 index 703846c23..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"LifecycleHap2Test" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/BUILD.gn b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/BUILD.gn deleted file mode 100644 index af0d05bb6..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/BUILD.gn +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsLifecycleMultiHap2Test") { - hap_profile = "entry/src/main/module.json" - deps = [ - ":actslifecyclemultihap2test_js_assets", - ":actslifecyclemultihap2test_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsLifecycleMultiHap2Test" -} - -ohos_app_scope("actslifecyclemultihap2test_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actslifecyclemultihap2test_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actslifecyclemultihap2test_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actslifecyclemultihap2test_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/Test.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/Test.json deleted file mode 100644 index 8e4f789b7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.example.lifecycletest", - "shell-timeout": "600000" - }, - "kits": [ - { - "test-file-name": [ - "ActsLifecycleMultiHap2Test.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility1/Hap2MainAbility1.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility1/Hap2MainAbility1.ts deleted file mode 100644 index 92902fb7c..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility1/Hap2MainAbility1.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility1 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility1 onCreate") - globalThis.abilityWant = want; - - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility1 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility1 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility1_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility1 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility1 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility1 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility10/Hap2MainAbility10.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility10/Hap2MainAbility10.ts deleted file mode 100644 index 875ee511c..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility10/Hap2MainAbility10.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility10 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility10 onCreate") - globalThis.abilityWant = want; - - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility10 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility10 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility10_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility10 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility10 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility10 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility2/Hap2MainAbility2.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility2/Hap2MainAbility2.ts deleted file mode 100644 index 134264ca6..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility2/Hap2MainAbility2.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility2 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility2 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility2 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility2_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility2 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility2 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility2 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility3/Hap2MainAbility3.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility3/Hap2MainAbility3.ts deleted file mode 100644 index ec0ead03b..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility3/Hap2MainAbility3.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility3 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility3 onCreate") - globalThis.abilityWant = want; - - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap2MainAbility3 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap2MainAbility3 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 2000) - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility3 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility3 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility3_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility3 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility3 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility3 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility4/Hap2MainAbility4.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility4/Hap2MainAbility4.ts deleted file mode 100644 index bc489ed85..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility4/Hap2MainAbility4.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility4 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility4 onCreate") - globalThis.abilityWant = want; - - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap2MainAbility4 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap2MainAbility4 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 2000) - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility4 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility4 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility4_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility4 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility4 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility4 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility5/Hap2MainAbility5.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility5/Hap2MainAbility5.ts deleted file mode 100644 index 0eac06dcb..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility5/Hap2MainAbility5.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility5 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility5 onCreate") - globalThis.abilityWant = want; - - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap2MainAbility5 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap2MainAbility5 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 2000) - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility5 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility5 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility5_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility5 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility5 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility5 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility6/Hap2MainAbility6.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility6/Hap2MainAbility6.ts deleted file mode 100644 index ba35a38dd..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility6/Hap2MainAbility6.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility6 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility6 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility6 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility6 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility6_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility6 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility6 onForeground") - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap2MainAbility6 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap2MainAbility6 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 2000) - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility6 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility7/Hap2MainAbility7.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility7/Hap2MainAbility7.ts deleted file mode 100644 index 0f181a7e7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility7/Hap2MainAbility7.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility7 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility7 onCreate") - globalThis.abilityWant = want; - - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap2MainAbility7 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap2MainAbility7 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 2000) - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility7 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility7 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility7_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility7 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility7 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility7 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility8/Hap2MainAbility8.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility8/Hap2MainAbility8.ts deleted file mode 100644 index 2e846ca0b..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility8/Hap2MainAbility8.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility8 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility8 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility8 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility8 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility8_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resourcesl - console.log("[Demo] Hap2MainAbility8 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility8 onForeground") - - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap2MainAbility8 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap2MainAbility8 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 500) - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility8 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility9/Hap2MainAbility9.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility9/Hap2MainAbility9.ts deleted file mode 100644 index f8b778653..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility9/Hap2MainAbility9.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ability from '@ohos.application.Ability' - -export default class Hap2MainAbility9 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap2MainAbility9 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] Hap2MainAbility9 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap2MainAbility9 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap2MainAbility9_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap2MainAbility9 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap2MainAbility9 onForeground") - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap2MainAbility9 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap2MainAbility9 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 500) - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap2MainAbility9 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility10_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility10_pages.ets deleted file mode 100644 index f0a9dc55f..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility10_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility10_pages { - @State message: string = 'Hap2MainAbility10' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility1_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility1_pages.ets deleted file mode 100644 index de7084b00..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility1_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility1_pages { - @State message: string = 'Hap2MainAbility1' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility2_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility2_pages.ets deleted file mode 100644 index c7c165bb0..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility2_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility2_pages { - @State message: string = 'Hap2MainAbility2' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility3_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility3_pages.ets deleted file mode 100644 index 01e584748..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility3_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility3_pages { - @State message: string = 'Hap2MainAbility3' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility4_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility4_pages.ets deleted file mode 100644 index b96453972..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility4_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility4_pages { - @State message: string = 'Hap2MainAbility4' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility5_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility5_pages.ets deleted file mode 100644 index f9847ac7a..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility5_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility5_pages { - @State message: string = 'Hap2MainAbility5' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility6_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility6_pages.ets deleted file mode 100644 index d58d252a7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility6_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility6_pages { - @State message: string = 'Hap2MainAbility6' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility7_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility7_pages.ets deleted file mode 100644 index 9f3028bcc..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility7_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility7_pages { - @State message: string = 'Hap2MainAbility7' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility8_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility8_pages.ets deleted file mode 100644 index 46634dbb2..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility8_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility8_pages { - @State message: string = 'Hap2MainAbility8' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility9_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility9_pages.ets deleted file mode 100644 index 0d5b7089d..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility9_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap2MainAbility9_pages { - @State message: string = 'Hap2MainAbility9' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/module.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/module.json deleted file mode 100644 index 70180fed4..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/module.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "module": { - "name": "hap2", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:hap2_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.lifecycletest.Hap2MainAbility1", - "srcEntrance": "./ets/Hap2MainAbility1/Hap2MainAbility1.ts", - "description": "$string:Hap2MainAbility1_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility1_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }, - { - "name": "Hap2MainAbility2", - "srcEntrance": "./ets/Hap2MainAbility2/Hap2MainAbility2.ts", - "description": "$string:Hap2MainAbility2_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility2_label" - }, - { - "name": "Hap2MainAbility3", - "srcEntrance": "./ets/Hap2MainAbility3/Hap2MainAbility3.ts", - "description": "$string:Hap2MainAbility3_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility3_label" - }, - { - "name": "Hap2MainAbility4", - "srcEntrance": "./ets/Hap2MainAbility4/Hap2MainAbility4.ts", - "description": "$string:Hap2MainAbility4_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility4_label", - "launchType": "singleton" - }, - { - "name": "Hap2MainAbility5", - "srcEntrance": "./ets/Hap2MainAbility5/Hap2MainAbility5.ts", - "description": "$string:Hap2MainAbility5_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility5_label", - "launchType": "standard" - }, - { - "name": "Hap2MainAbility6", - "srcEntrance": "./ets/Hap2MainAbility6/Hap2MainAbility6.ts", - "description": "$string:Hap2MainAbility6_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility6_label" - }, - { - "name": "Hap2MainAbility7", - "srcEntrance": "./ets/Hap2MainAbility7/Hap2MainAbility7.ts", - "description": "$string:Hap2MainAbility7_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility7_label" - }, - { - "name": "Hap2MainAbility8", - "srcEntrance": "./ets/Hap2MainAbility8/Hap2MainAbility8.ts", - "description": "$string:Hap2MainAbility8_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility8_label" - }, - { - "name": "Hap2MainAbility9", - "srcEntrance": "./ets/Hap2MainAbility9/Hap2MainAbility9.ts", - "description": "$string:Hap2MainAbility9_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility9_label" - }, - { - "name": "Hap2MainAbility10", - "srcEntrance": "./ets/Hap2MainAbility10/Hap2MainAbility10.ts", - "description": "$string:Hap2MainAbility10_desc", - "icon": "$media:icon", - "label": "$string:Hap2MainAbility10_label" - }], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/resources/base/element/string.json deleted file mode 100644 index fa3564466..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsLifecycleMultihapTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "hap2_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "Hap2MainAbility1_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility1_label", - "value": "label" - }, - { - "name": "Hap2MainAbility2_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility2_label", - "value": "label" - }, - { - "name": "Hap2MainAbility3_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility3_label", - "value": "label" - }, - { - "name": "Hap2MainAbility4_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility4_label", - "value": "label" - }, - { - "name": "Hap2MainAbility5_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility5_label", - "value": "label" - }, - { - "name": "Hap2MainAbility6_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility6_label", - "value": "label" - }, - { - "name": "Hap2MainAbility7_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility7_label", - "value": "label" - }, - { - "name": "Hap2MainAbility8_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility8_label", - "value": "label" - }, - { - "name": "Hap2MainAbility9_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility9_label", - "value": "label" - }, - { - "name": "Hap2MainAbility10_desc", - "value": "description" - }, - { - "name": "Hap2MainAbility10_label", - "value": "label" - } - ] -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/app.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/app.json deleted file mode 100644 index dbcb3167b..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.lifecycletest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/resources/base/element/string.json deleted file mode 100644 index bc3d61635..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"LifecycleHap3Test" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/BUILD.gn b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/BUILD.gn deleted file mode 100644 index 80025dd93..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/BUILD.gn +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsLifecycleMultiHap3Test") { - hap_profile = "entry/src/main/module.json" - deps = [ - ":actslifecyclemultihap3test_js_assets", - ":actslifecyclemultihap3test_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsLifecycleMultiHap3Test" -} - -ohos_app_scope("actslifecyclemultihap3test_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actslifecyclemultihap3test_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actslifecyclemultihap3test_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actslifecyclemultihap3test_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/Test.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/Test.json deleted file mode 100644 index 2ebc64067..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.example.lifecycletest", - "shell-timeout": "600000" - }, - "kits": [ - { - "test-file-name": [ - "ActsLifecycleMultiHap3Test.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility1/Hap3MainAbility1.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility1/Hap3MainAbility1.ts deleted file mode 100644 index 413d94ef9..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility1/Hap3MainAbility1.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import commonEvent from '@ohos.commonEvent'; -import Ability from '@ohos.application.Ability' - -export default class Hap3MainAbility1 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap3MainAbility1 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] Hap3MainAbility1 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap3MainAbility1 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap3MainAbility1_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap3MainAbility1 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap3MainAbility1 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap3MainAbility1 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility2/Hap3MainAbility2.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility2/Hap3MainAbility2.ts deleted file mode 100644 index 18ccf45c0..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility2/Hap3MainAbility2.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap3MainAbility2 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap3MainAbility2 onCreate") - globalThis.abilityWant = want; - - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap3MainAbility2 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap3MainAbility2 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 2000) - } - - onDestroy() { - console.log("[Demo] Hap3MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap3MainAbility2 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap3MainAbility2_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap3MainAbility2 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap3MainAbility2 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap3MainAbility2 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility3/Hap3MainAbility3.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility3/Hap3MainAbility3.ts deleted file mode 100644 index 427af1aa5..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility3/Hap3MainAbility3.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import commonEvent from '@ohos.commonEvent'; -import Ability from '@ohos.application.Ability' - -export default class Hap3MainAbility3 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap3MainAbility3 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] Hap3MainAbility3 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap3MainAbility3 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap3MainAbility3_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap3MainAbility3 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap3MainAbility3 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap3MainAbility3 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility1_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility1_pages.ets deleted file mode 100644 index 6335bdfef..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility1_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap3MainAbility1_pages { - @State message: string = 'Hap3MainAbility1' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility2_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility2_pages.ets deleted file mode 100644 index d1699b1cf..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility2_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap3MainAbility2_pages { - @State message: string = 'Hap3MainAbility2' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility3_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility3_pages.ets deleted file mode 100644 index 54a73be4b..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility3_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Hap3MainAbility3_pages { - @State message: string = 'Hap3MainAbility3' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/module.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/module.json deleted file mode 100644 index 96baad0c5..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/module.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "module": { - "name": "hap3", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:hap3_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.lifecycletest.Hap3MainAbility1", - "srcEntrance": "./ets/Hap3MainAbility1/Hap3MainAbility1.ts", - "description": "$string:Hap3MainAbility1_desc", - "icon": "$media:icon", - "label": "$string:Hap3MainAbility1_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }, - { - "name": "Hap3MainAbility2", - "srcEntrance": "./ets/Hap3MainAbility2/Hap3MainAbility2.ts", - "description": "$string:Hap3MainAbility2_desc", - "icon": "$media:icon", - "label": "$string:Hap3MainAbility2_label" - }, - { - "name": "Hap3MainAbility3", - "srcEntrance": "./ets/Hap3MainAbility3/Hap3MainAbility3.ts", - "description": "$string:Hap3MainAbility3_desc", - "icon": "$media:icon", - "label": "$string:Hap3MainAbility3_label" - }], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d24c264cf..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsLifecycleMultihapTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "hap3_desc", - "value": "description" - }, - { - "name": "Hap3MainAbility1_desc", - "value": "description" - }, - { - "name": "Hap3MainAbility1_label", - "value": "label" - }, - { - "name": "Hap3MainAbility2_desc", - "value": "description" - }, - { - "name": "Hap3MainAbility2_label", - "value": "label" - }, - { - "name": "Hap3MainAbility3_desc", - "value": "description" - }, - { - "name": "Hap3MainAbility3_label", - "value": "label" - } - ] -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/app.json b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/app.json deleted file mode 100644 index dbcb3167b..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.lifecycletest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/resources/base/element/string.json deleted file mode 100644 index 09872b0a1..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"LifecycleTest" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/BUILD.gn b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/BUILD.gn deleted file mode 100644 index a4b274a9d..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/BUILD.gn +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsLifecycleMultiHapTest") { - hap_profile = "entry/src/main/module.json" - deps = [ - ":actslifecyclemultihaptest_js_assets", - ":actslifecyclemultihaptest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsLifecycleMultiHapTest" -} - -ohos_app_scope("actslifecyclemultihaptest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actslifecyclemultihaptest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actslifecyclemultihaptest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actslifecyclemultihaptest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/Test.json b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/Test.json deleted file mode 100644 index 5da502896..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.example.lifecycletest", - "shell-timeout": "600000" - }, - "kits": [ - { - "test-file-name": [ - "ActsLifecycleMultiHapTest.hap", - "ActsLifecycleMultiHap2Test.hap", - "ActsLifecycleMultiHap3Test.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index d0d4123ab..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - windowStage.setUIContent(this.context, "pages/MainAbility_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts deleted file mode 100644 index 7f6d8d1d4..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility1 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility1 onCreate") - globalThis.abilityWant = want; - - var listKey = []; - var abilityName = ""; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityCreate") - listKey.push(abilityName +" onAbilityCreate"); - console.log("listKey is :" + listKey); - }, - onAbilityWindowStageCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityWindowStageCreate") - listKey.push(abilityName +" onAbilityWindowStageCreate"); - console.log("listKey is :" + listKey); - }, - onAbilityForeground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityForeground") - listKey.push(abilityName +" onAbilityForeground"); - console.log("listKey is :" + listKey); - }, - onAbilityBackground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityBackground") - listKey.push(abilityName +" onAbilityBackground"); - console.log("listKey is :" + listKey); - }, - onAbilityWindowStageDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityWindowStageDestroy") - listKey.push(abilityName +" onAbilityWindowStageDestroy"); - console.log("listKey is :" + listKey); - }, - onAbilityDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityDestroy") - listKey.push(abilityName +" onAbilityDestroy"); - console.log("listKey is :" + listKey); - }, - onAbilityContinue(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityContinue") - listKey.push(abilityName +" onAbilityContinue"); - console.log("listKey is :" + listKey); - } - } - - globalThis.mainAbility1ListKey = listKey - var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); - globalThis.mainAbility1CallBackId = callBackId - setTimeout(() => { - console.log("listKey is :" + listKey); - console.log("callBackId is :" + callBackId); - this.context.getApplicationContext().unregisterAbilityLifecycleCallback (callBackId, (error, data)=> { - console.log("unRegisterAbilityLifecycleCallback err is :" + - JSON.stringify(error) + ",data is : " + JSON.stringify(data)) - }); - }, 4000) - - - setTimeout(()=>{ - this.context.terminateSelf().then((data) => { - console.log("[Demo] MainAbility1 terminateSelf windowStage data: " + JSON.stringify(data)) - }).catch((error) => { - console.log("[Demo] MainAbility1 terminateSelf windowStage error: " + JSON.stringify(error)) - }) - }, 3000) - } - - onDestroy() { - console.log("[Demo] MainAbility1 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility1 onWindowStageCreate") - globalThis.ability2Context = this.context; - windowStage.setUIContent(this.context, "pages/MainAbility1_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility1 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility1 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility1 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index b1b736c35..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility2 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility2 onCreate") - globalThis.abilityWant = want; - - var listKey = []; - var abilityName = ""; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityCreate") - listKey.push(abilityName +" onAbilityCreate"); - console.log("listKey is :" + listKey); - }, - onAbilityWindowStageCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityWindowStageCreate") - listKey.push(abilityName +" onAbilityWindowStageCreate"); - console.log("listKey is :" + listKey); - }, - onAbilityForeground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityForeground") - listKey.push(abilityName +" onAbilityForeground"); - console.log("listKey is :" + listKey); - }, - onAbilityBackground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityBackground") - listKey.push(abilityName +" onAbilityBackground"); - console.log("listKey is :" + listKey); - }, - onAbilityWindowStageDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityWindowStageDestroy") - listKey.push(abilityName +" onAbilityWindowStageDestroy"); - console.log("listKey is :" + listKey); - }, - onAbilityDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityDestroy") - listKey.push(abilityName +" onAbilityDestroy"); - console.log("listKey is :" + listKey); - }, - onAbilityContinue(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityContinue") - listKey.push(abilityName +" onAbilityContinue"); - console.log("listKey is :" + listKey); - } - } - - var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); - - setTimeout(() => { - globalThis.mainAbility2ListKey = listKey - globalThis.mainAbility2CallBackId = callBackId - console.log("listKey is :" + listKey); - console.log("callBackId is :" + callBackId); - }, 3000) - } - - onDestroy() { - console.log("[Demo] MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility2 onWindowStageCreate") - globalThis.ability3Context = this.context; - windowStage.setUIContent(this.context, "pages/MainAbility2_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility2 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility2 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts deleted file mode 100644 index f261521df..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import commonEvent from '@ohos.commonEvent'; -import Ability from '@ohos.application.Ability' - -export default class MainAbility3 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility3 onCreate") - globalThis.abilityWant = want; - - var getauxMainAbilityContext = { - events: ["auxMainAbilityContext"] - } - - - var a; - function SubscribeCallBackContext(err, data) { - console.log(" Subscribe CallBack data:" + JSON.stringify(data)); - a = data.parameters; - if(data.event != ""){ - for (var key in data.parameters){ - console.log("data.parameters[key] is :" + data.parameters[key]) - } - } - } - - commonEvent.createSubscriber(getauxMainAbilityContext).then(async (data) => { - console.debug("====>Create Subscriber====>"); - var Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBackContext); - }); - - var listKey = []; - var abilityName = ""; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityCreate") - listKey.push(abilityName +" onAbilityCreate"); - console.log("listKey is :" + listKey); - }, - onAbilityWindowStageCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityWindowStageCreate") - listKey.push(abilityName +" onAbilityWindowStageCreate"); - console.log("listKey is :" + listKey); - }, - onAbilityForeground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityForeground") - listKey.push(abilityName +" onAbilityForeground"); - console.log("listKey is :" + listKey); - }, - onAbilityBackground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityBackground") - listKey.push(abilityName +" onAbilityBackground"); - console.log("listKey is :" + listKey); - }, - onAbilityWindowStageDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityWindowStageDestroy") - listKey.push(abilityName +" onAbilityWindowStageDestroy"); - console.log("listKey is :" + listKey); - }, - onAbilityDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityDestroy") - listKey.push(abilityName +" onAbilityDestroy"); - console.log("listKey is :" + listKey); - }, - onAbilityContinue(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName +" onAbilityContinue") - listKey.push(abilityName +" onAbilityContinue"); - console.log("listKey is :" + listKey); - } - } - - setTimeout(() => { - console.log("mainAbility3ListKey a is : " + JSON.stringify(a)) - //TODO: - var callBackId = a.auxMainAbilityContext.getApplicationContext(). - registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("mainAbility3ListKey callBackId is : " + callBackId) - globalThis.mainAbility3ListKey = listKey - console.log("mainAbility3ListKey mainAbility3ListKey is : " + globalThis.mainAbility3ListKey) - globalThis.mainAbility3CallBackId = callBackId - console.log("mainAbility3ListKey listKey is :" + listKey); - console.log("mainAbility3ListKey globalThis.callBackId is :" + globalThis.callBackId); - }, 3000) - - } - - onDestroy() { - console.log("[Demo] MainAbility3 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility3 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/MainAbility3_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility3 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility3 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility3 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts deleted file mode 100644 index 1135a535b..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility4 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility4 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility4 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility4 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/MainAbility4_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility4 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility4 onForeground") - - var listKey = []; - var abilityName = ""; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityCreate") - listKey.push(abilityName+" onAbilityCreate"); - }, - onAbilityWindowStageCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityWindowStageCreate") - listKey.push(abilityName+" onAbilityWindowStageCreate"); - }, - onAbilityForeground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityForeground") - listKey.push(abilityName+" onAbilityForeground"); - }, - onAbilityBackground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityBackground") - listKey.push(abilityName+" onAbilityBackground"); - }, - onAbilityWindowStageDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityWindowStageDestroy") - listKey.push(abilityName+" onAbilityWindowStageDestroy"); - }, - onAbilityDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityDestroy") - listKey.push(abilityName+" onAbilityDestroy"); - }, - onAbilityContinue(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityContinue") - listKey.push(abilityName+" onAbilityContinue"); - } - } - var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); - globalThis.abilityContext111 = this.context; - console.log("callBackId is aaa :" + callBackId); - setTimeout(() => { - globalThis.mainAbility4ListKey = listKey - globalThis.mainAbility4CallBackId = callBackId - console.log("listKey is :" + listKey); - console.log("callBackId is :" + callBackId); - }, 3000) - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility4 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts deleted file mode 100644 index b8b0fd6f1..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ability from '@ohos.application.Ability' - -export default class MainAbility5 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility5 onCreate") - globalThis.abilityWant = want; - - var listKey = []; - var abilityName = ""; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityCreate") - listKey.push(abilityName+" onAbilityCreate"); - }, - onAbilityWindowStageCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityWindowStageCreate") - listKey.push(abilityName+" onAbilityWindowStageCreate"); - }, - onAbilityForeground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityForeground") - listKey.push(abilityName+" onAbilityForeground"); - }, - onAbilityBackground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityBackground") - listKey.push(abilityName+" onAbilityBackground"); - }, - onAbilityWindowStageDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityWindowStageDestroy") - listKey.push(abilityName+" onAbilityWindowStageDestroy"); - }, - onAbilityDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityDestroy") - listKey.push(abilityName+" onAbilityDestroy"); - }, - onAbilityContinue(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityContinue") - listKey.push(abilityName+" onAbilityContinue"); - } - } - var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("callBackId is aaa :" + callBackId); - - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap2MainAbility6 EventTest terminateSelf data: " + JSON.stringify(data)); - globalThis.mainAbility5ListKey = listKey - globalThis.mainAbility5CallBackId = callBackId - console.log("listKey is :" + listKey); - console.log("callBackId is :" + callBackId); - }).catch((error) => { - console.log("Hap2MainAbility6 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 1000) - } - - onDestroy() { - console.log("[Demo] MainAbility5 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility5 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/MainAbility5_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility5 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility5 onForeground") - - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility5 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts deleted file mode 100644 index 0c3363ca2..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ability from '@ohos.application.Ability' - -export default class MainAbility6 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility6 onCreate") - globalThis.abilityWant = want; - - var listKey = []; - var abilityName = ""; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityCreate") - listKey.push(abilityName+" onAbilityCreate"); - }, - onAbilityWindowStageCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityWindowStageCreate") - listKey.push(abilityName+" onAbilityWindowStageCreate"); - }, - onAbilityForeground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityForeground") - listKey.push(abilityName+" onAbilityForeground"); - }, - onAbilityBackground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityBackground") - listKey.push(abilityName+" onAbilityBackground"); - }, - onAbilityWindowStageDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityWindowStageDestroy") - listKey.push(abilityName+" onAbilityWindowStageDestroy"); - }, - onAbilityDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityDestroy") - listKey.push(abilityName+" onAbilityDestroy"); - }, - onAbilityContinue(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName+" onAbilityContinue") - listKey.push(abilityName+" onAbilityContinue"); - } - } - var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("callBackId is aaa :" + callBackId); - setTimeout(() => { - globalThis.mainAbility6ListKey = listKey - globalThis.mainAbility6CallBackId = callBackId - console.log("listKey is :" + listKey); - console.log("callBackId is :" + callBackId); - }, 3000) - } - - onDestroy() { - console.log("[Demo] MainAbility6 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility6 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/MainAbility6_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility6 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility6 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility6 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility1_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility1_pages.ets deleted file mode 100644 index 3a8db4687..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility1_pages.ets +++ /dev/null @@ -1,32 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct MainAbility1_pages { - @State message: string = 'MainAbility1' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility2_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility2_pages.ets deleted file mode 100644 index fb9275d61..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility2_pages.ets +++ /dev/null @@ -1,32 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct MainAbility2_pages { - @State message: string = 'MainAbility2' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility3_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility3_pages.ets deleted file mode 100644 index 1a97c7c9a..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility3_pages.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct MainAbility3_pages { - @State message: string = 'MainAbility3_pages' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility4_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility4_pages.ets deleted file mode 100644 index e9515dbae..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility4_pages.ets +++ /dev/null @@ -1,32 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct MainAbility4_pages { - @State message: string = 'MainAbility4' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility5_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility5_pages.ets deleted file mode 100644 index 9a196b1bf..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility5_pages.ets +++ /dev/null @@ -1,32 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct MainAbility5_pages { - @State message: string = 'MainAbility5' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility6_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility6_pages.ets deleted file mode 100644 index dde8ee882..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility6_pages.ets +++ /dev/null @@ -1,32 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct MainAbility6_pages { - @State message: string = 'MainAbility6' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility_pages.ets deleted file mode 100644 index cbc6508ba..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility_pages.ets +++ /dev/null @@ -1,57 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" -import list from '../test/ListTest' - -@Entry -@Component -struct Index { - @State message: string = 'MainAbility' - - aboutToAppear() { - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - globalThis.abilityWant.parameters.timeout = 20000; - - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - configService.setConfig(globalThis.abilityWant.parameters) - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - list(globalThis.abilityContext) - core.execute() - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets deleted file mode 100644 index 7097cd622..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets +++ /dev/null @@ -1,793 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" - -export default function abilityTest(abilityContext){ - - describe('AbilityTest', function() { - - console.info("-----------------LifecycleTest is start----------------") - - var TAG; - var listKeyTemp = []; - var listKeyTemp1 = []; - - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - - /* - * @tc.number Multihap_LifecycleTest_001 - * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B - * @tc.desc Function test - * @tc.level 0 - */ - it("Multihap_LifecycleTest_001", 0, async function (done) { - console.info("---------------Multihap_LifecycleTest_001 is start---------------") - TAG = "Multihap_LifecycleTest_001"; - listKeyTemp = []; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4" - }, (error, data) => { - console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility3" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": Hap2MainAbility3 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) { - if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility3") { - listKeyTemp.push(globalThis.mainAbility4ListKey[i]); - } - } - console.log(TAG + "listKeyTemp is :" + listKeyTemp); - console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId); - expect(listKeyTemp[0]).assertEqual("Hap2MainAbility3 onAbilityCreate"); - expect(listKeyTemp[1]).assertEqual("Hap2MainAbility3 onAbilityWindowStageCreate"); - expect(listKeyTemp[2]).assertEqual("Hap2MainAbility3 onAbilityForeground"); - expect(listKeyTemp[3]).assertEqual("Hap2MainAbility3 onAbilityBackground"); - expect(listKeyTemp[4]).assertEqual("Hap2MainAbility3 onAbilityWindowStageDestroy"); - expect(listKeyTemp[5]).assertEqual("Hap2MainAbility3 onAbilityDestroy"); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 4000) - }); - console.info("---------------Multihap_LifecycleTest_001 is end---------------") - }); - - /* - * @tc.number Multihap_LifecycleTest_002 - * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B (single instance) - * @tc.desc Function test - * @tc.level 0 - */ - it("Multihap_LifecycleTest_002", 0, async function (done) { - console.log("------------Multihap_LifecycleTest_002 start-------------"); - TAG = "Multihap_LifecycleTest_002"; - listKeyTemp = []; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4" - }, (error, data) => { - console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility4" - }, (error, data) => { - console.log(TAG + ":first Hap2MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility4" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": second Hap2MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - for(var i = 0; i { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 3000) - }); - console.log("------------Multihap_LifecycleTest_002 end-------------"); - }); - - /* - * @tc.number Multihap_LifecycleTest_003 - * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B (multiple cases) - * @tc.desc Function test - * @tc.level 0 - */ - it("Multihap_LifecycleTest_003", 0, async function (done) { - console.log("------------Multihap_LifecycleTest_003 start-------------"); - TAG = "Multihap_LifecycleTest_003"; - listKeyTemp = []; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4" - }, (error, data) => { - console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility5" - }, (error, data) => { - console.log(TAG + ":first Hap2MainAbility5 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility5" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": second Hap2MainAbility5 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - for(var i = 0;i { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 3000) - }); - console.log("------------Multihap_LifecycleTest_003 end-------------"); - }); - - /* - * @tc.number Multihap_LifecycleTest_004 - * @tc.name The ability of HAP A monitors the ability life cycle callback of HAP B and HAP C - * @tc.desc Function test - * @tc.level 0 - */ - it("Multihap_LifecycleTest_004", 0, async function (done) { - console.log("------------Multihap_LifecycleTest_004 start-------------"); - TAG = "Multihap_LifecycleTest_004"; - listKeyTemp = []; - listKeyTemp1 = []; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4" - }, (error, data) => { - console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility6" - }, (error, data) => { - console.log(TAG + ":first Hap2MainAbility6 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap3MainAbility2" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": second Hap3MainAbility2 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - for(var i = 0;i { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 3000) - }); - console.log("------------Multihap_LifecycleTest_004 end-------------"); - }); - - /* - * @tc.number Multihap_LifecycleTest_005 - * @tc.name The ability of HAP A listens to two ability life cycle callbacks in HAP B - * @tc.desc Function test - * @tc.level 0 - */ - it("Multihap_LifecycleTest_005", 0, async function (done) { - console.log("------------Multihap_LifecycleTest_005 start-------------"); - TAG = "Multihap_LifecycleTest_005"; - listKeyTemp = []; - listKeyTemp1 = []; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4" - }, (error, data) => { - console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility6" - }, (error, data) => { - console.log(TAG + ":first Hap2MainAbility6 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility7" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": second Hap2MainAbility7 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - for(var i = 0;i { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 3000) - }); - console.log("------------end Multihap_LifecycleTest_005-------------"); - }); - - /* - * @tc.number Multihap_LifecycleTest_006 - * @tc.name Repeat the registration. The ability of HAP A listens to the life - cycle callback of the ability of HAP B - * @tc.desc Function test - * @tc.level 0 - */ - it("Multihap_LifecycleTest_006", 0, async function (done) { - console.log("------------Multihap_LifecycleTest_006 start-------------"); - TAG = "Multihap_LifecycleTest_006"; - listKeyTemp = []; - listKeyTemp1 = []; - var firstCallbackId; - var secondCallbackId; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4" - }, (error, data) => { - console.log(TAG + ": first MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility8" - }, (error, data) => { - setTimeout(function(){ - console.log(TAG + ": first Hap2MainAbility8 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log(TAG + "first globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId); - firstCallbackId = globalThis.mainAbility4CallBackId; - console.log(TAG + "firstCallbackId is : " + firstCallbackId); - }, 3000) - }); - - await sleep(1000); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4" - }, (error, data) => { - console.log(TAG + ": second MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility8" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": second Hap2MainAbility8 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - for(var i = 0;i { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 3000) - }); - - console.log("------------Multihap_LifecycleTest_006 end-------------"); - }); - - /* - * @tc.number Multihap_LifecycleTest_007 - * @tc.name Repeat registration and deregistration. The ability of HAP A listens to the life - cycle callback of the ability of HAP B - * @tc.desc Function test - * @tc.level 0 - */ - it("Multihap_LifecycleTest_007", 0, async function (done) { - console.log("------------Multihap_LifecycleTest_007 start-------------"); - TAG = "Multihap_LifecycleTest_007"; - listKeyTemp = []; - listKeyTemp1 = []; - var callBackId1; - var callBackId2; - var flag; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility6" - }, (error, data) => { - console.log(TAG + ": first MainAbility6 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - setTimeout(function(){ - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility9" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ":first Hap2MainAbility9 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - - for(var i = 0;i { - console.log(TAG + ": first unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - flag = error.code; - console.log(TAG + "flag is:" + flag); - }); - }, 3000) - }); - }, 1000) - - - setTimeout(function(){ - if(flag == 0){ - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility6" - }, (error, data) => { - console.log(TAG + ": first MainAbility6 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - setTimeout(function(){ - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility9" - }, (error, data) => { - - setTimeout(() => { - console.log(TAG + ":second Hap2MainAbility9 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - - for(var i = 0;i { - console.log(TAG + ": second unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 3000) - }) - }, 2000) - } - }, 10000) - - console.log("------------Multihap_LifecycleTest_007 end-------------"); - }); - - /* - * @tc.number Multihap_LifecycleTest_008 - * @tc.name Repeat deregistration. The ability of HAP A listens to the life - cycle callback of the ability of HAP B - * @tc.desc Function test - * @tc.level 0 - */ - it("Multihap_LifecycleTest_008", 0, async function (done) { - console.log("------------Multihap_LifecycleTest_008 start-------------"); - TAG = "Multihap_LifecycleTest_008"; - listKeyTemp = []; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4" - }, (error, data) => { - console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility6" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": Hap2MainAbility6 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - - for(var i = 0;i { - console.log(TAG + ": first unregisterAbilityLifecycleCallback, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue; - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => { - console.log(TAG + ": second unregisterAbilityLifecycleCallback, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue; - done() - }); - }); - }, 4000) - }); - console.log("------------Multihap_LifecycleTest_008 end-------------"); - }); - - /* - * @tc.number Multihap_LifecycleTest_010 - * @tc.name Switch the front and background for many times to monitor the life cycle - * @tc.desc Function test - * @tc.level 0 - */ - it('Multihap_LifecycleTest_010', 0, async function (done) { - console.info("---------------Multihap_LifecycleTest_010 is start---------------") - TAG = "Multihap_LifecycleTest_010"; - listKeyTemp = []; - listKeyTemp1 = []; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility4", - }, (error, data) => { - console.log(TAG + ": MainAbility4 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - }) - - await sleep(1000) - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility10", - }, (error, data) => { - console.log(TAG + ": first Hap2MainAbility10 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - }) - - await sleep(1000) - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap3MainAbility3", - }, (error, data) => { - console.log(TAG + ": first Hap3MainAbility3 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - }) - - await sleep(1000) - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility10", - }, (error, data) => { - console.log(TAG + ": second Hap2MainAbility10 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - }) - - await sleep(1000) - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap3MainAbility3", - }, (error, data) => { - console.log(TAG + ": second Hap3MainAbility3 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - }) - - - await sleep(1000) - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap2MainAbility10", - }, (error, data) => { - console.log(TAG + ": third Hap2MainAbility10 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - }) - - await sleep(1000) - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap3MainAbility3", - }, (error, data) => { - - setTimeout(() => { - console.log(TAG + ": third Hap3MainAbility3 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - - for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) { - if (globalThis.mainAbility4ListKey[i].substring(0, 17) == "Hap2MainAbility10") { - listKeyTemp.push(globalThis.mainAbility4ListKey[i]); - }else if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap3MainAbility3") { - listKeyTemp1.push(globalThis.mainAbility4ListKey[i]); - } - } - console.log(TAG + " listKeyTemp is :" + listKeyTemp); - console.log(TAG + " listKeyTemp1 is :" + listKeyTemp1); - console.log(TAG + " globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId); - - expect(listKeyTemp[0]).assertEqual("Hap2MainAbility10 onAbilityCreate"); - expect(listKeyTemp[1]).assertEqual("Hap2MainAbility10 onAbilityWindowStageCreate"); - expect(listKeyTemp[2]).assertEqual("Hap2MainAbility10 onAbilityForeground"); - expect(listKeyTemp[3]).assertEqual("Hap2MainAbility10 onAbilityBackground"); - expect(listKeyTemp[4]).assertEqual("Hap2MainAbility10 onAbilityForeground"); - expect(listKeyTemp[5]).assertEqual("Hap2MainAbility10 onAbilityBackground"); - expect(listKeyTemp[6]).assertEqual("Hap2MainAbility10 onAbilityForeground"); - expect(listKeyTemp[7]).assertEqual("Hap2MainAbility10 onAbilityBackground"); - - expect(listKeyTemp1[0]).assertEqual("Hap3MainAbility3 onAbilityCreate"); - expect(listKeyTemp1[1]).assertEqual("Hap3MainAbility3 onAbilityWindowStageCreate"); - expect(listKeyTemp1[2]).assertEqual("Hap3MainAbility3 onAbilityForeground"); - expect(listKeyTemp1[3]).assertEqual("Hap3MainAbility3 onAbilityBackground"); - expect(listKeyTemp1[4]).assertEqual("Hap3MainAbility3 onAbilityForeground"); - expect(listKeyTemp1[5]).assertEqual("Hap3MainAbility3 onAbilityBackground"); - expect(listKeyTemp1[6]).assertEqual("Hap3MainAbility3 onAbilityForeground"); - - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 4000) - }) - console.info("---------------Multihap_LifecycleTest_010 is end---------------") - }) - - /* - * @tc.number Multihap_LifecycleTest_011 - * @tc.name The ability of HAP A listens to the life cycle callback - of the ability of HAP B in different processes - * @tc.desc Function test - * @tc.level 0 - */ - it('Multihap_LifecycleTest_011', 0, async function (done) { - console.info("---------------Multihap_LifecycleTest_011 is start---------------") - TAG = "Multihap_LifecycleTest_011"; - listKeyTemp = []; - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "MainAbility2", - }, (error, data) => { - console.log(TAG + ": Hap1MainAbility2 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - }) - - await sleep(500); - - abilityContext.startAbility({ - bundleName: "com.example.lifecycletest", - abilityName: "Hap4MainAbility1", - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": Hap4MainAbility1 startAbility success, err: " + - JSON.stringify(error) + ",data: " + JSON.stringify(data)); - - for (var i = 0; i < globalThis.mainAbility2ListKey.length; i++) { - if (globalThis.mainAbility2ListKey[i].substring(0, 16) == "Hap4MainAbility1") { - listKeyTemp.push(globalThis.mainAbility2ListKey[i]); - } - } - console.log(TAG + " listKeyTemp is :" + listKeyTemp); - console.log(TAG + " globalThis.mainAbility2CallBackId is :" + globalThis.mainAbility2CallBackId); - expect(listKeyTemp.length == 0).assertTrue(); - - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.mainAbility2CallBackId, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - expect(error.code == 0).assertTrue() - done(); - }); - }, 4000) - }); - console.info("---------------Multihap_LifecycleTest_011 is end---------------") - }) - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/test/ListTest.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/test/ListTest.ets deleted file mode 100644 index 73ff567c4..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/test/ListTest.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import lifecycleTest from './LifecycleTest' - -export default function List(context) { - - lifecycleTest(context) - -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/module.json b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/module.json deleted file mode 100644 index a3a8239e3..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/module.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.lifecycletest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }, - { - "name": "MainAbility1", - "srcEntrance": "./ets/MainAbility1/MainAbility1.ts", - "description": "$string:MainAbility1_desc", - "icon": "$media:icon", - "label": "$string:MainAbility1_label" - }, - { - "name": "MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:MainAbility2_desc", - "icon": "$media:icon", - "label": "$string:MainAbility2_label" - }, - { - "name": "MainAbility3", - "srcEntrance": "./ets/MainAbility3/MainAbility3.ts", - "description": "$string:MainAbility3_desc", - "icon": "$media:icon", - "label": "$string:MainAbility3_label" - }, - { - "name": "MainAbility4", - "srcEntrance": "./ets/MainAbility4/MainAbility4.ts", - "description": "$string:MainAbility4_desc", - "icon": "$media:icon", - "label": "$string:MainAbility4_label" - }, - { - "name": "MainAbility5", - "srcEntrance": "./ets/MainAbility5/MainAbility5.ts", - "description": "$string:MainAbility5_desc", - "icon": "$media:icon", - "label": "$string:MainAbility5_label" - }, - { - "name": "MainAbility6", - "srcEntrance": "./ets/MainAbility6/MainAbility6.ts", - "description": "$string:MainAbility6_desc", - "icon": "$media:icon", - "label": "$string:MainAbility6_label", - "launchType": "standard" - }], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 95c6e384d..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsLifecycleMultihapTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "MainAbility1_desc", - "value": "description" - }, - { - "name": "MainAbility1_label", - "value": "label" - }, - { - "name": "MainAbility2_desc", - "value": "description" - }, - { - "name": "MainAbility2_label", - "value": "label" - }, - { - "name": "MainAbility3_desc", - "value": "description" - }, - { - "name": "MainAbility3_label", - "value": "label" - }, - { - "name": "MainAbility4_desc", - "value": "description" - }, - { - "name": "MainAbility4_label", - "value": "label" - }, - { - "name": "MainAbility5_desc", - "value": "description" - }, - { - "name": "MainAbility5_label", - "value": "label" - }, - { - "name": "MainAbility6_desc", - "value": "description" - }, - { - "name": "MainAbility6_label", - "value": "label" - } - ] -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/Hap4MainAbility1/Hap4MainAbility1.ts b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/Hap4MainAbility1/Hap4MainAbility1.ts deleted file mode 100644 index b61df6a98..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/Hap4MainAbility1/Hap4MainAbility1.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Ability from '@ohos.application.Ability' - -export default class Hap4MainAbility1 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap4MainAbility1 onCreate") - globalThis.abilityWant = want; - - setTimeout(()=>{ - this.context.terminateSelf().then((data) => { - console.log("[Demo] Hap4MainAbility1 terminateSelf windowStage data: " + JSON.stringify(data)) - }).catch((error) => { - console.log("[Demo] Hap4MainAbility1 terminateSelf windowStage error: " + JSON.stringify(error)) - }) - }, 2000) - } - - onDestroy() { - console.log("[Demo] Hap4MainAbility1 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap4MainAbility1 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/Hap4MainAbility1_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap4MainAbility1 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap4MainAbility1 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap4MainAbility1 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/pages/Hap4MainAbility1_pages.ets b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/pages/Hap4MainAbility1_pages.ets deleted file mode 100644 index d523a89b7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/pages/Hap4MainAbility1_pages.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hap4MainAbility1' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/module.json b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/module.json deleted file mode 100644 index 60e88e4d4..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/module.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "module": { - "name": "hap4", - "type": "feature", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:hap4_desc", - "mainElement": "Hap4MainAbility1", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "process": "hap4mainability", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.lifecycletest.hap4mainability", - "srcEntrance": "./ets/hap4mainability/hap4mainability.ts", - "description": "$string:Hap4MainAbility1_desc", - "icon": "$media:icon", - "label": "$string:Hap4MainAbility1_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/element/string.json deleted file mode 100644 index 0197573a4..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/element/string.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsLifecycleMultihapTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "hap4_desc", - "value": "description" - }, - { - "name": "Hap4MainAbility1_desc", - "value": "description" - }, - { - "name": "Hap4MainAbility1_label", - "value": "label" - } - ] -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/app.json b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/app.json deleted file mode 100644 index 7ec3b9c30..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.lifecycle_xts", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/resources/base/element/string.json deleted file mode 100644 index 11b4c6b43..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"LifeCycle_XTS" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/BUILD.gn b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/BUILD.gn deleted file mode 100644 index c45f0a26f..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/BUILD.gn +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsLifecycleSingleHapTest") { - hap_profile = "entry/src/main/module.json" - deps = [ - ":actslifecyclesinglehaptest_js_assets", - ":actslifecyclesinglehaptest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsLifecycleSingleHapTest" -} - -ohos_app_scope("actslifecyclesinglehaptest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actslifecyclesinglehaptest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actslifecyclesinglehaptest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actslifecyclesinglehaptest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/Test.json b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/Test.json deleted file mode 100644 index 908e1c8be..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/Test.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "180000", - "package": "com.example.lifecycle_xts", - "shell-timeout": "600000" - }, - "kits": [ - { - "test-file-name": [ - "ActsLifecycleSingleHapTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts deleted file mode 100644 index 3a646a2a0..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap1MainAbility1 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap1MainAbility1 onCreate") - globalThis.abilityWant = want; - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap1MainAbility1 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap1MainAbility1 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 2000) - } - - onDestroy() { - console.log("[Demo] Hap1MainAbility1 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap1MainAbility1 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/indexh1a1", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap1MainAbility1 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap1MainAbility1 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap1MainAbility1 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts deleted file mode 100644 index 2e58304b9..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class Hap1MainAbility2 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] Hap1MainAbility2 onCreate") - globalThis.abilityWant = want; - - setTimeout(() => { - this.context.terminateSelf().then((data) => { - console.log("Hap1MainAbility2 EventTest terminateSelf data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("Hap1MainAbility2 EventTest terminateSelf error: " + JSON.stringify(error)); - }) - }, 2000) - } - - onDestroy() { - console.log("[Demo] Hap1MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] Hap1MainAbility2 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/indexh1a2", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] Hap1MainAbility2 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] Hap1MainAbility2 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] Hap1MainAbility2 onBackground") - } -}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 5986ef5a7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability'; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts deleted file mode 100644 index 3f553e212..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility1 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility1 onCreate") - globalThis.abilityWant = want; - console.log("[Demo] MainAbility1 context: " + JSON.stringify(this.context)); - var listKey1 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback1 onAbilityCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback1 onAbilityCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey1.push(abilityname + " onAbilityCreate"); - console.log("[Demo] 1listKey1:" + JSON.stringify(listKey1)); - }, - onAbilityWindowStageCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback1 onAbilityWindowStageCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback1 onAbilityWindowStageCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey1.push(abilityname + " onAbilityWindowStageCreate"); - console.log("[Demo] 2listKey1:" + JSON.stringify(listKey1)); - }, - onAbilityWindowStageDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback1 onAbilityWindowStageDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback1 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey1.push(abilityname + " onAbilityWindowStageDestroy"); - console.log("[Demo] 3listKey1:" + JSON.stringify(listKey1)); - }, - onAbilityDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback1 onAbilityDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback1 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey1.push(abilityname + " onAbilityDestroy"); - console.log("[Demo] 4listKey1:" + JSON.stringify(listKey1)); - }, - onAbilityForeground(ability) { - console.log("[Demo] AbilityLifecycleCallback1 onAbilityForeground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback1 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey1.push(abilityname + " onAbilityForeground"); - console.log("[Demo] 5listKey1:" + JSON.stringify(listKey1)); - }, - onAbilityBackground(ability) { - console.log("[Demo] AbilityLifecycleCallback1 onAbilityBackground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback1 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey1.push(abilityname + " onAbilityBackground"); - console.log("[Demo] 6listKey1:" + JSON.stringify(listKey1)); - }, - onAbilityContinue(ability) { - console.log("[Demo] AbilityLifecycleCallback1 onAbilityContinue ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback1 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey1.push(abilityname + " onAbilityContinue"); - console.log("[Demo] 7listKey1:" + JSON.stringify(listKey1)); - } - } - let applicationContext = this.context.getApplicationContext(); - console.log("[Demo] MainAbility1 applicationContext: " + JSON.stringify(applicationContext)); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] registerAbilityLifecycleCallback1 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] registerAbilityLifecycleCallback1 listKey: " + JSON.stringify(listKey1)); - globalThis.list1 = listKey1; - globalThis.callbackid1 = lifecycleid; - }, 2500); - } - - onDestroy() { - console.log("[Demo] MainAbility1 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility1 onWindowStageCreate") - globalThis.ability1context = this.context; - windowStage.setUIContent(this.context, "pages/index1", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility1 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility1 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility1 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility10/MainAbility10.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility10/MainAbility10.ts deleted file mode 100644 index 6b74bd333..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility10/MainAbility10.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility10 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility10 onCreate") - globalThis.abilityWant = want; - var listKey10 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback10 onAbilityCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey10.push(abilityname + " onAbilityCreate"); - console.log("[Demo] 1listKey10:" + JSON.stringify(listKey10)); - }, - onAbilityWindowStageCreate(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback10 onAbilityWindowStageCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey10.push(abilityname + " onAbilityWindowStageCreate"); - console.log("[Demo] 2listKey10:" + JSON.stringify(listKey10)); - }, - onAbilityWindowStageDestroy(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback10 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey10.push(abilityname + " onAbilityWindowStageDestroy"); - console.log("[Demo] 3listKey10:" + JSON.stringify(listKey10)); - }, - onAbilityDestroy(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback10 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey10.push(abilityname + " onAbilityDestroy"); - console.log("[Demo] 4listKey10:" + JSON.stringify(listKey10)); - }, - onAbilityForeground(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback10 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey10.push(abilityname + " onAbilityForeground"); - console.log("[Demo] 5listKey10:" + JSON.stringify(listKey10)); - }, - onAbilityBackground(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback10 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey10.push(abilityname + " onAbilityBackground"); - console.log("[Demo] 6listKey10:" + JSON.stringify(listKey10)); - }, - onAbilityContinue(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback10 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey10.push(abilityname + " onAbilityContinue"); - console.log("[Demo] 7listKey10:" + JSON.stringify(listKey10)); - } - } - let applicationContext = this.context.getApplicationContext(); - console.log("[Demo] MainAbility10 applicationContext: " + JSON.stringify(applicationContext)); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] registerAbilityLifecycleCallback10 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] registerAbilityLifecycleCallback10 listKey: " + JSON.stringify(listKey10)); - globalThis.list10 = listKey10; - globalThis.callbackid10 = lifecycleid; - }, 1500); - } - - onDestroy() { - console.log("[Demo] MainAbility10 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility10 onWindowStageCreate") - globalThis.ability10 = this.context; - windowStage.setUIContent(this.context, "pages/index10", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility10 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility10 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility10 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility11/MainAbility11.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility11/MainAbility11.ts deleted file mode 100644 index 4214c6f15..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility11/MainAbility11.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility11 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility11 onCreate") - globalThis.abilityWant = want; - globalThis.ability11 = this.context; - var listKey11 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback11 onAbilityCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey11.push(abilityname + " onAbilityCreate"); - }, - onAbilityWindowStageCreate(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback11 onAbilityWindowStageCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey11.push(abilityname + " onAbilityWindowStageCreate"); - }, - onAbilityWindowStageDestroy(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback11 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey11.push(abilityname + " onAbilityWindowStageDestroy"); - }, - onAbilityDestroy(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback11 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey11.push(abilityname + " onAbilityDestroy"); - }, - onAbilityForeground(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback11 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey11.push(abilityname + " onAbilityForeground"); - }, - onAbilityBackground(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback11 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey11.push(abilityname + " onAbilityBackground"); - }, - onAbilityContinue(ability) { - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback11 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey11.push(abilityname + " onAbilityContinue"); - } - } - let applicationContext = globalThis.ability11.getApplicationContext(); - console.log("[Demo] MainAbility11 applicationContext: " + JSON.stringify(applicationContext)); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] registerAbilityLifecycleCallback11 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] registerAbilityLifecycleCallback11 listKey: " + JSON.stringify(listKey11)); - globalThis.list11 = listKey11; - globalThis.callbackid11 = lifecycleid; - }, 2000); - } - - onDestroy() { - console.log("[Demo] MainAbility11 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility11 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index11", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility11 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility11 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility12/MainAbility12.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility12/MainAbility12.ts deleted file mode 100644 index fef3107e3..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility12/MainAbility12.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility12 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility12 onCreate") - globalThis.abilityWant = want; - var listKey12 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback12 onAbilityCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey12.push(abilityname + " onAbilityCreate"); - }, - onAbilityWindowStageCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback12 onAbilityWindowStageCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey12.push(abilityname + " onAbilityWindowStageCreate"); - }, - onAbilityWindowStageDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback12 onAbilityWindowStageDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey12.push(abilityname + " onAbilityWindowStageDestroy"); - }, - onAbilityDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback12 onAbilityDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey12.push(abilityname + " onAbilityDestroy"); - }, - onAbilityForeground(ability) { - console.log("[Demo] AbilityLifecycleCallback12 onAbilityForeground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey12.push(abilityname + " onAbilityForeground"); - }, - onAbilityBackground(ability) { - console.log("[Demo] AbilityLifecycleCallback12 onAbilityBackground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey12.push(abilityname + " onAbilityBackground"); - }, - onAbilityContinue(ability) { - console.log("[Demo] AbilityLifecycleCallback12 onAbilityContinue ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey12.push(abilityname + " onAbilityContinue"); - } - } - let applicationContext = this.context.getApplicationContext(); - console.log("[Demo] MainAbility12 applicationContext: " + JSON.stringify(applicationContext)); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] registerAbilityLifecycleCallback12 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] registerAbilityLifecycleCallback12 listKey: " + JSON.stringify(listKey12)); - globalThis.list12 = listKey12; - globalThis.callbackid12 = lifecycleid; - }, 1700); - } - - onDestroy() { - console.log("[Demo] MainAbility12 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility12 onWindowStageCreate") - globalThis.ability12 = this.context; - windowStage.setUIContent(this.context, "pages/index12", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility12 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility12 onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility12 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index a4853c8d7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility2 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility2 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility2 onWindowStageCreate") - globalThis.ability2 = this.context; - windowStage.setUIContent(this.context, "pages/index2", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility2 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility2 onForeground") - setTimeout(function () { - globalThis.ability2.terminateSelf() - .then((data) => { - console.info('[Demo] MainAbility2 terminateself succeeded: ' + data); - }).catch((error) => { - console.error('[Demo] MainAbility2 terminateself failed. Cause: ' + error); - }) - }, 500); - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility2 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts deleted file mode 100644 index 24f4ffb25..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility3 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility3 onCreate") - globalThis.abilityWant = want; - - console.log("[Demo] MainAbility3 context: " + JSON.stringify(this.context)); - var listKey3 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback3 onAbilityCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback3 onAbilityCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey3.push(abilityname + " onAbilityCreate"); - console.log("[Demo] 1listKey3:" + JSON.stringify(listKey3)); - }, - onAbilityWindowStageCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback3 onAbilityWindowStageCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback3 onAbilityWindowStageCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey3.push(abilityname + " onAbilityWindowStageCreate"); - console.log("[Demo] 2listKey3:" + JSON.stringify(listKey3)); - }, - onAbilityWindowStageDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback3 onAbilityWindowStageDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback3 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey3.push(abilityname + " onAbilityWindowStageDestroy"); - console.log("[Demo] 3listKey3:" + JSON.stringify(listKey3)); - }, - onAbilityDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback3 onAbilityDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback3 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey3.push(abilityname + " onAbilityDestroy"); - console.log("[Demo] 4listKey3:" + JSON.stringify(listKey3)); - }, - onAbilityForeground(ability) { - console.log("[Demo] AbilityLifecycleCallback3 onAbilityForeground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback3 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey3.push(abilityname + " onAbilityForeground"); - console.log("[Demo] 5listKey3:" + JSON.stringify(listKey3)); - }, - onAbilityBackground(ability) { - console.log("[Demo] AbilityLifecycleCallback3 onAbilityBackground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback3 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey3.push(abilityname + " onAbilityBackground"); - console.log("[Demo] 6listKey3:" + JSON.stringify(listKey3)); - }, - onAbilityContinue(ability) { - console.log("[Demo] AbilityLifecycleCallback3 onAbilityContinue ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback3 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey3.push(abilityname + " onAbilityContinue"); - console.log("[Demo] 7listKey3:" + JSON.stringify(listKey3)); - } - } - let applicationContext = this.context.getApplicationContext(); - console.log("[Demo] MainAbility3 applicationContext: " + JSON.stringify(applicationContext)); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] registerAbilityLifecycleCallback3 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] registerAbilityLifecycleCallback3 listKey : " + JSON.stringify(listKey3)); - globalThis.list3 = listKey3; - globalThis.callbackid3 = lifecycleid; - }, 2000); - } - - onDestroy() { - console.log("[Demo] MainAbility3 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility3 onWindowStageCreate") - globalThis.ability3 = this.context - windowStage.setUIContent(this.context, "pages/index3", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility3 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts deleted file mode 100644 index 44eb81e3a..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility4 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility4 onCreate") - globalThis.abilityWant = want; - - console.log("[Demo] MainAbility4 context: " + JSON.stringify(this.context)); - var listKey4 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback4 onAbilityCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback4 onAbilityCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey4.push(abilityname + " onAbilityCreate"); - console.log("[Demo] 1listKey4:" + JSON.stringify(listKey4)); - }, - onAbilityWindowStageCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback4 onAbilityWindowStageCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback4 onAbilityWindowStageCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey4.push(abilityname + " onAbilityWindowStageCreate"); - console.log("[Demo] 2listKey4:" + JSON.stringify(listKey4)); - }, - onAbilityWindowStageDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback4 onAbilityWindowStageDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback4 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey4.push(abilityname + " onAbilityWindowStageDestroy"); - console.log("[Demo] 3listKey4:" + JSON.stringify(listKey4)); - }, - onAbilityDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback4 onAbilityDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback4 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey4.push(abilityname + " onAbilityDestroy"); - console.log("[Demo] 4listKey4:" + JSON.stringify(listKey4)); - }, - onAbilityForeground(ability) { - console.log("[Demo] AbilityLifecycleCallback4 onAbilityForeground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback4 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey4.push(abilityname + " onAbilityForeground"); - console.log("[Demo] 5listKey4:" + JSON.stringify(listKey4)); - }, - onAbilityBackground(ability) { - console.log("[Demo] AbilityLifecycleCallback4 onAbilityBackground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback4 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey4.push(abilityname + " onAbilityBackground"); - console.log("[Demo] 6listKey4:" + JSON.stringify(listKey4)); - }, - onAbilityContinue(ability) { - console.log("[Demo] AbilityLifecycleCallback4 onAbilityContinue ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback4 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey4.push(abilityname + " onAbilityContinue"); - console.log("[Demo] 7listKey4:" + JSON.stringify(listKey4)); - } - } - let applicationContext = this.context.getApplicationContext(); - console.log("[Demo] MainAbility4 applicationContext: " + JSON.stringify(applicationContext)); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] registerAbilityLifecycleCallback4 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] registerAbilityLifecycleCallback4 listKey : " + JSON.stringify(listKey4)); - globalThis.list4 = listKey4; - globalThis.callbackid4 = lifecycleid; - }, 1500); - } - - onDestroy() { - console.log("[Demo] MainAbility4 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility4 onWindowStageCreate") - globalThis.ability4 = this.context; - windowStage.setUIContent(this.context, "pages/index4", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility4 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility4 onForeground") - setTimeout(function () { - globalThis.ability4.terminateSelf() - .then((data) => { - console.info('[Demo] MainAbility4 terminateself succeeded: ' + data); - }).catch((error) => { - console.error('[Demo] MainAbility4 terminateself failed. Cause: ' + error); - }) - }, 5000); - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility4 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts deleted file mode 100644 index 31f8bd195..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility5 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility5 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility5 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility5 onWindowStageCreate") - globalThis.ability5 = this.context; - windowStage.setUIContent(this.context, "pages/index5", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility5 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility5 onForeground") - setTimeout(function () { - globalThis.ability5.terminateSelf() - .then((data) => { - console.info('[Demo] MainAbility5 terminateself succeeded: ' + data); - }).catch((error) => { - console.error('[Demo] MainAbility5 terminateself failed. Cause: ' + error); - }) - }, 500); - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility5 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts deleted file mode 100644 index 444da364f..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility6 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility6 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility6 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility6 onWindowStageCreate") - globalThis.ability6 = this.context; - windowStage.setUIContent(this.context, "pages/index6", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility6 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility6 onForeground") - - var listKey6 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback6 onAbilityCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback6 onAbilityCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey6.push(abilityname + " onAbilityCreate"); - console.log("[Demo] 1listKey6:" + JSON.stringify(listKey6)); - }, - onAbilityWindowStageCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback6 onAbilityWindowStageCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback6 onAbilityWindowStageCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey6.push(abilityname + " onAbilityWindowStageCreate"); - console.log("[Demo] 2listKey6:" + JSON.stringify(listKey6)); - }, - onAbilityWindowStageDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback6 onAbilityWindowStageDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback6 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey6.push(abilityname + " onAbilityWindowStageDestroy"); - console.log("[Demo] 3listKey6:" + JSON.stringify(listKey6)); - }, - onAbilityDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback6 onAbilityDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback6 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey6.push(abilityname + " onAbilityDestroy"); - console.log("[Demo] 4listKey6:" + JSON.stringify(listKey6)); - }, - onAbilityForeground(ability) { - console.log("[Demo] AbilityLifecycleCallback6 onAbilityForeground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback6 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey6.push(abilityname + " onAbilityForeground"); - console.log("[Demo] 5listKey6:" + JSON.stringify(listKey6)); - }, - onAbilityBackground(ability) { - console.log("[Demo] AbilityLifecycleCallback6 onAbilityBackground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback6 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey6.push(abilityname + " onAbilityBackground"); - console.log("[Demo] 6listKey6:" + JSON.stringify(listKey6)); - }, - onAbilityContinue(ability) { - console.log("[Demo] AbilityLifecycleCallback6 onAbilityContinue ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback6 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey6.push(abilityname + " onAbilityContinue"); - console.log("[Demo] 7listKey6:" + JSON.stringify(listKey6)); - } - } - let applicationContext = globalThis.ability6.getApplicationContext(); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] registerAbilityLifecycleCallback6 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] registerAbilityLifecycleCallback6 listKey: " + JSON.stringify(listKey6)); - globalThis.list6 = listKey6; - globalThis.callbackid6 = lifecycleid; - }, 1500); - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility6 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility7/MainAbility7.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility7/MainAbility7.ts deleted file mode 100644 index 50a57d984..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility7/MainAbility7.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility7 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility7 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility7 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility7 onWindowStageCreate") - globalThis.ability7 = this.context; - windowStage.setUIContent(this.context, "pages/index7", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility7 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility7 onForeground") - - var listKey7 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback7 onAbilityCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback7 onAbilityCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey7.push(abilityname + " onAbilityCreate"); - console.log("[Demo] 1listKey7:" + JSON.stringify(listKey7)); - }, - onAbilityWindowStageCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback7 onAbilityWindowStageCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback7 onAbilityWindowStageCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey7.push(abilityname + " onAbilityWindowStageCreate"); - console.log("[Demo] 2listKey7:" + JSON.stringify(listKey7)); - }, - onAbilityWindowStageDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback7 onAbilityWindowStageDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback7 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey7.push(abilityname + " onAbilityWindowStageDestroy"); - console.log("[Demo] 3listKey7:" + JSON.stringify(listKey7)); - }, - onAbilityDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback7 onAbilityDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback7 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey7.push(abilityname + " onAbilityDestroy"); - console.log("[Demo] 4listKey7:" + JSON.stringify(listKey7)); - }, - onAbilityForeground(ability) { - console.log("[Demo] AbilityLifecycleCallback7 onAbilityForeground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback7 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey7.push(abilityname + " onAbilityForeground"); - console.log("[Demo] 5listKey7:" + JSON.stringify(listKey7)); - }, - onAbilityBackground(ability) { - console.log("[Demo] AbilityLifecycleCallback7 onAbilityBackground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback7 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey7.push(abilityname + " onAbilityBackground"); - console.log("[Demo] 6listKey7:" + JSON.stringify(listKey7)); - }, - onAbilityContinue(ability) { - console.log("[Demo] AbilityLifecycleCallback7 onAbilityContinue ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback7 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey7.push(abilityname + " onAbilityContinue"); - console.log("[Demo] 7listKey7:" + JSON.stringify(listKey7)); - } - } - let applicationContext = this.context.getApplicationContext(); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] AbilityLifecycleCallback7 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] AbilityLifecycleCallback7 listKey: " + JSON.stringify(listKey7)); - globalThis.list7 = listKey7; - globalThis.callbackid7 = lifecycleid; - }, 1500); - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility7 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility8/MainAbility8.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility8/MainAbility8.ts deleted file mode 100644 index 3bd583fa7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility8/MainAbility8.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility8 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility8 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility8 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility8 onWindowStageCreate") - globalThis.ability8 = this.context; - windowStage.setUIContent(this.context, "pages/index8", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility8 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility8 onForeground") - var listKey8 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback8 onAbilityCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback8 onAbilityCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityCreate"); - listKey8.push(abilityname + " onAbilityCreate"); - console.log("[Demo] 1listKey8:" + JSON.stringify(listKey8)); - }, - onAbilityWindowStageCreate(ability) { - console.log("[Demo] AbilityLifecycleCallback8 onAbilityWindowStageCreate ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback8 onAbilityWindowStageCreate abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); - listKey8.push(abilityname + " onAbilityWindowStageCreate"); - console.log("[Demo] 2listKey8:" + JSON.stringify(listKey8)); - }, - onAbilityWindowStageDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback8 onAbilityWindowStageDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback8 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); - listKey8.push(abilityname + " onAbilityWindowStageDestroy"); - console.log("[Demo] 3listKey8:" + JSON.stringify(listKey8)); - }, - onAbilityDestroy(ability) { - console.log("[Demo] AbilityLifecycleCallback8 onAbilityDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback8 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityDestroy"); - listKey8.push(abilityname + " onAbilityDestroy"); - console.log("[Demo] 4listKey8:" + JSON.stringify(listKey8)); - }, - onAbilityForeground(ability) { - console.log("[Demo] AbilityLifecycleCallback8 onAbilityForeground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback8 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityForeground"); - listKey8.push(abilityname + " onAbilityForeground"); - console.log("[Demo] 5listKey8:" + JSON.stringify(listKey8)); - }, - onAbilityBackground(ability) { - console.log("[Demo] AbilityLifecycleCallback8 onAbilityBackground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback8 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityBackground"); - listKey8.push(abilityname + " onAbilityBackground"); - console.log("[Demo] 6listKey8:" + JSON.stringify(listKey8)); - }, - onAbilityContinue(ability) { - console.log("[Demo] AbilityLifecycleCallback8 onAbilityContinue ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log("[Demo] AbilityLifecycleCallback8 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log("[Demo] " + abilityname + " onAbilityContinue"); - listKey8.push(abilityname + " onAbilityContinue"); - console.log("[Demo] 7listKey8:" + JSON.stringify(listKey8)); - } - } - let applicationContext = this.context.getApplicationContext(); - let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log("[Demo] AbilityLifecycleCallback8 number: " + JSON.stringify(lifecycleid)); - setTimeout(function () { - console.log("[Demo] AbilityLifecycleCallback8 listKey: " + JSON.stringify(listKey8)); - globalThis.list8 = listKey8; - globalThis.callbackid8 = lifecycleid; - }, 1500); - - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility8 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility9/MainAbility9.ts b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility9/MainAbility9.ts deleted file mode 100644 index 1d1223b74..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility9/MainAbility9.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility9 extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility9 onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility9 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility9 onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index9", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility9 onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility9 onForeground") - - var listKey9 = []; - var abilityName = ""; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName + " onAbilityCreate") - listKey9.push(abilityName + " onAbilityCreate"); - }, - onAbilityWindowStageCreate(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName + " onAbilityWindowStageCreate") - listKey9.push(abilityName + " onAbilityWindowStageCreate"); - }, - onAbilityForeground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName + " onAbilityForeground") - listKey9.push(abilityName + " onAbilityForeground"); - }, - onAbilityBackground(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName + " onAbilityBackground") - listKey9.push(abilityName + " onAbilityBackground"); - }, - onAbilityWindowStageDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName + " onAbilityWindowStageDestroy") - listKey9.push(abilityName + " onAbilityWindowStageDestroy"); - }, - onAbilityDestroy(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName + " onAbilityDestroy") - listKey9.push(abilityName + " onAbilityDestroy"); - }, - onAbilityContinue(ability) { - abilityName = ability.context.abilityInfo.name; - console.log(abilityName + " onAbilityContinue") - listKey9.push(abilityName + " onAbilityContinue"); - } - } - var callBackId = this.context.getApplicationContext() - .registerAbilityLifecycleCallback(AbilityLifecycleCallback); - - console.log("callBackId is aaa :" + callBackId); - setTimeout(() => { - globalThis.mainAbility9ListKey = listKey9 - globalThis.mainAbility9CallBackId = callBackId - console.log("listKey is :" + listKey9); - console.log("callBackId is :" + callBackId); - }, 3000) - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility9 onBackground") - } -}; diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index.ets deleted file mode 100644 index 6b8308de4..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,55 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file'; -import { Core, ExpectExtend, InstrumentLog, ReportExtend } from "deccjsunit/index" -import List from '../test/ListTest' - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - core.addService('report', reportExtend) - core.init() - globalThis.abilityWant.parameters.timeout = 10000; - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - configService.setConfig(globalThis.abilityWant.parameters); - List(globalThis.abilityContext) - core.execute() - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index1.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index1.ets deleted file mode 100644 index 40c9dff11..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index1.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index1 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability1') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index10.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index10.ets deleted file mode 100644 index db3c738e7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index10.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index10 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability10') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index11.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index11.ets deleted file mode 100644 index 755c6891d..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index11.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index11 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability11') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index12.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index12.ets deleted file mode 100644 index cec620290..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index12.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index12 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability12') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index2.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index2.ets deleted file mode 100644 index a79da622f..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index2.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index2 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability2') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index3.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index3.ets deleted file mode 100644 index 28fada20f..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index3.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index3 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability3') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index4.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index4.ets deleted file mode 100644 index e8504c939..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index4.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index4 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability4') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index5.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index5.ets deleted file mode 100644 index 09efb81e9..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index5.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index5 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability5') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index6.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index6.ets deleted file mode 100644 index 340861777..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index6.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index6 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability6') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index7.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index7.ets deleted file mode 100644 index bb3c50427..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index7.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index7 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability7') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index8.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index8.ets deleted file mode 100644 index 990eeceaa..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index8.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index8 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability8') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index9.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index9.ets deleted file mode 100644 index c2ec1c984..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index9.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct Index9 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Mainability9') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a1.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a1.ets deleted file mode 100644 index bf7d34040..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a1.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct indexh1a1 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Hap1MainAbility1') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a2.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a2.ets deleted file mode 100644 index dc058ea9b..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a2.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Entry -@Component -struct indexh1a2 { - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World Hap1MainAbility2') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets deleted file mode 100644 index f6100edf7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets +++ /dev/null @@ -1,1593 +0,0 @@ -// @ts-nocheck -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" - -export default function lifecycleTest(abilityContext) { - describe('LifeCycleTest', function () { - - beforeEach(async function (done) { - console.info('LifeCycleTest before each called'); - await sleep(1000); - done() - }); - - afterEach(async function (done) { - console.info('LifeCycleTest after each called'); - if ("Singlehap_LifeCycleTest_0200" === TAG || "Singlehap_LifeCycleTest_0300" === TAG - || "Singlehap_LifeCycleTest_0500" === TAG || "Singlehap_LifeCycleTest_0600" === TAG - || "Singlehap_LifeCycleTest_0800" === TAG || "Singlehap_LifeCycleTest_0900" === TAG) { - var para = { - resultCode: 2, - want: { - "abilityName": "MainAbility1", - "bundleName": "com.example.lifecycle_xts" - } - } - console.log("LifeCycleTest terminateSelfwithresult para: " + JSON.stringify(para)); - await globalThis.ability1context.terminateSelfWithResult(para) - .then((data) => { - console.log("LifeCycleTest terminateSelfwithresult successful data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("LifeCycleTest terminateSelfwithresult error: " + JSON.stringify(error)); - }); - } else if ("Singlehap_LifeCycleTest_2000" === TAG) { - var para1 = { - resultCode: 2, - want: { - "abilityName": "MainAbility12", - "bundleName": "com.example.lifecycle_xts" - } - } - console.log("LifeCycleTest terminateSelfwithresult para: " + JSON.stringify(para1)); - await globalThis.ability12.terminateSelfWithResult(para1) - .then((data) => { - console.log("LifeCycleTest terminateSelfwithresult successful data: " + JSON.stringify(data)); - }).catch((error) => { - console.log("LifeCycleTest terminateSelfwithresult error: " + JSON.stringify(error)); - }); - } - done(); - }); - - var TAG = ""; - var listKeyTemp = "" - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - /* - * @tc.number Singlehap_LifeCycleTest_0100 - * @tc.name Register in abilitystage,listen to the lifecycle of abilityA,deregister after listening - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0100", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0100 START-------------"); - TAG = "Singlehap_LifeCycleTest_0100"; - var code; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list)); - console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list.length; i++) { - strtemp = globalThis.list[i].substring(0, 12); - if (strtemp === "MainAbility2") { - listtemp.push(globalThis.list[i]); - } - } - console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); - let exlist = listtemp; - globalThis.abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code = error.code; - }); - setTimeout(function () { - expect(exlist[0]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[1]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(code).assertEqual(0); - console.log("------------Singlehap_LifeCycleTest_0100 END-------------"); - done(); - }, 1000); - }, 3000); - }) - - /* - * @tc.number Singlehap_LifeCycleTest_0200 - * @tc.name Register in abilityA,listen to the lifecycle of abilityB,deregister after listening - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0200", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0200 START-------------"); - TAG = "Singlehap_LifeCycleTest_0200"; - var code; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility1", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); - var list = globalThis.list1 - console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list1.length; i++) { - strtemp = globalThis.list1[i].substring(0, 12); - if (strtemp === "MainAbility1" || strtemp === "MainAbility2") { - listtemp.push(globalThis.list1[i]); - } - } - console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); - let exlist = listtemp; - globalThis.ability1context.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code = error.code; - }) - setTimeout(function () { - expect(exlist[0]).assertEqual("MainAbility1 onAbilityWindowStageCreate"); - expect(exlist[1]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[5]).assertEqual("MainAbility1 onAbilityBackground"); - expect(exlist[6]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(code).assertEqual(0); - console.log("------------Singlehap_LifeCycleTest_0200 END-------------"); - done(); - }, 1000); - }, 3000); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_0300 - * @tc.name Register in abilityA,listening the lifecycle of abilityB,deregister,repeat the unregister - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0300", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0300 START-------------"); - TAG = "Singlehap_LifeCycleTest_0300"; - var code; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility1", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); - console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list1.length; i++) { - strtemp = globalThis.list1[i].substring(0, 12); - if (strtemp === "MainAbility1" || strtemp === "MainAbility2") { - listtemp.push(globalThis.list1[i]); - } - } - console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); - let exlist = listtemp; - globalThis.ability1context.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid1) - .then((data) => { - console.info(TAG + ' unregisterAbilityLifecycleCallback successful. Data: ' + data); - }) - .catch((error) => { - console.error(TAG + ' unregisterAbilityLifecycleCallback failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - console.log(TAG + " secondunregister callbackid : " + JSON.stringify(globalThis.callbackid1)); - globalThis.ability1context.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback_1 success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code = error.code; - }) - }, 500); - setTimeout(function () { - expect(exlist[0]).assertEqual("MainAbility1 onAbilityWindowStageCreate"); - expect(exlist[1]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[5]).assertEqual("MainAbility1 onAbilityBackground"); - expect(exlist[6]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(code).assertEqual(1); - console.log("------------Singlehap_LifeCycleTest_0300 END-------------"); - done(); - }, 2000); - }, 3000); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_0400 - * @tc.name Register in abilityA,listening the lifecycle of abilityB,terminate abilityA,unregister - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0400", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0400 START-------------"); - TAG = "Singlehap_LifeCycleTest_0400"; - var code; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility3", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start3 successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start3 failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start2 successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start2 failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list3)); - console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid3)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list3.length; i++) { - strtemp = globalThis.list3[i].substring(0, 12); - if (strtemp === "MainAbility3" || strtemp === "MainAbility2") { - listtemp.push(globalThis.list3[i]); - } - } - console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); - let exlist = listtemp; - var para = { - resultCode: 1, - want: { - "abilityName": "MainAbility3", - "bundleName": "com.example.lifecycle_xts" - } - } - console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); - globalThis.ability3.terminateSelfWithResult(para) - .then((data) => { - console.log(TAG + " terminateSelfwithresult successful data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); - }); - setTimeout(function () { - globalThis.ability1context.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid3, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback3 success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code = error.code; - }) - }, 500); - setTimeout(function () { - expect(exlist[0]).assertEqual("MainAbility3 onAbilityWindowStageCreate"); - expect(exlist[1]).assertEqual("MainAbility3 onAbilityForeground"); - expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[5]).assertEqual("MainAbility3 onAbilityBackground"); - expect(exlist[6]).assertEqual("MainAbility3 onAbilityForeground"); - expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(code).assertEqual(0); - console.log("------------Singlehap_LifeCycleTest_0400 END-------------"); - done(); - }, 1000); - }, 3000); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_0500 - * @tc.name Register in abilityA and abilityB,unregister MainabilityB,then Register in ManinabilityC - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0500", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0500 START-------------"); - TAG = "Singlehap_LifeCycleTest_0500"; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility1", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start1 successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility3", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start3 successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start3 failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - console.log(TAG + " start after callbackid3 : " + JSON.stringify(globalThis.callbackid3)); - globalThis.abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid3) - .then((data) => { - console.info(TAG + ' unregisterAbilityLifecycleCallback3 successful. Data: ' + data); - }) - .catch((error) => { - console.error(TAG + ' unregisterAbilityLifecycleCallback3 failed. Cause: ' + JSON.stringify(error)); - }); - var str2 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility4", - } - globalThis.abilityContext.startAbility(str2) - .then((data) => { - console.info(TAG + ' start4 successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start4 failed. Cause: ' + JSON.stringify(error)); - }) - }, 2800); - setTimeout(function () { - console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1)); - console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1)); - console.log(TAG + " listKey3 : " + JSON.stringify(globalThis.list3)); - console.log(TAG + " callbackid3 : " + JSON.stringify(globalThis.callbackid3)); - let id3 = globalThis.callbackid3; - console.log(TAG + " listKey4 : " + JSON.stringify(globalThis.list4)); - console.log(TAG + " callbackid4 : " + JSON.stringify(globalThis.callbackid4)); - let id4 = globalThis.callbackid4; - expect(id3 + 1).assertEqual(id4); - globalThis.ability1context.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid4, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback4 success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }) - globalThis.ability1context.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback1 success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_0500 END-------------"); - done(); - }) - }, 4500); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_0600 - * @tc.name Register in abilityA,start abilityB、abilityC,terminate abilityB 、abilityC - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0600", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0600 START-------------"); - TAG = "Singlehap_LifeCycleTest_0600"; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility1", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start1 successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility5", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start5 successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start5 failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - var str2 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str2) - .then((data) => { - console.info(TAG + ' start2 successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start2 failed. Cause: ' + JSON.stringify(error)); - }) - }, 1100); - setTimeout(function () { - console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1)); - console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list1.length; i++) { - strtemp = globalThis.list1[i].substring(0, 12); - if (strtemp == "MainAbility5" || strtemp == "MainAbility2") { - listtemp.push(globalThis.list1[i]); - } - } - console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); - let exlist = listtemp; - expect(exlist[0]).assertEqual("MainAbility5 onAbilityCreate"); - expect(exlist[1]).assertEqual("MainAbility5 onAbilityWindowStageCreate"); - expect(exlist[2]).assertEqual("MainAbility5 onAbilityForeground"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[5]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[6]).assertEqual("MainAbility5 onAbilityBackground"); - expect(exlist[7]).assertEqual("MainAbility5 onAbilityWindowStageDestroy"); - expect(exlist[8]).assertEqual("MainAbility5 onAbilityDestroy"); - expect(exlist[9]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[10]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[11]).assertEqual("MainAbility2 onAbilityDestroy"); - globalThis.ability1context.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_0600 END-------------"); - done(); - }) - }, 4200); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_0700 - * @tc.name Multiple registration/unregistration - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0700", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0700 START-------------"); - TAG = "Singlehap_LifeCycleTest_0700"; - var code1; - var code2; - var code3; - var id1; - var id2; - var id3; - var listKey8 = []; - let AbilityLifecycleCallback = { - onAbilityCreate(ability) { - console.log(TAG + " onAbilityCreate ability:" + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log(TAG + " onAbilityCreate abilityname:" + JSON.stringify(abilityname)); - console.log(TAG + " " + abilityname + " onAbilityCreate"); - listKey8.push(abilityname + " onAbilityCreate"); - }, - onAbilityWindowStageCreate(ability) { - console.log(TAG + " onAbilityWindowStageCreate ability:" + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log(TAG + " onAbilityWindowStageCreate abilityname:" + JSON.stringify(abilityname)); - console.log(TAG + " " + abilityname + " onAbilityWindowStageCreate"); - listKey8.push(abilityname + " onAbilityWindowStageCreate"); - }, - onAbilityWindowStageDestroy(ability) { - console.log(TAG + " AbilityLifecycleCallback1 onAbilityWindowStageDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log(TAG + " AbilityLifecycleCallback1 onAbilityWindowStageDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log(TAG + " " + abilityname + " onAbilityWindowStageDestroy"); - listKey8.push(abilityname + " onAbilityWindowStageDestroy"); - }, - onAbilityDestroy(ability) { - console.log(TAG + " AbilityLifecycleCallback1 onAbilityDestroy ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log(TAG + " AbilityLifecycleCallback1 onAbilityDestroy abilityname:" - + JSON.stringify(abilityname)); - console.log(TAG + " " + abilityname + " onAbilityDestroy"); - listKey8.push(abilityname + " onAbilityDestroy"); - }, - onAbilityForeground(ability) { - console.log(TAG + " AbilityLifecycleCallback1 onAbilityForeground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log(TAG + " AbilityLifecycleCallback1 onAbilityForeground abilityname:" - + JSON.stringify(abilityname)); - console.log(TAG + " " + abilityname + " onAbilityForeground"); - listKey8.push(abilityname + " onAbilityForeground"); - }, - onAbilityBackground(ability) { - console.log(TAG + " AbilityLifecycleCallback1 onAbilityBackground ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log(TAG + " AbilityLifecycleCallback1 onAbilityBackground abilityname:" - + JSON.stringify(abilityname)); - console.log(TAG + " " + abilityname + " onAbilityBackground"); - listKey8.push(abilityname + " onAbilityBackground"); - }, - onAbilityContinue(ability) { - console.log(TAG + " AbilityLifecycleCallback1 onAbilityContinue ability:" - + JSON.stringify(ability)); - let abilityname = ability.context.abilityInfo.name; - console.log(TAG + " AbilityLifecycleCallback1 onAbilityContinue abilityname:" - + JSON.stringify(abilityname)); - console.log(TAG + " " + abilityname + " onAbilityContinue"); - listKey8.push(abilityname + " onAbilityContinue"); - } - } - let applicationContext = globalThis.abilityContext.getApplicationContext(); - id1 = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log(TAG + " registerAbilityLifecycleCallback1 number: " + JSON.stringify(id1)); - applicationContext.unregisterAbilityLifecycleCallback(id1, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback1 success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code1 = error.code; - }) - setTimeout(function () { - id2 = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log(TAG + " registerAbilityLifecycleCallback2 number: " + JSON.stringify(id2)); - applicationContext.unregisterAbilityLifecycleCallback(id2, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback2 success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code2 = error.code; - }) - }, 1000); - setTimeout(function () { - id3 = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); - console.log(TAG + " registerAbilityLifecycleCallback3 number: " + JSON.stringify(id3)); - applicationContext.unregisterAbilityLifecycleCallback(id3, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback3 success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code3 = error.code; - expect(id1 > 0).assertTrue(); - expect(id2).assertEqual(id1 + 1); - expect(id3).assertEqual(id2 + 1); - expect(code1).assertEqual(0); - expect(code2).assertEqual(0); - expect(code3).assertEqual(0); - console.log("------------Singlehap_LifeCycleTest_0700 END-------------"); - done(); - }) - }, 3000); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_0800 - * @tc.name Maninability1 Register listening, Repeat starting and termination Ability2 - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0800", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0800 START-------------"); - TAG = "Singlehap_LifeCycleTest_0800"; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility1", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 3000); - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 4500); - setTimeout(function () { - console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); - console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list1.length; i++) { - strtemp = globalThis.list1[i].substring(0, 12); - if (strtemp === "MainAbility1" || strtemp === "MainAbility2") { - listtemp.push(globalThis.list1[i]); - } - } - console.log(TAG + " listtemp is :" + listtemp); - let exlist = listtemp; - expect(exlist[0]).assertEqual("MainAbility1 onAbilityWindowStageCreate"); - expect(exlist[1]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[5]).assertEqual("MainAbility1 onAbilityBackground"); - expect(exlist[6]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(exlist[10]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[11]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[12]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[13]).assertEqual("MainAbility1 onAbilityBackground"); - expect(exlist[14]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[15]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[16]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[17]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(exlist[18]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[19]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[20]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[21]).assertEqual("MainAbility1 onAbilityBackground"); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_0800 END-------------"); - done(); - }); - }, 4950); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_0900 - * @tc.name Repeat switching Ability1 between front and back - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_0900", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_0900 START-------------"); - TAG = "Singlehap_LifeCycleTest_0900"; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility1", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 2000); - setTimeout(function () { - console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); - console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list1.length; i++) { - strtemp = globalThis.list1[i].substring(0, 12); - if (strtemp === "MainAbility1" || strtemp === "MainAbility2") { - listtemp.push(globalThis.list1[i]); - } - } - console.log(TAG + " listtemp is :" + listtemp); - let exlist = listtemp; - expect(exlist[0]).assertEqual("MainAbility1 onAbilityWindowStageCreate"); - expect(exlist[1]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[5]).assertEqual("MainAbility1 onAbilityBackground"); - expect(exlist[6]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(exlist[10]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[11]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[12]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[13]).assertEqual("MainAbility1 onAbilityBackground"); - expect(exlist[14]).assertEqual("MainAbility1 onAbilityForeground"); - expect(exlist[15]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[16]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[17]).assertEqual("MainAbility2 onAbilityDestroy"); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_0900 END-------------"); - done(); - }); - }, 4000); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_1000 - * @tc.name Register listening in abilityA foreground,repeat the registration - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_1000", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1000 START-------------"); - TAG = "Singlehap_LifeCycleTest_1000"; - var id1; - var id2; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility6", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list6)); - console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid6)); - id1 = globalThis.callbackid6; - console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 2000); - setTimeout(function () { - console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list6)); - console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid6)); - id2 = globalThis.callbackid6; - console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); - expect(id1 + 1).assertEqual(id2); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid6, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_1000 END-------------"); - done(); - }); - }, 4500); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_1100 - * @tc.name Register listening in abilityA foreground,repeat the registration (singleton) - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_1100", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1100 START-------------"); - TAG = "Singlehap_LifeCycleTest_1100"; - var id1; - var id2; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility7", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list7)); - console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid7)); - id1 = globalThis.callbackid7; - console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility7", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 2000); - setTimeout(function () { - console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list7)); - console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid7)); - id2 = globalThis.callbackid7; - console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); - expect(id1).assertEqual(id2); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid7, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - var para = { - resultCode: 1, - want: { - "abilityName": "MainAbility1", - "bundleName": "com.example.lifecycle_xts" - } - } - console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); - globalThis.ability7.terminateSelfWithResult(para, (error, data) => { - console.log(TAG + " terminateSelfwithresult success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_1100 END-------------"); - done(); - }); - }, 4000); - }); - /* - * @tc.number Singlehap_LifeCycleTest_1200 - * @tc.name Register listening in abilityA foreground,repeat the registration (standard) - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_1200", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1200 START-------------"); - TAG = "Singlehap_LifeCycleTest_1200"; - var id1; - var id2; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility8", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list8)); - console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid8)); - id1 = globalThis.callbackid8; - console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility8", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 2000); - setTimeout(function () { - console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list8)); - console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid8)); - id2 = globalThis.callbackid8; - console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); - expect(id1 + 1).assertEqual(id2); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid8, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - var para = { - resultCode: 1, - want: { - "abilityName": "MainAbility8", - "bundleName": "com.example.lifecycle_xts" - } - } - console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); - globalThis.ability8.terminateSelfWithResult(para, (error, data) => { - console.log(TAG + " terminateSelfwithresult success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_1200 END-------------"); - done(); - }); - }, 4000); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_1300 - * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B (singleton) - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_1300", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1300 start-------------"); - TAG = "Singlehap_LifeCycleTest_1300"; - listKeyTemp = []; - abilityContext.startAbility({ - bundleName: "com.example.lifecycle_xts", - abilityName: "MainAbility9" - }, (error, data) => { - console.log(TAG + ": MainAbility9 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - await sleep(500); - abilityContext.startAbility({ - bundleName: "com.example.lifecycle_xts", - abilityName: "Hap1MainAbility1" - }, (error, data) => { - console.log(TAG + ":first Hap1MainAbility1 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - await sleep(500); - abilityContext.startAbility({ - bundleName: "com.example.lifecycle_xts", - abilityName: "Hap1MainAbility1" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": second Hap1MainAbility1 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - for (var i = 0; i < globalThis.mainAbility9ListKey.length; i++) { - if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility1") { - listKeyTemp.push(globalThis.mainAbility9ListKey[i]); - } - } - console.log(TAG + "listKeyTemp is :" + listKeyTemp); - console.log(TAG + "globalThis.mainAbility9CallBackId is :" + globalThis.mainAbility9CallBackId); - expect(listKeyTemp[0]).assertEqual("Hap1MainAbility1 onAbilityCreate"); - expect(listKeyTemp[1]).assertEqual("Hap1MainAbility1 onAbilityWindowStageCreate"); - expect(listKeyTemp[2]).assertEqual("Hap1MainAbility1 onAbilityForeground"); - expect(listKeyTemp[3]).assertEqual("Hap1MainAbility1 onAbilityBackground"); - expect(listKeyTemp[4]).assertEqual("Hap1MainAbility1 onAbilityWindowStageDestroy"); - expect(listKeyTemp[5]).assertEqual("Hap1MainAbility1 onAbilityDestroy"); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.mainAbility9CallBackId, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - done(); - }); - }, 3000) - }); - console.log("------------Singlehap_LifeCycleTest_1300 end-------------"); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_1400 - * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B (standard) - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_1400", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1400 start-------------"); - TAG = "Singlehap_LifeCycleTest_1400"; - listKeyTemp = []; - abilityContext.startAbility({ - bundleName: "com.example.lifecycle_xts", - abilityName: "MainAbility9" - }, (error, data) => { - console.log(TAG + ": MainAbility9 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - await sleep(500); - abilityContext.startAbility({ - bundleName: "com.example.lifecycle_xts", - abilityName: "Hap1MainAbility2" - }, (error, data) => { - console.log(TAG + ":first Hap1MainAbility2 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - await sleep(500); - abilityContext.startAbility({ - bundleName: "com.example.lifecycle_xts", - abilityName: "Hap1MainAbility2" - }, (error, data) => { - setTimeout(() => { - console.log(TAG + ": second Hap1MainAbility2 startAbility success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - for (var i = 0;i < globalThis.mainAbility9ListKey.length; i++) { - if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility2") { - listKeyTemp.push(globalThis.mainAbility9ListKey[i]); - } - } - console.log(TAG + "listKeyTemp is :" + listKeyTemp); - console.log(TAG + "globalThis.mainAbility9CallBackId is :" + globalThis.mainAbility9CallBackId); - expect(listKeyTemp[0]).assertEqual("Hap1MainAbility2 onAbilityCreate"); - expect(listKeyTemp[1]).assertEqual("Hap1MainAbility2 onAbilityWindowStageCreate"); - expect(listKeyTemp[2]).assertEqual("Hap1MainAbility2 onAbilityForeground"); - expect(listKeyTemp[3]).assertEqual("Hap1MainAbility2 onAbilityCreate"); - expect(listKeyTemp[4]).assertEqual("Hap1MainAbility2 onAbilityWindowStageCreate"); - expect(listKeyTemp[5]).assertEqual("Hap1MainAbility2 onAbilityForeground"); - expect(listKeyTemp[6]).assertEqual("Hap1MainAbility2 onAbilityBackground"); - expect(listKeyTemp[7]).assertEqual("Hap1MainAbility2 onAbilityWindowStageDestroy"); - expect(listKeyTemp[8]).assertEqual("Hap1MainAbility2 onAbilityDestroy"); - expect(listKeyTemp[9]).assertEqual("Hap1MainAbility2 onAbilityBackground"); - expect(listKeyTemp[10]).assertEqual("Hap1MainAbility2 onAbilityWindowStageDestroy"); - expect(listKeyTemp[11]).assertEqual("Hap1MainAbility2 onAbilityDestroy"); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.mainAbility9CallBackId, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - done(); - }); - }, 3000) - }); - console.log("------------Singlehap_LifeCycleTest_1400 end-------------"); - }); - /* - * @tc.number Singlehap_LifeCycleTest_1500 - * @tc.name Register in abilityA , starting and termination AbilityB,Repeat previous steps (standard) - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_1500", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1500 START-------------"); - TAG = "Singlehap_LifeCycleTest_1500"; - var id1; - var id2; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility11", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list11)); - console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid11)); - id1 = globalThis.callbackid11; - console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility11", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 1000); - }, 3000); - setTimeout(function () { - console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list11)); - console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid11)); - id2 = globalThis.callbackid11; - console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list11.length; i++) { - strtemp = globalThis.list11[i].substring(0, 12); - if (strtemp == "MainAbility2") { - listtemp.push(globalThis.list11[i]); - } - } - console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); - let exlist = listtemp; - expect(exlist[0]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[1]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(id1 + 1).assertEqual(id2); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid11, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_1500 END-------------"); - done(); - }); - }, 6000); - }); - - var callbackid_NA = 100 - var callbackid_errorNum = -1 - var callbackid_errorType = "test" - /* - * @tc.number Singlehap_LifeCycleTest_1600 - * @tc.name input Nonexistent callbackid for unregisterAbilityLifecycleCallback parameter - * @tc.desc Function test - * @tc.level 1 - */ - it("Singlehap_LifeCycleTest_1600", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1600 START-------------"); - TAG = "Singlehap_LifeCycleTest_1600"; - let code; - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(callbackid_NA, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code = error.code; - sleep(1000); - expect(code).assertEqual(1); - done(); - }); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_1700 - * @tc.name input error callbackid for unregisterAbilityLifecycleCallback parameter - * @tc.desc Function test - * @tc.level 1 - */ - it("Singlehap_LifeCycleTest_1700", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1700 START-------------"); - TAG = "Singlehap_LifeCycleTest_1700"; - let code; - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(callbackid_errorNum, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code = error.code; - sleep(1000); - expect(code).assertEqual(1); - done(); - }); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_1800 - * @tc.name input error type callbackid for unregisterAbilityLifecycleCallback parameter - * @tc.desc Function test - * @tc.level 1 - */ - it("Singlehap_LifeCycleTest_1800", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1800 START-------------"); - TAG = "Singlehap_LifeCycleTest_1800"; - let code; - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(callbackid_errorType, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code = error.code; - sleep(1000); - expect(code).assertEqual(1); - done(); - }); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_1900 - * @tc.name input null callbackid for unregisterAbilityLifecycleCallback parameter - * @tc.desc Function test - * @tc.level 1 - */ - it("Singlehap_LifeCycleTest_1900", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_1900 START-------------"); - TAG = "Singlehap_LifeCycleTest_1900"; - let code; - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(null, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - code = error.code; - sleep(1000); - expect(code).assertEqual(1); - done(); - }); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_2000 - * @tc.name Register in abilityA, starting and termination AbilityB, terminate abilityA, Re-register in abilityA - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_2000", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_2000 START-------------"); - TAG = "Singlehap_LifeCycleTest_2000"; - var id1; - var id2; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility12", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - setTimeout(function () { - console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list12)); - console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid12)); - id1 = globalThis.callbackid12; - console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); - var para = { - resultCode: 2000, - want: { - "abilityName": "MainAbility12", - "bundleName": "com.example.lifecycle_xts" - } - } - console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); - globalThis.ability12.terminateSelfWithResult(para) - .then((data) => { - console.log(TAG + " terminateSelfwithresult successful data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); - }); - }, 2500); - setTimeout(function () { - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility12", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - }, 4000); - setTimeout(function () { - console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list12)); - console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid12)); - id2 = globalThis.callbackid12; - console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < globalThis.list12.length; i++) { - strtemp = globalThis.list12[i].substring(0, 12); - if (strtemp == "MainAbility2") { - listtemp.push(globalThis.list12[i]); - } - } - console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); - let exlist = listtemp; - expect(exlist[0]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[1]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(id1 + 1).assertEqual(id2); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid6, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_2000 END-------------"); - done(); - }); - }, 6200); - }); - - /* - * @tc.number Singlehap_LifeCycleTest_2100 - * @tc.name Register in abilityA,register in abilityB, starting and termination abilityC, - termination abilityB、abilityA, Re-register in abilityA、abilityB - * @tc.desc Function test - * @tc.level 0 - */ - it("Singlehap_LifeCycleTest_2100", 0, async function (done) { - console.log("------------Singlehap_LifeCycleTest_2100 START-------------"); - TAG = "Singlehap_LifeCycleTest_2100"; - var id1; - var id2; - var id3; - var id4; - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility1", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility12", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str2 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str2) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - }, 500); - setTimeout(function () { - console.log(TAG + " firstCallback listKey1 : " + JSON.stringify(globalThis.list1)); - console.log(TAG + " firstCallback callbackid1 : " + JSON.stringify(globalThis.callbackid1)); - console.log(TAG + " firstCallback listKey12 : " + JSON.stringify(globalThis.list12)); - console.log(TAG + " firstCallback callbackid12 : " + JSON.stringify(globalThis.callbackid12)); - id1 = globalThis.callbackid1; - console.log(TAG + " firstCallback id1 : " + JSON.stringify(id1)); - id2 = globalThis.callbackid12; - console.log(TAG + " firstCallback id12 : " + JSON.stringify(id2)); - var para = { - resultCode: 2100, - want: { - "abilityName": "MainAbility12", - "bundleName": "com.example.lifecycle_xts" - } - } - console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); - globalThis.ability12.terminateSelfWithResult(para) - .then((data) => { - console.log(TAG + " terminateSelfwithresult successful data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); - }); - setTimeout(function () { - var para = { - resultCode: 2100, - want: { - "abilityName": "MainAbility1", - "bundleName": "com.example.lifecycle_xts" - } - } - console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); - globalThis.ability1context.terminateSelfWithResult(para) - .then((data) => { - console.log(TAG + " terminateSelfwithresult successful data: " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); - }); - }, 500); - }, 3000); - setTimeout(function () { - var str = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility1", - } - globalThis.abilityContext.startAbility(str) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str1 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility12", - } - globalThis.abilityContext.startAbility(str1) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - setTimeout(function () { - var str2 = { - "bundleName": "com.example.lifecycle_xts", - "abilityName": "MainAbility2", - } - globalThis.abilityContext.startAbility(str2) - .then((data) => { - console.info(TAG + ' start successful. Data: ' + data); - }).catch((error) => { - console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); - }) - }, 500); - }, 500); - }, 4000); - setTimeout(function () { - console.log(TAG + " secondCallback listKey1 : " + JSON.stringify(globalThis.list1)); - let templist1 = globalThis.list1; - console.log(TAG + " secondCallback templist1 : " + JSON.stringify(templist1)); - console.log(TAG + " secondCallback callbackid1 : " + JSON.stringify(globalThis.callbackid1)); - console.log(TAG + " secondCallback listKey12 : " + JSON.stringify(globalThis.list12)); - let templist2 = globalThis.list12; - console.log(TAG + " secondCallback templist2 : " + JSON.stringify(templist2)); - console.log(TAG + " secondCallback callbackid12 : " + JSON.stringify(globalThis.callbackid12)); - id3 = globalThis.callbackid1; - console.log(TAG + " secondCallback id1 : " + JSON.stringify(id3)); - id4 = globalThis.callbackid12; - console.log(TAG + " secondCallback id12 : " + JSON.stringify(id4)); - var strtemp = ""; - var listtemp = []; - for (var i = 0; i < templist1.length; i++) { - strtemp = templist1[i].substring(0, 13); - if (strtemp === "MainAbility2 " || strtemp === "MainAbility12") { - listtemp.push(templist1[i]); - } - } - console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); - setTimeout(function () { - var strtemp1 = ""; - var listtemp1 = []; - for (var j = 0; j < templist2.length; j++) { - strtemp1 = templist2[j].substring(0, 12); - if (strtemp1 === "MainAbility2") { - listtemp1.push(templist2[j]); - } - } - console.log(TAG + " listtemp1 is :" + JSON.stringify(listtemp1)); - let exlist = listtemp; - let exlist1 = listtemp1; - expect(exlist[0]).assertEqual("MainAbility12 onAbilityCreate"); - expect(exlist[1]).assertEqual("MainAbility12 onAbilityWindowStageCreate"); - expect(exlist[2]).assertEqual("MainAbility12 onAbilityForeground"); - expect(exlist[3]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist[5]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist[6]).assertEqual("MainAbility12 onAbilityBackground"); - expect(exlist[7]).assertEqual("MainAbility12 onAbilityForeground"); - expect(exlist[8]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist[9]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist[10]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(exlist1[0]).assertEqual("MainAbility2 onAbilityCreate"); - expect(exlist1[1]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); - expect(exlist1[2]).assertEqual("MainAbility2 onAbilityForeground"); - expect(exlist1[3]).assertEqual("MainAbility2 onAbilityBackground"); - expect(exlist1[4]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); - expect(exlist1[5]).assertEqual("MainAbility2 onAbilityDestroy"); - expect(id1 + 1).assertEqual(id2); - expect(id3 + 1).assertEqual(id4); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid12, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - }); - abilityContext.getApplicationContext() - .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { - console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + - ",data: " + JSON.stringify(data)); - console.log("------------Singlehap_LifeCycleTest_2100 END-------------"); - done(); - }); - }, 100); - }, 7000); - }); - }) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/ListTest.ets b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/ListTest.ets deleted file mode 100644 index 646c67030..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/ListTest.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import LifeCycleTest from './LifeCycleTest' - -export default function List(context) { - LifeCycleTest(context) -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/module.json b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/module.json deleted file mode 100644 index dc2ba99f8..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/module.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.lifecycle_xts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }, - { - "name": "MainAbility1", - "srcEntrance": "./ets/MainAbility1/MainAbility1.ts", - "description": "$string:MainAbility1_desc", - "icon": "$media:icon", - "label": "$string:MainAbility1_label" - }, - { - "name": "MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:MainAbility2_desc", - "icon": "$media:icon", - "label": "$string:MainAbility2_label" - }, - { - "name": "MainAbility3", - "srcEntrance": "./ets/MainAbility3/MainAbility3.ts", - "description": "$string:MainAbility3_desc", - "icon": "$media:icon", - "label": "$string:MainAbility3_label" - }, - { - "name": "MainAbility4", - "srcEntrance": "./ets/MainAbility4/MainAbility4.ts", - "description": "$string:MainAbility4_desc", - "icon": "$media:icon", - "label": "$string:MainAbility4_label" - }, - { - "name": "MainAbility5", - "srcEntrance": "./ets/MainAbility5/MainAbility5.ts", - "description": "$string:MainAbility5_desc", - "icon": "$media:icon", - "label": "$string:MainAbility5_label" - }, - { - "name": "MainAbility6", - "srcEntrance": "./ets/MainAbility6/MainAbility6.ts", - "description": "$string:MainAbility6_desc", - "icon": "$media:icon", - "label": "$string:MainAbility6_label" - }, - { - "name": "MainAbility7", - "srcEntrance": "./ets/MainAbility7/MainAbility7.ts", - "description": "$string:MainAbility7_desc", - "launchType": "singleton", - "icon": "$media:icon", - "label": "$string:MainAbility7_label" - }, - { - "name": "MainAbility8", - "srcEntrance": "./ets/MainAbility8/MainAbility8.ts", - "description": "$string:MainAbility8_desc", - "launchType": "standard", - "icon": "$media:icon", - "label": "$string:MainAbility8_label" - }, - { - "name": "MainAbility9", - "srcEntrance": "./ets/MainAbility9/MainAbility9.ts", - "description": "$string:MainAbility9_desc", - "icon": "$media:icon", - "label": "$string:MainAbility9_label" - }, - { - "name": "Hap1MainAbility1", - "srcEntrance": "./ets/Hap1MainAbility1/Hap1MainAbility1.ts", - "description": "$string:Hap1MainAbility1_desc", - "icon": "$media:icon", - "label": "$string:Hap1MainAbility1_label", - "launchType": "singleton" - }, - { - "name": "Hap1MainAbility2", - "srcEntrance": "./ets/Hap1MainAbility2/Hap1MainAbility2.ts", - "description": "$string:Hap1MainAbility2_desc", - "icon": "$media:icon", - "label": "$string:Hap1MainAbility2_label", - "launchType": "standard" - }, - { - "name": "MainAbility10", - "srcEntrance": "./ets/MainAbility10/MainAbility10.ts", - "description": "$string:MainAbility10_desc", - "icon": "$media:icon", - "label": "$string:MainAbility10_label" - }, - { - "name": "MainAbility11", - "srcEntrance": "./ets/MainAbility11/MainAbility11.ts", - "description": "$string:MainAbility11_desc", - "icon": "$media:icon", - "label": "$string:MainAbility11_label", - "launchType": "standard" - }, - { - "name": "MainAbility12", - "srcEntrance": "./ets/MainAbility12/MainAbility12.ts", - "description": "$string:MainAbility12_desc", - "icon": "$media:icon", - "label": "$string:MainAbility12_label" - }] - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e078d4fa7..000000000 --- a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "MainAbility1_desc", - "value": "description" - }, - { - "name": "MainAbility1_label", - "value": "label" - }, - { - "name": "MainAbility2_desc", - "value": "description" - }, - { - "name": "MainAbility2_label", - "value": "label" - }, - { - "name": "MainAbility3_desc", - "value": "description" - }, - { - "name": "MainAbility3_label", - "value": "label" - }, - { - "name": "MainAbility4_desc", - "value": "description" - }, - { - "name": "MainAbility4_label", - "value": "label" - }, - { - "name": "MainAbility5_desc", - "value": "description" - }, - { - "name": "MainAbility5_label", - "value": "label" - }, - { - "name": "MainAbility6_desc", - "value": "description" - }, - { - "name": "MainAbility6_label", - "value": "label" - }, - { - "name": "MainAbility7_desc", - "value": "description" - }, - { - "name": "MainAbility7_label", - "value": "label" - }, - { - "name": "MainAbility8_desc", - "value": "description" - }, - { - "name": "MainAbility8_label", - "value": "label" - }, - { - "name": "MainAbility9_desc", - "value": "description" - }, - { - "name": "MainAbility9_label", - "value": "label" - }, - { - "name": "Hap1MainAbility1_desc", - "value": "description" - }, - { - "name": "Hap1MainAbility1_label", - "value": "label" - }, - { - "name": "Hap1MainAbility2_desc", - "value": "description" - }, - { - "name": "Hap1MainAbility2_label", - "value": "label" - }, - { - "name": "MainAbility10_desc", - "value": "description" - }, - { - "name": "MainAbility10_label", - "value": "label" - }, - { - "name": "MainAbility11_desc", - "value": "description" - }, - { - "name": "MainAbility11_label", - "value": "label" - }, - { - "name": "MainAbility12_desc", - "value": "description" - }, - { - "name": "MainAbility12_label", - "value": "label" - }, - { - "name": "MainAbility13_desc", - "value": "description" - }, - { - "name": "MainAbility13_label", - "value": "label" - } - ] -} diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/app.js deleted file mode 100644 index 2ba842eda..000000000 --- a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index d405647b9..000000000 --- a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/List.test.js deleted file mode 100644 index cd9d94dce..000000000 --- a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -require('./ActsGetWantAllTest.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/app.js b/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/app.js deleted file mode 100644 index 2ba842eda..000000000 --- a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/element/string.json deleted file mode 100644 index d405647b9..000000000 --- a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts deleted file mode 100755 index 9c6b544fc..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export default interface IInterfaceDeclare { - testInterface(data: number, callback: testInterfaceCallback): void; -} -export type testInterfaceCallback = (errCode: number) => void; - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts deleted file mode 100755 index fadb691de..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareProxy implements IInterfaceDeclare { - constructor(proxy) { - this.proxy = proxy; - } - - testInterface(data: number, callback: testInterfaceCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(data); - this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - static readonly COMMAND_TEST_INTERFACE = 1; - private proxy -} - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts deleted file mode 100755 index fa6208b1f..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { - let _data = data.readInt(); - this.testInterface(_data, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - testInterface(data: number, callback: testInterfaceCallback): void{} - - static readonly COMMAND_TEST_INTERFACE = 1; -} - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts deleted file mode 100755 index 0030fa8fe..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default class MySequenceable { - constructor() { - this.num = 14; - this.str = "hello"; - } - getNum() : number { - return this.num; - } - - getString() : string { - return this.str; - } - - marshalling(messageParcel) { - console.info('marshalling++++'); - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - return true; - } - unmarshalling(messageParcel) { - console.info('unmarshalling++++'); - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - return true; - } - private num; - private str; -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts deleted file mode 100755 index 943d83dc8..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export default interface IInterfaceAttributeDeclaratoinOneway { - voidVoidFirst(callback: voidVoidFirstCallback): void; - voidVoidSecond(callback: voidVoidSecondCallback): void; - voidVoidThird(callback: voidVoidThirdCallback): void; -} -export type voidVoidFirstCallback = (errCode: number) => void; -export type voidVoidSecondCallback = (errCode: number) => void; -export type voidVoidThirdCallback = (errCode: number) => void; - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts deleted file mode 100755 index a2b75c5f4..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {voidVoidFirstCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidSecondCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidThirdCallback} from "./i_interface_attribute_declaratoin_oneway"; -import IInterfaceAttributeDeclaratoinOneway from "./i_interface_attribute_declaratoin_oneway"; -import rpc from "@ohos.rpc"; - -export default class InterfaceAttributeDeclaratoinOnewayStub extends rpc.RemoteObject implements IInterfaceAttributeDeclaratoinOneway { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_FIRST: { - this.voidVoidFirst((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_SECOND: { - this.voidVoidSecond((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_THIRD: { - this.voidVoidThird((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - voidVoidFirst(callback: voidVoidFirstCallback): void{} - voidVoidSecond(callback: voidVoidSecondCallback): void{} - voidVoidThird(callback: voidVoidThirdCallback): void{} - - static readonly COMMAND_VOID_VOID_FIRST = 1; - static readonly COMMAND_VOID_VOID_SECOND = 2; - static readonly COMMAND_VOID_VOID_THIRD = 3; -} - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts deleted file mode 100755 index 9c6b544fc..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export default interface IInterfaceDeclare { - testInterface(data: number, callback: testInterfaceCallback): void; -} -export type testInterfaceCallback = (errCode: number) => void; - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts deleted file mode 100755 index fadb691de..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareProxy implements IInterfaceDeclare { - constructor(proxy) { - this.proxy = proxy; - } - - testInterface(data: number, callback: testInterfaceCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(data); - this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - static readonly COMMAND_TEST_INTERFACE = 1; - private proxy -} - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts deleted file mode 100755 index fa6208b1f..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { - let _data = data.readInt(); - this.testInterface(_data, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - testInterface(data: number, callback: testInterfaceCallback): void{} - - static readonly COMMAND_TEST_INTERFACE = 1; -} - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts deleted file mode 100755 index 7cd93c0ec..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default class MySequenceable { - constructor() { - this.num = 32; - this.str = "nihao"; - } - getNum() : number { - return this.num; - } - - getString() : string { - return this.str; - } - - marshalling(messageParcel) { - console.info('marshalling++++'); - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - return true; - } - unmarshalling(messageParcel) { - console.info('unmarshalling++++'); - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - return true; - } - private num; - private str; -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts deleted file mode 100755 index 943d83dc8..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export default interface IInterfaceAttributeDeclaratoinOneway { - voidVoidFirst(callback: voidVoidFirstCallback): void; - voidVoidSecond(callback: voidVoidSecondCallback): void; - voidVoidThird(callback: voidVoidThirdCallback): void; -} -export type voidVoidFirstCallback = (errCode: number) => void; -export type voidVoidSecondCallback = (errCode: number) => void; -export type voidVoidThirdCallback = (errCode: number) => void; - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/app.json b/aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/app.json deleted file mode 100755 index 6fb3b0011..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.zidlservice", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon" : "$media:icon", - "label" : "$string:app_name", - "description" : "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive" : true, - "singleUser": true, - "minAPIVersion": 8, - "targetAPIVersion": 8, - "car": { - "apiCompatibleVersion": 8, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json b/aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json deleted file mode 100755 index 0d3507c0d..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/Test.json b/aafwk/aafwk_standard/zidltest/actsamszidlservice/Test.json deleted file mode 100755 index 3ec911dfc..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 159f48742..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 7bbcfae15..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageDestroy") - } - - async onForeground() { - // Ability has brought to foreground - console.log("ACTS_ProcessManage VendorAppService MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("ACTS_ProcessManage VendorAppService MainAbility onBackground") - } -}; diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts deleted file mode 100755 index 9c6b544fc..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export default interface IInterfaceDeclare { - testInterface(data: number, callback: testInterfaceCallback): void; -} -export type testInterfaceCallback = (errCode: number) => void; - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts deleted file mode 100755 index fadb691de..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareProxy implements IInterfaceDeclare { - constructor(proxy) { - this.proxy = proxy; - } - - testInterface(data: number, callback: testInterfaceCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(data); - this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - static readonly COMMAND_TEST_INTERFACE = 1; - private proxy -} - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts deleted file mode 100755 index fa6208b1f..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { - let _data = data.readInt(); - this.testInterface(_data, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - testInterface(data: number, callback: testInterfaceCallback): void{} - - static readonly COMMAND_TEST_INTERFACE = 1; -} - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts deleted file mode 100755 index 0030fa8fe..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default class MySequenceable { - constructor() { - this.num = 14; - this.str = "hello"; - } - getNum() : number { - return this.num; - } - - getString() : string { - return this.str; - } - - marshalling(messageParcel) { - console.info('marshalling++++'); - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - return true; - } - unmarshalling(messageParcel) { - console.info('unmarshalling++++'); - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - return true; - } - private num; - private str; -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts deleted file mode 100755 index 943d83dc8..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export default interface IInterfaceAttributeDeclaratoinOneway { - voidVoidFirst(callback: voidVoidFirstCallback): void; - voidVoidSecond(callback: voidVoidSecondCallback): void; - voidVoidThird(callback: voidVoidThirdCallback): void; -} -export type voidVoidFirstCallback = (errCode: number) => void; -export type voidVoidSecondCallback = (errCode: number) => void; -export type voidVoidThirdCallback = (errCode: number) => void; - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts deleted file mode 100755 index a2b75c5f4..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {voidVoidFirstCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidSecondCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidThirdCallback} from "./i_interface_attribute_declaratoin_oneway"; -import IInterfaceAttributeDeclaratoinOneway from "./i_interface_attribute_declaratoin_oneway"; -import rpc from "@ohos.rpc"; - -export default class InterfaceAttributeDeclaratoinOnewayStub extends rpc.RemoteObject implements IInterfaceAttributeDeclaratoinOneway { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_FIRST: { - this.voidVoidFirst((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_SECOND: { - this.voidVoidSecond((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_THIRD: { - this.voidVoidThird((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - voidVoidFirst(callback: voidVoidFirstCallback): void{} - voidVoidSecond(callback: voidVoidSecondCallback): void{} - voidVoidThird(callback: voidVoidThirdCallback): void{} - - static readonly COMMAND_VOID_VOID_FIRST = 1; - static readonly COMMAND_VOID_VOID_SECOND = 2; - static readonly COMMAND_VOID_VOID_THIRD = 3; -} - diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/module.json b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/module.json deleted file mode 100755 index 40f140623..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/module.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.zidlservice.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.zidlservice.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.zidlservice.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 376647878..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsContextTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - } - ] -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json b/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100755 index 96b478210..000000000 --- a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/ability/BUILD.gn b/ability/BUILD.gn new file mode 100644 index 000000000..5a4809d95 --- /dev/null +++ b/ability/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos_var.gni") + +group("ability") { + testonly = true + if (is_standard_system) { + deps = [ "ability_runtime:ability_runtime" ] + } +} diff --git a/ability/ability_runtime/BUILD.gn b/ability/ability_runtime/BUILD.gn new file mode 100644 index 000000000..eb85bc744 --- /dev/null +++ b/ability/ability_runtime/BUILD.gn @@ -0,0 +1,48 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos_var.gni") + +group("ability_runtime") { + testonly = true + if (is_standard_system) { + deps = [ + "abilitymanager:actsabilitymanagertest", + "abilitymultiinstance:abilitymultiinstance", + "actsabilitydelegatorcase:ActsAbilityDelegatorCaseTest", + "actsabilitylifecyclestatenew:ActsAbilityLifecycleStateNewTest", + "actsabilitymanageretstest:ActsAbilityManagerEtsTest", + "actscalltest:actscalltest", + "actsfwkdataaccessortest:dataability", + "actsserviceabilityclienttest:serviceability", + "actsstartcomponenttest:actsstartcomponenttest", + "actsstserviceabilityclientcase:ActsStServiceAbilityClientCaseTest", + "actsusers:actsusers", + "amscontextualinforquery:amscontextualinforquery", + "amsdatauriutils:ActsAmsDataUriUtilsTest", + "amsdisplayIdtest:amsdisplayIdtest", + "amsgetabilityprocessinfo:amsgetabilityprocessinfo", + "context:context", + "fa:fa", + "featureability:featureability", + "formmanager:formmanager", + "killprocesswithaccountstage:killprocesswithaccountstage", + "newwant:newwant", + "non_concurrent:non_concurrent", + "processmultiinstance:processmultiinstance", + "stage:stage", + "want:want", + #"zidltest:zidltest", + ] + } +} diff --git a/aafwk/aafwk_standard/abilitymanager/BUILD.gn b/ability/ability_runtime/abilitymanager/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/BUILD.gn rename to ability/ability_runtime/abilitymanager/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/Test.json b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/config.json new file mode 100644 index 000000000..7df3196c8 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/config.json @@ -0,0 +1,83 @@ +{ + "app": { + "bundleName": "com.example.actsamscallbackfifthscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamscallbackfifthscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.actsamscallbackfifthscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/app.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..27b7481c8 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +let abilityNameList = [ + "com.ohos.launcher.MainAbility", + "com.ohos.callui.ServiceAbility", + "com.example.SimulateFeatureAbilityFir", + "com.example.VerifyIoThirdAbility", + "com.example.SimulateFeatureAbilitySed", + "com.example.actsamscallbackfifthscene.MainAbility" +] + +let bundleNameList = [ + "com.ohos.launcher", + "com.ohos.systemui", + "com.ohos.callui", + "com.ohos.contacts", + "com.ohos.mms", + "com.ohos.telephonydataability", + "com.ohos.contactsdataability", + "com.ix.simulate.feature", + "com.ix.verify.io", + "com.example.actsamscallbackfifthscene" +] + +describe('ActsAmsCallBackFifthScene', function () { + console.info('----ActsAmsCallBackFifthScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackFifthScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.io", + abilityName: "com.example.VerifyIoThirdAbility", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackFifthScene VerifyIoThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilitySed", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackFifthScene SimulateFeatureAbilitySed start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + setTimeout(done, 5000); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_6600 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by CallBack) + */ + it('Acts_Ams_test_6600', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + appManager.getProcessRunningInfos( + (error, info) => { + console.info('Acts_Ams_test_6600 getProcessRunningInfos error.code \ + ' + error.code + ', data length [' + info.length + ']'); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (let i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_6600 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + } + ); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/Test.json b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/config.json new file mode 100644 index 000000000..7cf34a5c9 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/config.json @@ -0,0 +1,87 @@ +{ + "app": { + "bundleName": "com.example.actsamscallbackfirstscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamscallbackfirstscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.actsamscallbackfirstscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/app.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..bfc3c92aa --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit' + +describe('ActsAmsCallBackFirstScene', function () { + console.info('----ActsAmsCallBackFirstScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackFirstScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + var start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_0200 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by CallBack) + */ + it('Acts_Ams_test_0200', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + appManager.getProcessRunningInfos( + (error, info) => { + console.info('Acts_Ams_test_0200 getProcessRunningInfos error.code \ + ' + error.code + ', data length [' + info.length + ']'); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (var i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_0200 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/Test.json b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/config.json new file mode 100644 index 000000000..b9d712493 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/config.json @@ -0,0 +1,87 @@ +{ + "app": { + "bundleName": "com.example.actsamscallbackfourthscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamscallbackfourthscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.actsamscallbackfourthscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/app.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..0adfdff8c --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ActsAmsCallBackFourthScene', function () { + console.info('----ActsAmsCallBackFourthScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.io", + abilityName: "com.example.VerifyIoThirdAbility", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackFourthScene VerifyIoThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackFourthScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.act", + abilityName: "com.example.VerifyActThirdAbility", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackFourthScene VerifyActThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.entry", + abilityName: "com.example.SimulateEntryAbilityFir", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackFourthScene SimulateEntryAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_5000 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by CallBack) + */ + it('Acts_Ams_test_5000', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + appManager.getProcessRunningInfos( + (error, info) => { + console.info('Acts_Ams_test_5000 getProcessRunningInfos error.code \ + ' + error.code + ', data length [' + info.length + ']'); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (let i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_5000 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/Test.json b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/Test.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/config.json rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/app.js rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..97db2e348 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit' + +describe('ActsAmsCallBackSecondScene', function () { + console.info('----ActsAmsCallBackSecondScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.io", + abilityName: "com.example.VerifyIoThirdAbility", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackSecondScene VerifyIoThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackSecondScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_1800 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by CallBack) + */ + it('Acts_Ams_test_1800', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + appManager.getProcessRunningInfos( + (error, info) => { + console.info('Acts_Ams_test_1800 getProcessRunningInfos error.code \ + ' + error.code + ', data length [' + info.length + ']'); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (let i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_1800 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/Test.json b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/config.json new file mode 100644 index 000000000..e1ae6f5d9 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/config.json @@ -0,0 +1,87 @@ +{ + "app": { + "bundleName": "com.example.actsamscallbackthirdscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamscallbackthirdscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.actsamscallbackthirdscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..fe25d2e6d --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ActsAmsCallBackThirdScene', function () { + console.info('----ActsAmsCallBackThirdScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackThirdScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.io", + abilityName: "com.example.VerifyIoThirdAbility", + action: "action1", + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsCallBackThirdScene VerifyIoThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_3400 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by CallBack) + */ + it('Acts_Ams_test_3400', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + appManager.getProcessRunningInfos( + (error, info) => { + console.info('Acts_Ams_test_3400 getProcessRunningInfos error.code \ + ' + error.code + ', data length [' + info.length + ']'); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (let i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_3400 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamstestfifthscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/Test.json b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamstestfifthscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/config.json new file mode 100644 index 000000000..cba2279ac --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/config.json @@ -0,0 +1,87 @@ +{ + "app": { + "bundleName": "com.example.actsamstestfifthscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamstestfifthscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.actsamstestfifthscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..fd889cd01 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +let abilityNameList = [ + "com.ohos.launcher.MainAbility", + "com.ohos.callui.ServiceAbility", + "com.example.SimulateFeatureAbilityFir", + "com.example.SimulateFeatureAbilitySed", + "com.example.VerifyIoThirdAbility", + "com.example.actsamstestfifthscene.MainAbility" +] + +let bundleNameList = [ + "com.ohos.launcher", + "com.ohos.systemui", + "com.ohos.callui", + "com.ohos.contacts", + "com.ohos.mms", + "com.ohos.telephonydataability", + "com.ohos.contactsdataability", + "com.ix.simulate.feature", + "com.ix.verify.io", + "com.example.actsamstestfifthscene" +] + +describe('ActsAmsTestFifthScene', function () { + console.info('----ActsAmsTestFifthScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestFifthScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.io", + abilityName: "com.example.VerifyIoThirdAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestFifthScene VerifyIoThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilitySed", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestFifthScene SimulateFeatureAbilitySed start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_0100 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by Promise) + */ + it('Acts_Ams_test_0100', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + let info = await appManager.getProcessRunningInfos(); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (let i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_0100 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamstestfifthscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamstestfirstscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/Test.json b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamstestfirstscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/config.json new file mode 100644 index 000000000..0aa9487ed --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/config.json @@ -0,0 +1,96 @@ +{ + "app": { + "bundleName": "com.example.actsamstestfirstscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamstestfirstscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": "com.example.actsamstestfirstscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..5df9e464e --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ActsAmsTestFirstScene', function () { + console.info('----ActsAmsTestFirstScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestFirstScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + var start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_0100 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by Promise) + */ + it('Acts_Ams_test_0100', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + var info = await appManager.getProcessRunningInfos(); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (var i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_0100 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamstestfirstscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamstestfourthscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/Test.json b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamstestfourthscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/config.json new file mode 100644 index 000000000..b0f032e0f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/config.json @@ -0,0 +1,87 @@ +{ + "app": { + "bundleName": "com.example.actsamstestfourthscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamstestfourthscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.actsamstestfourthscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..009209ae9 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ActsAmsTestFourthScene', function () { + console.info('----ActsAmsTestFourthScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.io", + abilityName: "com.example.VerifyIoThirdAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestFourthScene VerifyIoThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestFourthScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.act", + abilityName: "com.example.VerifyActThirdAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestFourthScene VerifyActThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.entry", + abilityName: "com.example.SimulateEntryAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestFourthScene SimulateEntryAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + var start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_1700 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by Promise) + */ + it('Acts_Ams_test_1700', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + var info = await appManager.getProcessRunningInfos(); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (var i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_1700 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamstestfourthscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamstestsecondscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/Test.json b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamstestsecondscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/config.json new file mode 100644 index 000000000..70128f8ab --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/config.json @@ -0,0 +1,87 @@ +{ + "app": { + "bundleName": "com.example.actsamstestsecondscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamstestsecondscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.actsamstestsecondscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..e90d26e44 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ActsAmsTestSecondScene', function () { + console.info('----ActsAmsTestSecondScene----'); + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.io", + abilityName: "com.example.VerifyIoThirdAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestSecondScene VerifyIoThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestSecondScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + var start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_1700 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by Promise) + */ + it('Acts_Ams_test_1700', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + var info = await appManager.getProcessRunningInfos(); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (var i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_1700 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamstestsecondscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/BUILD.gn b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/BUILD.gn rename to ability/ability_runtime/abilitymanager/actsamstestthirdscene/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/Test.json b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/Test.json rename to ability/ability_runtime/abilitymanager/actsamstestthirdscene/Test.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/config.json new file mode 100644 index 000000000..404bffd0f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/config.json @@ -0,0 +1,87 @@ +{ + "app": { + "bundleName": "com.example.actsamstestthirdscene", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actsamstestthirdscene", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.actsamstestthirdscene.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "isVisible": "true", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/List.test.js b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/List.test.js diff --git a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js new file mode 100644 index 000000000..570a85fe0 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import appManager from "@ohos.application.appManager" +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' + +describe('ActsAmsTestThirdScene', function () { + console.info('----ActsAmsTestThirdScene----'); + + beforeAll(async function (done) { + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.simulate.feature", + abilityName: "com.example.SimulateFeatureAbilityFir", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestThirdScene SimulateFeatureAbilityFir start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + + await featureAbility.startAbility( + { + want: + { + deviceId: "", + bundleName: "com.ix.verify.io", + abilityName: "com.example.VerifyIoThirdAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + options: + {}, + parameters: + {}, + }, + }, (error, data) => { + console.info('ActsAmsTestThirdScene VerifyIoThirdAbility start, error.code \ + ' + error.code + ', data length [' + data.length + ']'); + } + ); + done(); + }); + + function timeout(done) { + expect().assertFail(); + console.debug('Acts_Ams_test=========timeout========'); + done(); + } + + function sleep(delay) { + var start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } + } + + /* + * @tc.number : Acts_Ams_test_3300 + * @tc.name : getProcessRunningInfos : Get All Running Processes Info + * @tc.desc : Get All Running Processes Info(by Promise) + */ + it('Acts_Ams_test_3300', 0, async function (done) { + console.info("sleep begin"); + sleep(5000); + console.info("sleep end"); + var info = await appManager.getProcessRunningInfos(); + console.info('Acts_Ams_test_3300 getProcessRunningInfos JSON String: ' + JSON.stringify(info)); + expect(Array.isArray(info)).assertEqual(true); + expect(info.length).assertLarger(0); + for (var i = 0; i < info.length; i++) { + console.info('Acts_Ams_test_3300 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i])); + expect(typeof (info[i].pid)).assertEqual("number"); + expect(info[i].pid).assertLarger(0); + + expect(typeof (info[i].processName)).assertEqual("string"); + expect(info[i].processName.length).assertLarger(0); + expect(Array.isArray(info[i].bundleNames)).assertEqual(true); + expect(info[i].bundleNames.length).assertEqual(0); + + expect(typeof (info[i].uid)).assertEqual("number"); + expect(info[i].uid).assertLarger(0); + } + done(); + }) +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/actsamstestthirdscene/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/BUILD.gn b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/BUILD.gn rename to ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/Test.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/Test.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/Test.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/config.json new file mode 100644 index 000000000..de20a4362 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/config.json @@ -0,0 +1,74 @@ +{ + "app": { + "bundleName": "com.ix.simulate.entry", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.simulateeability", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "simulateEAbility", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.SimulateEntryAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/BUILD.gn b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/BUILD.gn rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/Test.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/Test.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/Test.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json new file mode 100644 index 000000000..b5b8e428c --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json @@ -0,0 +1,74 @@ +{ + "app": { + "bundleName": "com.ix.simulate.feature", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.simulatefabilityfir", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "simulateFAbilityFir", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.SimulateFeatureAbilityFir", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/BUILD.gn b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/BUILD.gn rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/Test.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/Test.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/Test.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json new file mode 100644 index 000000000..52cca5948 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json @@ -0,0 +1,74 @@ +{ + "app": { + "bundleName": "com.ix.simulate.feature", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.simulatefabilitysed", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "simulateFAbilitySed", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.SimulateFeatureAbilitySed", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/BUILD.gn b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/BUILD.gn rename to ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/Test.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/Test.json rename to ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/Test.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/config.json new file mode 100644 index 000000000..367fbe56f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/config.json @@ -0,0 +1,74 @@ +{ + "app": { + "bundleName": "com.ix.verify.act", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.verifyaability", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "verifyAAbility", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.VerifyActThirdAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/BUILD.gn b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/BUILD.gn rename to ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/Test.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/Test.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/Test.json rename to ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/Test.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/config.json new file mode 100644 index 000000000..82b334065 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/config.json @@ -0,0 +1,74 @@ +{ + "app": { + "bundleName": "com.ix.verify.io", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.verifyiability", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "verifyIAbility", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "visible": true, + "name": "com.example.VerifyIoThirdAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "singleton" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/app.js b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymultiinstance/BUILD.gn b/ability/ability_runtime/abilitymultiinstance/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/BUILD.gn rename to ability/ability_runtime/abilitymultiinstance/BUILD.gn diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/app.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/app.json new file mode 100644 index 000000000..6eeb40898 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.amsabilitymultiinstanceappa", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/BUILD.gn b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/BUILD.gn rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/BUILD.gn diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/Test.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/Test.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/Test.json diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..2bd862c50 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +const ONACCEPTWANT_KEY_NOTSET_ID = -1; +const ONACCEPTWANT_KEY_UNDEFINED_ID = -2; +var onAcceptWantCalledSeq; + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("AbilityMultiInstanceAppA MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } + + onAcceptWant(want) { + console.log("AbilityMultiInstanceAppA onAcceptWant called want:" + JSON.stringify(want)); + if ((want.parameters == undefined) || (want.parameters.startId == undefined)) { + console.log("AbilityMultiInstanceAppA specified param err"); + return; + } + + var abilityId = want.parameters.startId.toString(); + onAcceptWantCalledSeq = "onAcceptWantCalled"; + onAcceptWantCalledSeq += "Id"; + onAcceptWantCalledSeq += abilityId; + globalThis.onAcceptWantCalledSeq = onAcceptWantCalledSeq; + + if (want.parameters.startId == ONACCEPTWANT_KEY_NOTSET_ID) { + return; + } else if (want.parameters.startId == ONACCEPTWANT_KEY_UNDEFINED_ID) { + return undefined; + } + + globalThis.abilityWant = want; + console.log("AbilityMultiInstanceAppA set globalThis result :" + globalThis.onAcceptWantCalledSeq); + return abilityId; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..6b6bf1feb --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +var callBackSeq = ""; + +function publishCallBack() { + console.debug("====>Publish CallBack ====>"); +} + +async function startAbilityProcess(abilityContext, parameters) { + let bundleName = "com.example.amsabilitymultiinstanceappa"; + let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; + + let idx = parameters.nextStep; + switch (parameters.step[idx]) { + case "StartA1": + parameters.startId = 1; + break; + case "StartA2": + parameters.startId = 2; + break; + case "StartB": + bundleName = "com.example.amsabilitymultiinstanceappb"; + abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; + break; + case "StartC": + bundleName = "com.example.amsabilitymultiinstanceappc"; + abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; + break; + case "StartDMain1": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 1; + break; + case "StartDMain2": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 2; + break; + case "StartDSec": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; + break; + case "StartDThd": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; + break; + case "StartE": + bundleName = "com.example.amsabilitymultiinstanceappe"; + abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; + break; + + default: + break; + } + parameters.nextStep = ++idx; + abilityContext.startAbility({ + bundleName: bundleName, + abilityName: abilityName, + parameters: parameters + }, (error, data) => { + console.log('AppA startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) +} + +async function onShowProcess() { + var abilityWant = globalThis.abilityWant; + var callBackData = "AppA:" + callBackSeq += globalThis.onAcceptWantCalledSeq; + callBackData += callBackSeq; + + var commonEventPublishData = { + data: callBackData, + parameters: abilityWant.parameters + }; + + console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify(abilityWant)); + if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { + commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); + callBackSeq = ""; + globalThis.onAcceptWantCalledSeq = ""; + } else { + commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { + callBackSeq = ""; + globalThis.onAcceptWantCalledSeq = ""; + startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); + }); + } +} + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("AbilityMultiInstanceAppA onCreate") + callBackSeq += "onCreate"; + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("AbilityMultiInstanceAppA onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("AbilityMultiInstanceAppA onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("AbilityMultiInstanceAppA onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("AbilityMultiInstanceAppA onForeground") + callBackSeq += "onForeground"; + onShowProcess(); + } + + onBackground() { + // Ability has back to background + console.log("AbilityMultiInstanceAppA onBackground") + } +}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json new file mode 100644 index 000000000..2eb330f80 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json @@ -0,0 +1,80 @@ +{ + "module": { + "name": "com.example.amsabilitymultiinstanceappa", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.amsabilitymultiinstanceappa.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "launchType": "specified", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappa/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/app.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/app.json new file mode 100644 index 000000000..3b4690d4e --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.amsabilitymultiinstanceappb", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/BUILD.gn b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/BUILD.gn rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/Test.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/Test.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/Test.json diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..08dee1230 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..ddc665609 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +var callBackSeq = ""; + +function publishCallBack() { + console.debug("====>AbilityMultiInstanceAppB Publish CallBack ====>"); +} + +async function startAbilityProcess(abilityContext, parameters) { + let bundleName = "com.example.amsabilitymultiinstanceappa"; + let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; + + let idx = parameters.nextStep; + switch (parameters.step[idx]) { + case "StartA1": + parameters.startId = 1; + break; + case "StartA2": + parameters.startId = 2; + break; + case "StartB": + bundleName = "com.example.amsabilitymultiinstanceappb"; + abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; + break; + case "StartC": + bundleName = "com.example.amsabilitymultiinstanceappc"; + abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; + break; + case "StartDMain1": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 1; + break; + case "StartDMain2": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 2; + break; + case "StartDSec": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; + break; + case "StartDThd": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; + break; + case "StartE": + bundleName = "com.example.amsabilitymultiinstanceappe"; + abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; + break; + + default: + break; + } + parameters.nextStep = ++idx; + abilityContext.startAbility({ + bundleName: bundleName, + abilityName: abilityName, + parameters: parameters + }, (error, data) => { + console.log('AppB startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) +} + +async function onShowProcess() { + var abilityWant = globalThis.abilityWant; + var callBackData = "AppB:" + callBackData += callBackSeq; + + var commonEventPublishData = { + data: callBackData, + parameters: abilityWant.parameters + }; + console.log("AbilityMultiInstanceAppB onShowProcess") + if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { + commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); + callBackSeq = ""; + } else { + commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { + callBackSeq = ""; + startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); + }); + } +} + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("AbilityMultiInstanceAppB MainAbility onCreate") + callBackSeq += "onCreate"; + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("AbilityMultiInstanceAppB MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("AbilityMultiInstanceAppB MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("AbilityMultiInstanceAppB MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("AbilityMultiInstanceAppB MainAbility onForeground") + callBackSeq += "onForeground"; + onShowProcess(); + } + + onBackground() { + // Ability has back to background + console.log("AbilityMultiInstanceAppB MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json new file mode 100644 index 000000000..59947d2cd --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json @@ -0,0 +1,80 @@ +{ + "module": { + "name": "com.example.amsabilitymultiinstanceappb", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.amsabilitymultiinstanceappb.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "launchType": "standard", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappb/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/app.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/app.json new file mode 100644 index 000000000..4a929dae8 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.amsabilitymultiinstanceappc", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/BUILD.gn b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/BUILD.gn rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/Test.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/Test.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/Test.json diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..08dee1230 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..7df7ebd16 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +var callBackSeq = ""; + +function publishCallBack() { + console.debug("====>AbilityMultiInstanceAppC Publish CallBack ====>"); +} + +async function onShowProcess() { + var abilityWant = globalThis.abilityWant; + var callBackData = "AppC:"; + callBackData += callBackSeq; + var commonEventPublishData = { + data: callBackData, + parameters: abilityWant.parameters + }; + console.log("AbilityMultiInstanceAppC onShowProcess") + if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { + commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); + } else { + commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { + startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); + }); + } + callBackSeq = ""; +} + +async function startAbilityProcess(abilityContext, parameters) { + let bundleName = "com.example.amsabilitymultiinstanceappa"; + let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; + + let idx = parameters.nextStep; + switch (parameters.step[idx]) { + case "StartA1": + parameters.startId = 1; + break; + case "StartA2": + parameters.startId = 2; + break; + case "StartB": + bundleName = "com.example.amsabilitymultiinstanceappb"; + abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; + break; + case "StartC": + bundleName = "com.example.amsabilitymultiinstanceappc"; + abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; + break; + case "StartDMain1": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 1; + break; + case "StartDMain2": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 2; + break; + case "StartDSec": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; + break; + case "StartDThd": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; + break; + case "StartE": + bundleName = "com.example.amsabilitymultiinstanceappe"; + abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; + break; + + default: + break; + } + parameters.nextStep = ++idx; + abilityContext.startAbility({ + bundleName: bundleName, + abilityName: abilityName, + parameters: parameters + }, (error, data) => { + console.log('AppC startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) +} + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + callBackSeq += "onCreate"; + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + callBackSeq += "onForeground"; + onShowProcess(); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json new file mode 100644 index 000000000..cc9c505c9 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json @@ -0,0 +1,80 @@ +{ + "module": { + "name": "com.example.amsabilitymultiinstanceappc", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.amsabilitymultiinstanceappc.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "launchType": "singleton", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappc/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/app.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/app.json new file mode 100644 index 000000000..44433c774 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.amsabilitymultiinstanceappd", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/BUILD.gn b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/BUILD.gn rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/Test.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/Test.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/Test.json diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..c7e4a876d --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +var onAcceptWantCalledSeq; + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("AbilityMultiInstanceAppD MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } + + onAcceptWant(want) { + console.log("AbilityMultiInstanceAppD onAcceptWant called want:" + JSON.stringify(want)); + var abilityId = want.parameters.startId.toString(); + onAcceptWantCalledSeq = "onAcceptWantCalled"; + onAcceptWantCalledSeq += "Id"; + onAcceptWantCalledSeq += abilityId; + globalThis.onAcceptWantCalledSeq = onAcceptWantCalledSeq; + globalThis.abilityWant = want; + console.log("AbilityMultiInstanceAppD set globalThis result :" + globalThis.onAcceptWantCalledSeq); + return abilityId; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..f95a89421 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +var callBackSeq = ""; +function publishCallBack() { + console.debug("====>AbilityMultiInstanceAppD Publish CallBack ====>"); +} +async function onShowProcess() { + var abilityWant = globalThis.abilityWant; + var callBackData = "AppD:"; + callBackSeq += globalThis.onAcceptWantCalledSeq; + callBackData += callBackSeq; + var commonEventPublishData = { + data: callBackData, + parameters: abilityWant.parameters + }; + + console.log("AbilityMultiInstanceAppD abilityWant = " + JSON.stringify(abilityWant)); + if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { + commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); + } else { + commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { + startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); + }); + } + globalThis.onAcceptWantCalledSeq = ""; + callBackSeq = ""; +} + +async function startAbilityProcess(abilityContext, parameters) { + let bundleName = "com.example.amsabilitymultiinstanceappa"; + let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; + + let idx = parameters.nextStep; + switch (parameters.step[idx]) { + case "StartA1": + parameters.startId = 1; + break; + case "StartA2": + parameters.startId = 2; + break; + case "StartB": + bundleName = "com.example.amsabilitymultiinstanceappb"; + abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; + break; + case "StartC": + bundleName = "com.example.amsabilitymultiinstanceappc"; + abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; + break; + case "StartDMain1": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 1; + break; + case "StartDMain2": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 2; + break; + case "StartDSec": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; + break; + case "StartDThd": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; + break; + case "StartE": + bundleName = "com.example.amsabilitymultiinstanceappe"; + abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; + break; + + default: + break; + } + parameters.nextStep = ++idx; + abilityContext.startAbility({ + bundleName: bundleName, + abilityName: abilityName, + parameters: parameters + }, (error, data) => { + console.log('AppD startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) +} + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("AbilityMultiInstanceAppD onCreate") + callBackSeq += "onCreate"; + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("AbilityMultiInstanceAppD onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("AbilityMultiInstanceAppD onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("AbilityMultiInstanceAppD onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("AbilityMultiInstanceAppD onForeground") + callBackSeq += "onForeground"; + onShowProcess(); + } + + onBackground() { + // Ability has back to background + console.log("AbilityMultiInstanceAppD onBackground") + } +}; diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/SecondAbility/SecondAbility.ts new file mode 100644 index 000000000..297ab5482 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/SecondAbility/SecondAbility.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +var callBackSeq = ""; +function publishCallBack() { + console.debug("====>AbilityMultiInstanceAppD Sec Publish CallBack ====>"); +} +async function onShowProcess() { + var abilityWant = globalThis.abilityWant; + var callBackData = "AppD:"; + callBackSeq += globalThis.onAcceptWantCalledSeq; + callBackData += callBackSeq; + var commonEventPublishData = { + data: callBackData, + parameters: abilityWant.parameters + }; + + console.log("AbilityMultiInstanceAppD Sec abilityWant = " + JSON.stringify(abilityWant)); + if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { + commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); + } else { + commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { + startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); + }); + } + globalThis.onAcceptWantCalledSeq = ""; + callBackSeq = ""; +} + +async function startAbilityProcess(abilityContext, parameters) { + let bundleName = "com.example.amsabilitymultiinstanceappa"; + let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; + + let idx = parameters.nextStep; + switch (parameters.step[idx]) { + case "StartA1": + parameters.startId = 1; + break; + case "StartA2": + parameters.startId = 2; + break; + case "StartB": + bundleName = "com.example.amsabilitymultiinstanceappb"; + abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; + break; + case "StartC": + bundleName = "com.example.amsabilitymultiinstanceappc"; + abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; + break; + case "StartDMain1": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 1; + break; + case "StartDMain2": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 2; + break; + case "StartDSec": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; + break; + case "StartDThd": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; + break; + case "StartE": + bundleName = "com.example.amsabilitymultiinstanceappe"; + abilityName = "com.example.amsabilitymultiinstanceappe.MainAbility"; + break; + + default: + break; + } + parameters.nextStep = ++idx; + abilityContext.startAbility({ + bundleName: bundleName, + abilityName: abilityName, + parameters: parameters + }, (error, data) => { + console.log('AppD startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) +} + +export default class SecondAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("AbilityMultiInstanceAppD Sec onCreate") + callBackSeq += "onCreate"; + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("AbilityMultiInstanceAppD Sec onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("AbilityMultiInstanceAppD Sec onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("AbilityMultiInstanceAppD Sec onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("AbilityMultiInstanceAppD Sec onForeground") + callBackSeq += "onForeground"; + onShowProcess(); + } + + onBackground() { + // Ability has back to background + console.log("AbilityMultiInstanceAppD Sec onBackground") + } +}; diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/ThirdAbility/ThirdAbility.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/ThirdAbility/ThirdAbility.ts new file mode 100644 index 000000000..2b5c594f7 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/ThirdAbility/ThirdAbility.ts @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +var callBackSeq = ""; +function publishCallBack() { + console.debug("====>AbilityMultiInstanceAppD Third Publish CallBack ====>"); +} +async function onShowProcess() { + var abilityWant = globalThis.abilityWant; + var callBackData = "AppD:"; + callBackSeq += globalThis.onAcceptWantCalledSeq; + callBackData += callBackSeq; + var commonEventPublishData = { + data: callBackData, + parameters: abilityWant.parameters + }; + + console.log("AbilityMultiInstanceAppD Third abilityWant = " + JSON.stringify(abilityWant)); + if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { + commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, publishCallBack); + } else { + commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { + startAbilityProcess(globalThis.abilityContext, abilityWant.parameters); + }); + } + globalThis.onAcceptWantCalledSeq = ""; + callBackSeq = ""; +} + +async function startAbilityProcess(abilityContext, parameters) { + let bundleName = "com.example.amsabilitymultiinstanceappa"; + let abilityName = "com.example.amsabilitymultiinstanceappa.MainAbility"; + + let idx = parameters.nextStep; + switch (parameters.step[idx]) { + case "StartA1": + parameters.startId = 1; + break; + case "StartA2": + parameters.startId = 2; + break; + case "StartB": + bundleName = "com.example.amsabilitymultiinstanceappb"; + abilityName = "com.example.amsabilitymultiinstanceappb.MainAbility"; + break; + case "StartC": + bundleName = "com.example.amsabilitymultiinstanceappc"; + abilityName = "com.example.amsabilitymultiinstanceappc.MainAbility"; + break; + case "StartDMain1": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 1; + break; + case "StartDMain2": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.MainAbility"; + parameters.startId = 2; + break; + case "StartDSec": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.SecondAbility"; + break; + case "StartDThd": + bundleName = "com.example.amsabilitymultiinstanceappd"; + abilityName = "com.example.amsabilitymultiinstanceappd.ThirdAbility"; + break; + + default: + break; + } + parameters.nextStep = ++idx; + abilityContext.startAbility({ + bundleName: bundleName, + abilityName: abilityName, + parameters: parameters + }, (error, data) => { + console.log('AppD startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) +} + +export default class ThirdAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("AbilityMultiInstanceAppD Third onCreate") + callBackSeq += "onCreate"; + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("AbilityMultiInstanceAppD Third onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("AbilityMultiInstanceAppD Third onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("AbilityMultiInstanceAppD Third onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("AbilityMultiInstanceAppD Third onForeground") + callBackSeq += "onForeground"; + onShowProcess(); + } + + onBackground() { + // Ability has back to background + console.log("AbilityMultiInstanceAppD Third onBackground") + } +}; diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json new file mode 100644 index 000000000..14d28d9b4 --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json @@ -0,0 +1,120 @@ +{ + "module": { + "name": "com.example.amsabilitymultiinstanceappd", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.amsabilitymultiinstanceappd.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "launchType": "specified", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + }, + { + "name": "com.example.amsabilitymultiinstanceappd.SecondAbility", + "srcEntrance": "./ets/SecondAbility/SecondAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "launchType": "standard", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + }, + { + "name": "com.example.amsabilitymultiinstanceappd.ThirdAbility", + "srcEntrance": "./ets/ThirdAbility/ThirdAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "launchType": "singleton", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappd/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/BUILD.gn b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/BUILD.gn rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/app.js b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/app.js old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/app.js rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/en-US.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/zh-CN.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.css b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.css old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.hml old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/app.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/app.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/app.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/BUILD.gn b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/BUILD.gn rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/BUILD.gn diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/Test.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/Test.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/Test.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/List.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/BUILD.gn b/ability/ability_runtime/actsabilitydelegatorcase/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/BUILD.gn rename to ability/ability_runtime/actsabilitydelegatorcase/BUILD.gn diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/Test.json b/ability/ability_runtime/actsabilitydelegatorcase/Test.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/Test.json rename to ability/ability_runtime/actsabilitydelegatorcase/Test.json diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/config.json b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/config.json rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/app.js b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/app.js rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/test/ActsAbilityDelegatorCaseTest.test.js b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/test/ActsAbilityDelegatorCaseTest.test.js similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/test/ActsAbilityDelegatorCaseTest.test.js rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/test/ActsAbilityDelegatorCaseTest.test.js diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/test/List.test.js b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/actsabilitydelegatorcase/signature/openharmony_sx.p7b b/ability/ability_runtime/actsabilitydelegatorcase/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsabilitydelegatorcase/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsabilitydelegatorcase/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/BUILD.gn b/ability/ability_runtime/actsabilitylifecyclestatenew/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/BUILD.gn rename to ability/ability_runtime/actsabilitylifecyclestatenew/BUILD.gn diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/Test.json b/ability/ability_runtime/actsabilitylifecyclestatenew/Test.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/Test.json rename to ability/ability_runtime/actsabilitylifecyclestatenew/Test.json diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/config.json b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/config.json rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/app.js b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/app.js rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/test/ActsAbilityLifecycleStateNewTest.test.js b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/test/ActsAbilityLifecycleStateNewTest.test.js similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/test/ActsAbilityLifecycleStateNewTest.test.js rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/test/ActsAbilityLifecycleStateNewTest.test.js diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/test/List.test.js b/ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/actsabilitylifecyclestatenew/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/actsabilitylifecyclestatenew/signature/openharmony_sx.p7b b/ability/ability_runtime/actsabilitylifecyclestatenew/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsabilitylifecyclestatenew/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsabilitylifecyclestatenew/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsabilitymanageretstest/BUILD.gn b/ability/ability_runtime/actsabilitymanageretstest/BUILD.gn new file mode 100644 index 000000000..f46a00c09 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsAbilityManagerEtsTest") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_ets_assets", + ":hjs_demo_ets_resources", + ":hjs_demo_ets_test_assets", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsAbilityManagerEtsTest" +} +ohos_js_assets("hjs_demo_ets_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_js_assets("hjs_demo_ets_test_assets") { + source_dir = "./entry/src/main/ets/TestAbility" +} +ohos_resources("hjs_demo_ets_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/actsabilitymanageretstest/Test.json b/ability/ability_runtime/actsabilitymanageretstest/Test.json new file mode 100644 index 000000000..7ee81847c --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/Test.json @@ -0,0 +1,19 @@ +{ + "description": "Configuration for aceceshi Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.ohos.acecollaboration", + "package-name": "com.ohos.acecollaboration", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsAbilityManagerEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/config.json b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/config.json new file mode 100644 index 000000000..c41d04caf --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/config.json @@ -0,0 +1,192 @@ +{ + "app": { + "bundleName": "com.ohos.acecollaboration", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.acecollaboration", + "name": ".MyApplication", + "srcPath": "", + "mainAbility": "com.ohos.acecollaboration.MainAbility", + "deviceType": [ + "phone" + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO" + } + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "srcPath": "MainAbility", + "srcLanguage": "ets", + "name": "com.ohos.acecollaboration.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "visible": true, + "srcPath": "TestAbility", + "name": ".TestAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:TestAbility_desc", + "formsEnabled": false, + "label": "$string:TestAbility_label", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry_MainAbility2", + "type": "page", + "launchType": "standard" + }, + { + "srcPath": "ServiceAbility", + "name": ".ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_serviceability", + "type": "service" + }, + { + "srcPath": "ServiceAbility2", + "name": ".ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_serviceability2", + "type": "service" + }, + { + "srcPath": "ServiceAbility3", + "name": ".ServiceAbility3", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_serviceability3", + "type": "service" + }, + { + "srcPath": "ServiceAbility4", + "name": ".ServiceAbility4", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_serviceability4", + "type": "service" + }, + { + "srcPath": "ServiceAbility5", + "name": ".ServiceAbility5", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_serviceability5", + "type": "service" + }, + { + "srcPath": "ServiceAbility6", + "name": ".ServiceAbility6", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_serviceability6", + "type": "service" + }, + { + "srcPath": "ServiceAbility7", + "name": ".ServiceAbility7", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_serviceability7", + "type": "service" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": "MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".TestAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "name": "com.ohos.acecollaboration.DataAbilityShellProvider.PROVIDER" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..fc86a0485 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..8f4528c93 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility/service.ts new file mode 100644 index 000000000..1503232a7 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility/service.ts @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import rpc from '@ohos.rpc'; + +class StubTest extends rpc.RemoteObject { + constructor(des) { + super(des) + } + + onRemoteRequest(code, data, reply, option) { + console.info('ServiceAbility onRemoteRequest'); + if (code === 1) { + let op1 = data.readInt(); + let op2 = data.readInt(); + reply.writeInt(op1 + op2); + console.info('ServiceAbility op1:' + op1 + ' op2:' + op2); + } + return true; + } +} + +export default { + onStart() { + console.info('ServiceAbility onStart'); + }, + onStop() { + console.info('ServiceAbility onStop'); + }, + onCommand(want, startId) { + console.info('ServiceAbility onCommand'); + }, + onConnect(want) { + console.info('ServiceAbility onConnect'); + return new StubTest("test"); + }, + onDisConnect(want) { + console.info('ServiceAbility onDisConnect'); + }, +}; diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility2/service.ts new file mode 100644 index 000000000..a3c5e8884 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility2/service.ts @@ -0,0 +1,132 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import particleAbility from '@ohos.ability.particleAbility'; +import rpc from '@ohos.rpc' + +class StubTest2 extends rpc.RemoteObject { + constructor(des) { + super(des) + } + + onRemoteRequest(code, data, reply, option) { + console.info('ServiceAbility2 onRemoteRequest'); + if (code === 1) { + let op1 = data.readInt(); + let op2 = data.readInt(); + reply.writeInt(op1 + op2); + console.info('ServiceAbility2 op1:' + op1 + ' op2:' + op2); + } + return true; + } +} + +function getNowTime() { + return new Date().getTime(); +} + +function getDurationTime(msg, startTime, endTime) { + console.info(msg + 'Get Interface startTime: ' + startTime); + console.info(msg + 'Get Interface endTime: ' + endTime); + var duration = (endTime - startTime) + console.info(msg + 'Get Interface Duration: ' + duration); + return duration; +} + +async function sleep(time: any) { + var now = new Date(); + var exitTime = now.getTime() + time; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + break; + } + console.info(`sleep ${time} over...`); +} + +export default { + onStart() { + console.info('ServiceAbility2 onStart'); + }, + onStop() { + console.info('ServiceAbility2 onStop'); + }, + onCommand(want, startId) { + console.info('ServiceAbility2 onCommand'); + let request = { + "bundleName": "com.ohos.acecollaboration", + "abilityName": "com.ohos.acecollaboration.ServiceAbility", + } + let options = { + onConnect: async function (element: any, proxy: any) { + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.deviceId : ' + + JSON.stringify(element.deviceId)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.bundleName : ' + + JSON.stringify(element.bundleName)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.abilityName : ' + + JSON.stringify(element.abilityName)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.uri : ' + + JSON.stringify(element.uri)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect element.shortName : ' + + JSON.stringify(element.shortName)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onConnect proxy : ' + + JSON.stringify(proxy)); + }, + onDisconnect: async function (element1: any) { + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.deviceId : ' + + JSON.stringify(element1.deviceId)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.bundleName : ' + + JSON.stringify(element1.bundleName)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.abilityName: ' + + JSON.stringify(element1.abilityName)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.uri : ' + + JSON.stringify(element1.uri)); + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onDisconnect element.shortName : ' + + JSON.stringify(element1.shortName)); + }, + onFailed: async function (code: any) { + console.log('particleAbility_connectAbility_test_0100 ConnectAbility onFailed errCode : ' + code); + }, + } + + let connection_succeeded: any; + console.info('particleAbility_connectAbility_test_0100 start '); + var timeOldStamp = getNowTime(); + var connection = particleAbility.connectAbility(request, options); + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0100 connectability', timeOldStamp, timeNewStamp); + connection_succeeded = connection; + console.info('particleAbility_connectAbility_test_0100 service request is:' + JSON.stringify(request)); + console.info('particleAbility_connectAbility_test_0100 options is:' + JSON.stringify(options)); + console.info('particleAbility_connectAbility_test_0100 data is: ' + JSON.stringify(connection)); + console.info('particleAbility_connectAbility_test_0100 connection=: ' + connection); + sleep(5000); + console.info('particleAbility_connectAbility_test_0100 disconnectability start '); + var timeOldStamp = getNowTime(); + particleAbility.disconnectAbility(connection_succeeded).then((data: any) => { + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0100 disconnectability', timeOldStamp, timeNewStamp); + console.info('particleAbility_connectAbility_test_0100 disconnectability succeeded: ' + + JSON.stringify(data)); + }).catch((error: any) => { + console.error('particleAbility_connectAbility_test_0100 disconnectability failed. Cause: ' + + JSON.stringify(error)); + }) + }, + onConnect(want) { + console.info('ServiceAbility2 onConnect'); + return new StubTest2("test"); + }, +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility3/service.ts b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility3/service.ts new file mode 100644 index 000000000..72c61a28d --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility3/service.ts @@ -0,0 +1,133 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import particleAbility from '@ohos.ability.particleAbility'; +import rpc from '@ohos.rpc'; + +class StubTest3 extends rpc.RemoteObject { + constructor(des) { + super(des) + } + + onRemoteRequest(code, data, reply, option) { + console.info('ServiceAbility3 onRemoteRequest'); + if (code === 1) { + let op1 = data.readInt(); + let op2 = data.readInt(); + reply.writeInt(op1 + op2); + console.info('ServiceAbility3 op1:' + op1 + ' op2:' + op2); + } + return true; + } +} + +function getNowTime() { + return new Date().getTime(); +} + +function getDurationTime(msg, startTime, endTime) { + console.info(msg + 'Get Interface startTime: ' + startTime); + console.info(msg + 'Get Interface endTime: ' + endTime); + var duration = (endTime - startTime) + console.info(msg + 'Get Interface Duration: ' + duration); + return duration; +} + +async function sleep(time: any) { + var now = new Date(); + var exitTime = now.getTime() + time; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + break; + } + console.info(`sleep ${time} over...`); +} + +export default { + onStart() { + console.info('ServiceAbility3 onStart'); + }, + onStop() { + console.info('ServiceAbility3 onStop'); + }, + onCommand(want, startId) { + console.info('ServiceAbility3 onCommand'); + let request = { + "bundleName": "com.ohos.acecollaboration", + "abilityName": "com.ohos.acecollaboration.ServiceAbility", + } + let options = { + onConnect: async function (element: any, proxy: any) { + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.deviceId : ' + + JSON.stringify(element.deviceId)) + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.bundleName : ' + + JSON.stringify(element.bundleName)) + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.abilityName : ' + + JSON.stringify(element.abilityName)) + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.uri : ' + + JSON.stringify(element.uri)) + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect element.shortName : ' + + JSON.stringify(element.shortName)) + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onConnect proxy : ' + + JSON.stringify(proxy)); + }, + onDisconnect: async function (element1: any) { + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.deviceId :' + + JSON.stringify(element1.deviceId)); + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.bundleName :' + + JSON.stringify(element1.bundleName)); + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.abilityName :' + + JSON.stringify(element1.abilityName)); + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.uri : ' + + JSON.stringify(element1.uri)); + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onDisconnect element.shortName : ' + + JSON.stringify(element1.shortName)); + }, + onFailed: function (code: any) { + console.log('particleAbility_connectAbility_test_0200 ConnectAbility onFailed errCode: ' + code) + }, + } + + let connection_succeeded: any; + console.info('particleAbility_connectAbility_test_0200 start '); + var timeOldStamp = getNowTime(); + var connection = particleAbility.connectAbility(request, options); + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0200 connectability', timeOldStamp, timeNewStamp); + connection_succeeded = connection; + console.info('particleAbility_connectAbility_test_0200 service request is:' + JSON.stringify(request)); + console.info('particleAbility_connectAbility_test_0200 options is:' + JSON.stringify(options)); + console.info('particleAbility_connectAbility_test_0200 connection=: ' + connection); + sleep(5000); + console.info('particleAbility_connectAbility_test_0200 disconnectability start '); + try { + var timeOldStamp = getNowTime(); + particleAbility.disconnectAbility(connection_succeeded, (error, data) => { + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0200 disconnectability', timeOldStamp, timeNewStamp); + console.info('particleAbility_connectAbility_test_0200 disconnectability succeeded: ' + JSON.stringify(data)); + }) + } + catch(error: any){ + console.error('particleAbility_connectAbility_test_0200 disconnectability failed. Cause: ' + + JSON.stringify(error)); + } + }, + onConnect(want) { + console.info('ServiceAbility3 onConnect'); + return new StubTest3("test"); + }, +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility4/service.ts b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility4/service.ts new file mode 100644 index 000000000..d35fb6c9b --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility4/service.ts @@ -0,0 +1,132 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import particleAbility from '@ohos.ability.particleAbility'; +import rpc from '@ohos.rpc' + +class StubTest4 extends rpc.RemoteObject { + constructor(des) { + super(des) + } + + onRemoteRequest(code, data, reply, option) { + console.info('ServiceAbility4 onRemoteRequest'); + if (code === 1) { + let op1 = data.readInt(); + let op2 = data.readInt(); + reply.writeInt(op1 + op2); + console.info('ServiceAbility4 op1:' + op1 + ' op2:' + op2); + } + return true; + } +} + +function getNowTime() { + return new Date().getTime(); +} + +function getDurationTime(msg, startTime, endTime) { + console.info(msg + 'Get Interface startTime: ' + startTime); + console.info(msg + 'Get Interface endTime: ' + endTime); + var duration = (endTime - startTime) + console.info(msg + 'Get Interface Duration: ' + duration); + return duration; +} + +async function sleep(time: any) { + var now = new Date(); + var exitTime = now.getTime() + time; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + break; + } + console.info(`sleep ${time} over...`); +} + +export default { + onStart() { + console.info('ServiceAbility4 onStart'); + }, + onStop() { + console.info('ServiceAbility4 onStop'); + }, + onCommand(want, startId) { + console.info('ServiceAbility4 onCommand'); + let request = { + "bundleName": "com.open.harmony.packagemag", + "abilityName": "com.open.harmony.packagemag.packServiceAbility", + } + let options = { + onConnect: async function (element: any, proxy: any) { + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.deviceId : ' + + JSON.stringify(element.deviceId)) + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.bundleName : ' + + JSON.stringify(element.bundleName)) + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.abilityName : ' + + JSON.stringify(element.abilityName)) + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.uri : ' + + JSON.stringify(element.uri)) + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect element.shortName : ' + + JSON.stringify(element.shortName)) + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onConnect proxy : ' + + JSON.stringify(proxy)); + }, + onDisconnect: async function (element1: any) { + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.deviceId : ' + + JSON.stringify(element1.deviceId)); + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.bundleName: ' + + JSON.stringify(element1.bundleName)); + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.abilityName:' + + JSON.stringify(element1.abilityName)); + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.uri: ' + + JSON.stringify(element1.uri)); + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onDisconnect element.shortName :' + + JSON.stringify(element1.shortName)); + }, + onFailed: function (code: any) { + console.log('particleAbility_connectAbility_test_0300 ConnectAbility onFailed errCode : '+ code); + }, + } + + let connection_succeeded: any; + console.info('particleAbility_connectAbility_test_0300 start '); + var timeOldStamp = getNowTime(); + var connection = particleAbility.connectAbility(request, options); + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0300 connectability', timeOldStamp, timeNewStamp); + connection_succeeded = connection; + console.info('particleAbility_connectAbility_test_0300 service request is:' + JSON.stringify(request)); + console.info('particleAbility_connectAbility_test_0300 options is:' + JSON.stringify(options)); + console.info('particleAbility_connectAbility_test_0300 data is: ' + JSON.stringify(connection)); + console.info('particleAbility_connectAbility_test_0300 connection=: ' + connection); + sleep(5000); + console.info('particleAbility_connectAbility_test_0300 disconnectability start '); + var timeOldStamp = getNowTime(); + particleAbility.disconnectAbility(connection_succeeded).then((data: any) => { + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0300 disconnectability', timeOldStamp, timeNewStamp); + console.info('particleAbility_connectAbility_test_0300 disconnectability succeeded:' + + JSON.stringify(data)); + }).catch ((error: any) =>{ + console.error('particleAbility_connectAbility_test_0300 disconnectability failed. Cause: ' + + JSON.stringify(error)); + }) + }, + onConnect(want) { + console.info('ServiceAbility4 onConnect'); + return new StubTest4("test"); + }, +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility5/service.ts b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility5/service.ts new file mode 100644 index 000000000..16a737c34 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility5/service.ts @@ -0,0 +1,147 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import particleAbility from '@ohos.ability.particleAbility'; +import rpc from '@ohos.rpc' + +class StubTest5 extends rpc.RemoteObject { + constructor(des) { + super(des) + } + + onRemoteRequest(code, data, reply, option) { + console.info('ServiceAbility5 onRemoteRequest'); + if (code === 1) { + let op1 = data.readInt(); + let op2 = data.readInt(); + reply.writeInt(op1 + op2); + console.info('ServiceAbility5 op1:' + op1 + ' op2:' + op2); + } + return true; + } +} + +function getNowTime() { + return new Date().getTime(); +} + +function getDurationTime(msg, startTime, endTime) { + console.info(msg + 'Get Interface startTime: ' + startTime); + console.info(msg + 'Get Interface endTime: ' + endTime); + var duration = (endTime - startTime) + console.info(msg + 'Get Interface Duration: ' + duration); + return duration; +} + +async function sleep(time: any) { + var now = new Date(); + var exitTime = now.getTime() + time; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + break; + } + console.info(`sleep ${time} over...`); +} + +export default { + onStart() { + console.info('ServiceAbility5 onStart'); + }, + onStop() { + console.info('ServiceAbility5 onStop'); + }, + onCommand(want, startId) { + console.info('ServiceAbility5 onCommand'); + let request = { + "bundleName": "", + "abilityName": "", + } + let options = { + onConnect: async function (element: any, proxy: any) { + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.deviceId : ' + + JSON.stringify(element.deviceId)) + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.bundleName : ' + + JSON.stringify(element.bundleName)) + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.abilityName : ' + + JSON.stringify(element.abilityName)) + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.uri : ' + + JSON.stringify(element.uri)) + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect element.shortName : ' + + JSON.stringify(element.shortName)) + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onConnect proxy : ' + + JSON.stringify(proxy)); + }, + onDisconnect: function (element1: any) { + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.deviceId : ' + + JSON.stringify(element1.deviceId)); + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.bundleName: ' + + JSON.stringify(element1.bundleName)); + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.abilityName:' + + JSON.stringify(element1.abilityName)); + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.uri : ' + + JSON.stringify(element1.uri)); + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onDisconnect element.shortName : ' + + JSON.stringify(element1.shortName)); + }, + onFailed: function (code: any) { + console.log('particleAbility_connectAbility_test_0400 ConnectAbility onFailed errCode:' + code); + }, + } + + let connection_succeeded: any; + console.info('particleAbility_connectAbility_test_0400 start '); + var timeOldStamp = getNowTime(); + var connection = particleAbility.connectAbility(request, options); + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0400 connectability', timeOldStamp, timeNewStamp); + connection_succeeded = connection; + console.info('particleAbility_connectAbility_test_0400 service request is:' + JSON.stringify(request)); + console.info('particleAbility_connectAbility_test_0400 options is:' + JSON.stringify(options)); + console.info('particleAbility_connectAbility_test_0400 connection=: ' + connection); + sleep(5000); + console.info('particleAbility_connectAbility_test_0400 disconnectability start '); + var timeOldStamp = getNowTime(); + particleAbility.disconnectAbility(connection_succeeded).then((data: any) => { + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0400 disconnectability', timeOldStamp, timeNewStamp); + console.info('particleAbility_connectAbility_test_0400 disconnectability succeeded: ' + + JSON.stringify(data)); + }).catch((error: any) => { + console.error('particleAbility_connectAbility_test_0400 disconnectability failed. Cause: ' + + JSON.stringify(error)); + }); + sleep(5000); + console.info('particleAbility_connectAbility_test_0400 disconnectability_fail start '); + try { + var timeOldStamp = getNowTime(); + particleAbility.disconnectAbility(-1).then((data: any) => { + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0400 disconnectability_fail', + timeOldStamp, timeNewStamp); + console.info('particleAbility_connectAbility_test_0400 disconnectability_fail succeeded: ' + + JSON.stringify(data)); + }) + } + catch (error: any) { + console.error('particleAbility_connectAbility_test_0400 disconnectability_fail failed. Cause: ' + + JSON.stringify(error)); + } + }, + onConnect(want) { + console.info('ServiceAbility5 onConnect'); + return new StubTest5("test"); + }, +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility6/service.ts b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility6/service.ts new file mode 100644 index 000000000..b36d40bab --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility6/service.ts @@ -0,0 +1,108 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import particleAbility from '@ohos.ability.particleAbility'; +import rpc from '@ohos.rpc' + +class StubTest6 extends rpc.RemoteObject { + constructor(des) { + super(des) + } + + onRemoteRequest(code, data, reply, option) { + console.info('ServiceAbility6 onRemoteRequest'); + if (code === 1) { + let op1 = data.readInt(); + let op2 = data.readInt(); + reply.writeInt(op1 + op2); + console.info('ServiceAbility6 op1:' + op1 + ' op2:' + op2); + } + return true; + } +} +function getNowTime() { + return new Date().getTime(); +} + +function getDurationTime(msg, startTime, endTime) { + console.info(msg + 'Get Interface startTime: ' + startTime); + console.info(msg + 'Get Interface endTime: ' + endTime); + var duration = (endTime - startTime) + console.info(msg + 'Get Interface Duration: ' + duration); + return duration; +} + +export default { + onStart() { + console.info('ServiceAbility onStart'); + }, + onStop() { + console.info('ServiceAbility onStop'); + }, + onCommand(want, startId) { + console.info('ServiceAbility onCommand'); + + let request = { + "bundleName":"com.ohos.acecollaboration", + "abilityName":"com.ohos.acecollaboration.xxx", + } + let options = { + onConnect:async function (element:any, proxy:any) { + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.deviceId : ' + + JSON.stringify(element.deviceId)) + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.bundleName : ' + + JSON.stringify(element.bundleName)) + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.abilityName : ' + + JSON.stringify(element.abilityName)) + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.uri : ' + + JSON.stringify(element.uri)) + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect element.shortName : ' + + JSON.stringify(element.shortName)) + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onConnect proxy : ' + + JSON.stringify(proxy)); + }, + onDisconnect:function (element1:any) { + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.deviceId : ' + + JSON.stringify(element1.deviceId)); + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.bundleName: ' + + JSON.stringify(element1.bundleName)); + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.abilityName:' + + JSON.stringify(element1.abilityName)); + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.uri : ' + + JSON.stringify(element1.uri)); + console.log('particleAbility_connectAbility_test_0500 ConnectAbility onDisconnect element.shortName : ' + + JSON.stringify(element1.shortName)); + }, + onFailed:function (code:any) { + console.log('particleAbility_connectAbility_test_0500 ConnectAbility service onFailed errCode:' + code) + }, + } + + console.info('particleAbility_connectAbility_test_0500 errorabilityName start'); + var timeOldStamp = getNowTime(); + var connection = particleAbility.connectAbility(request, options); + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0500 connectability', timeOldStamp, timeNewStamp); + console.info('particleAbility_connectAbility_test_0500 errorabilityName request is:' + + JSON.stringify(request)); + console.info('particleAbility_connectAbility_test_0500 errorabilityName options is:' + + JSON.stringify(options)); + console.info('particleAbility_connectAbility_test_0500 errorabilityName connection=: ' + connection); + }, + onConnect(want) { + console.info('ServiceAbility6 onConnect'); + return new StubTest6("test"); + }, +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility7/service.ts b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility7/service.ts new file mode 100644 index 000000000..32fe65dec --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/ServiceAbility7/service.ts @@ -0,0 +1,135 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import particleAbility from '@ohos.ability.particleAbility'; +import rpc from '@ohos.rpc' + +class StubTest7 extends rpc.RemoteObject { + constructor(des) { + super(des) + } + + onRemoteRequest(code, data, reply, option) { + console.info('ServiceAbility7 onRemoteRequest'); + if (code === 1) { + let op1 = data.readInt(); + let op2 = data.readInt(); + reply.writeInt(op1 + op2); + console.info('ServiceAbility7 op1:' + op1 + ' op2:' + op2); + } + return true; + } +} + +function getNowTime() { + return new Date().getTime(); +} + +function getDurationTime(msg, startTime, endTime) { + console.info(msg + 'Get Interface startTime: ' + startTime); + console.info(msg + 'Get Interface endTime: ' + endTime); + var duration = (endTime - startTime) + console.info(msg + 'Get Interface Duration: ' + duration); + return duration; +} + +async function sleep(time: any) { + var now = new Date(); + var exitTime = now.getTime() + time; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + break; + } + console.info(`sleep ${time} over...`); +} +export default { + onStart() { + console.info('ServiceAbility7 onStart'); + }, + onStop() { + console.info('ServiceAbility7 onStop'); + }, + onCommand(want, startId) { + console.info('ServiceAbility7 onCommand'); + + let request = { + "bundleName":"com.example.myapplication", + "abilityName":"com.example.myapplication.ServiceAbility_API8", + } + let options = { + onConnect:async function (element:any, proxy:any) { + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.deviceId : ' + + JSON.stringify(element.deviceId)) + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.bundleName : ' + + JSON.stringify(element.bundleName)) + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.abilityName : ' + + JSON.stringify(element.abilityName)) + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.uri : ' + + JSON.stringify(element.uri)) + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect element.shortName : ' + + JSON.stringify(element.shortName)) + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onConnect proxy : ' + + JSON.stringify(proxy)); + }, + onDisconnect:async function (element1:any) { + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.deviceId : ' + + JSON.stringify(element1.deviceId)); + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.bundleName: ' + + JSON.stringify(element1.bundleName)); + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.abilityName:' + + JSON.stringify(element1.abilityName)); + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.uri : ' + + JSON.stringify(element1.uri)); + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onDisconnect element.shortName : ' + + JSON.stringify(element1.shortName)); + }, + onFailed:function (code:any) { + console.log('particleAbility_connectAbility_test_0600 ConnectAbility onFailed errCode:' + code); + }, + } + + let connection_succeeded:any; + console.info('particleAbility_connectAbility_test_0600 start '); + var timeOldStamp = getNowTime(); + var connection = particleAbility.connectAbility(request, options); + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0600 connectability', timeOldStamp, timeNewStamp); + connection_succeeded = connection; + console.info('particleAbility_connectAbility_test_0600 service request is:' + JSON.stringify(request)); + console.info('particleAbility_connectAbility_test_0600 options is:' + JSON.stringify(options)); + console.info('particleAbility_connectAbility_test_0600 data is: ' + JSON.stringify(connection)); + console.info('particleAbility_connectAbility_test_0600 connection=: ' + connection); + sleep(5000); + console.info('particleAbility_connectAbility_test_0600 disconnectability start '); + var timeOldStamp = getNowTime(); + particleAbility.disconnectAbility(connection_succeeded).then((data: any) => { + var timeNewStamp = getNowTime(); + getDurationTime('particleAbility_connectAbility_test_0600 disconnectability', timeOldStamp, timeNewStamp); + console.info('particleAbility_connectAbility_test_0600 disconnectability succeeded: ' + + JSON.stringify(data)); + }).catch((error: any) =>{ + console.error('particleAbility_connectAbility_test_0600 disconnectability failed. Cause: ' + + JSON.stringify(error)); + }); + }, + onConnect(want) { + console.info('ServiceAbility7 onConnect'); + return new StubTest7("test"); + }, + onDisConnect(want) { + console.info('ServiceAbility7 onDisConnect'); + }, +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets new file mode 100644 index 000000000..1405dd359 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/app.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from 'hypium/index' +import testsuite from '../test/List.test' + +export default { + onCreate() { + console.info('Application onCreate') + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets new file mode 100644 index 000000000..52663437c --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestAbility/pages/index.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; + +@Entry +@Component +struct Index { + aboutToAppear() { + console.info('TestAbility index aboutToAppear') + } + + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 000000000..14e78a653 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s itName', + '-s level', '-s testType', '-s size', '-s timeout', + '-s package' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams += ' ' + key + ' ' + parameters[key] + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + console.log('onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + console.info('OpenHarmonyTestRunner OnPrepare') + } + + onRun() { + console.log('OpenHarmonyTestRunner onRun run') + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + console.info('cmd : '+cmd) + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + d.stdResult); + console.info('executeShellCommand : data : ' + d.exitCode); + }) + console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') + var context = abilityDelegator.getAppContext() + console.info('getAppContext : ' + JSON.stringify(context)) + console.info('OpenHarmonyTestRunner onRun end') + } +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets new file mode 100644 index 000000000..c442900cc --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets @@ -0,0 +1,249 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility' +import {describe, beforeEach, afterEach, it, expect} from 'hypium/index'; +import Utils from './Utils'; + +export default function ContextJsunit() { + describe('appInfoTest_ability_2', function () { + beforeEach(async function (done) { + console.info("context before each called"); + done() + }); + + afterEach(async function () { + await Utils.sleep(2000); + console.info("context after each called"); + }); + + /* + * @tc.number: context_getCacheDir_test_0100 + * @tc.name: getCacheDir : Obtains the Cache directory on internal storage. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it("context_getCacheDir_test_0100", 0, async function (done) { + console.log("------------------start context_getCacheDir_test_0100-------------------"); + try { + var timeOldStamp = await Utils.getNowTime(); + var context = await featureAbility.getContext(); + context.getCacheDir().then((data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getCacheDir_test_0100', timeOldStamp, timeNewStamp) + console.log("context_getCacheDir_test_0100: CacheDir is " + data); + }) + } catch (error) { + console.log("logMessage context_getCacheDir_test_0100: error = " + error); + expect(error).assertEqual("/data/storage/el2/base/haps/entry/cache"); + } + var data1 = await context.getCacheDir(); + expect(typeof (data1)).assertEqual("string"); + expect(data1).assertEqual("/data/storage/el2/base/haps/entry/cache"); + done(); + console.log("------------------end context_getCacheDir_test_0100-------------------"); + }); + + /* + * @tc.number: context_getCacheDir_test_0200 + * @tc.name: getCacheDir : Obtains the Cache directory on internal storage. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it("context_getCacheDir_test_0200", 0, async function (done) { + console.log("------------------start context_getCacheDir_test_0200-------------------"); + try { + var timeOldStamp = await Utils.getNowTime(); + var context = await featureAbility.getContext(); + context.getCacheDir((err, data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getCacheDir_test_0200', timeOldStamp, timeNewStamp) + console.log("context_getCacheDir_test_0200: getCacheDir successful, result = " + data); + }); + } catch (error) { + console.log("logMessage context_getCacheDir_test_0200: error = " + error); + expect(error).assertEqual("/data/storage/el2/base/haps/entry/cache"); + } + var data1 = await context.getCacheDir(); + expect(typeof (data1)).assertEqual("string"); + expect(data1).assertEqual("/data/storage/el2/base/haps/entry/cache"); + done(); + console.log("------------------end context_getCacheDir_test_0200-------------------"); + }); + + /* + * @tc.number: context_getFilesDir_test_0100 + * @tc.name: getFilesDir : Obtains the files directory on internal storage. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it("context_getFilesDir_test_0100", 0, async function (done) { + console.log("------------------start context_getFilesDir_test_0100-------------------"); + try { + var timeOldStamp = await Utils.getNowTime(); + var context = await featureAbility.getContext(); + context.getFilesDir().then((data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getFilesDir_test_0100', timeOldStamp, timeNewStamp) + console.log("context_getFilesDir_test_0100:FilesDir is " + data); + }) + } catch (error) { + console.log("logMessage context_getFilesDir_test_0100: error = " + error); + expect(error).assertEqual("/data/storage/el2/base/haps/entry/files"); + } + var data1 = await context.getFilesDir(); + expect(typeof (data1)).assertEqual("string"); + expect(data1).assertEqual("/data/storage/el2/base/haps/entry/files"); + done(); + console.log("------------------end context_getFilesDir_test_0100-------------------"); + }); + + /* + * @tc.number: context_getFilesDir_test_0200 + * @tc.name: getFilesDir : Obtains the files directory on internal storage. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it("context_getFilesDir_test_0200", 0, async function (done) { + console.log("------------------start context_getFilesDir_test_0200-------------------"); + try { + var timeOldStamp = await Utils.getNowTime(); + var context = await featureAbility.getContext(); + context.getFilesDir((err, data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getFilesDir_test_0200', timeOldStamp, timeNewStamp) + console.log("context_getFilesDir_test_0200: getFilesDir successful, result = " + data); + }); + } catch (error) { + console.log("logMessage context_getFilesDir_test_0200: error = " + error); + expect(error).assertEqual("/data/storage/el2/base/haps/entry/files"); + } + var data1 = await context.getFilesDir(); + expect(typeof (data1)).assertEqual("string"); + expect(data1).assertEqual("/data/storage/el2/base/haps/entry/files"); + done(); + console.log("------------------end context_getFilesDir_test_0200-------------------"); + }); + + + /* + * @tc.number: context_getOrCreateDistributedDir_test_0100 + * @tc.name: getOrCreateDistributedDir : Obtains the directory of Distributed files. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it("context_getOrCreateDistributedDir_0100", 0, async function (done) { + console.log("------------------start context_getOrCreateDistributedDir_0100-------------------"); + try { + var timeOldStamp = await Utils.getNowTime(); + var context = await featureAbility.getContext(); + context.getOrCreateDistributedDir().then((data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getOrCreateDistributedDir_0100', timeOldStamp, timeNewStamp); + console.log("context_getOrCreateDistributedDir_0100: DistributedDir is " + data); + }) + } catch (error) { + console.log("logMessage context_getOrCreateDistributedDir_0100: error = " + error); + expect(error).assertEqual("/data/storage/el2/distributedfiles/entry"); + } + var data1 = await context.getOrCreateDistributedDir(); + expect(typeof (data1)).assertEqual("string"); + expect(data1).assertEqual("/data/storage/el2/distributedfiles"); + done(); + console.log("------------------end context_getOrCreateDistributedDir_0100-------------------"); + }); + + /* + * @tc.number: context_getOrCreateDistributedDir_0200 + * @tc.name: getOrCreateDistributedDir : Obtains the directory of Distributed files. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it("context_getOrCreateDistributedDir_0200", 0, async function (done) { + console.log("------------------start context_getOrCreateDistributedDir_0200-------------------"); + try { + var timeOldStamp = await Utils.getNowTime(); + var context = await featureAbility.getContext(); + context.getOrCreateDistributedDir((err, data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getOrCreateDistributedDir_0200', timeOldStamp, timeNewStamp); + console.log("context_getOrCreateDistributedDir_0200: getOrCreateDistributedDir successful, result = " + data); + }); + } catch (error) { + console.log("logMessage context_getOrCreateDistributedDir_0200: error = " + error); + expect(error).assertEqual("/data/storage/el2/distributedfiles/entry"); + } + var data1 = await context.getOrCreateDistributedDir(); + expect(typeof (data1)).assertEqual("string"); + expect(data1).assertEqual("/data/storage/el2/distributedfiles"); + done(); + console.log("------------------end context_getOrCreateDistributedDir_0200-------------------"); + }); + + /* + * @tc.number: context_getAppType_0100 + * @tc.name: getAppType : Obtains the type of current application. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it("context_getAppType_0100", 0, async function (done) { + console.log("------------------start context_getAppType_0100-------------------"); + try { + var timeOldStamp = await Utils.getNowTime(); + var context = await featureAbility.getContext(); + context.getAppType().then((data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getAppType_0100_0100', timeOldStamp, timeNewStamp); + console.log("context_getAppType_0100: AppType is " + data); + }) + } catch (error) { + console.log("logMessage context_getAppType_0100: error = " + error); + expect(error).assertEqual("system"); + } + var data1 = await context.getAppType(); + expect(typeof (data1)).assertEqual("string"); + expect(data1).assertEqual("system"); + done(); + console.log("------------------end context_getAppType_0100-------------------"); + }); + + /* + * @tc.number: context_getAppType_0200 + * @tc.name: getAppType : Obtains the type of current application. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it("context_getAppType_0200", 0, async function (done) { + console.log("------------------start context_getAppType_0200-------------------"); + try { + var timeOldStamp = await Utils.getNowTime(); + var context = await featureAbility.getContext(); + context.getAppType((err, data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getAppType_0200_0100', timeOldStamp, timeNewStamp); + console.log("context_getAppType_0200: getAppType successful, result = " + data); + }); + } catch (error) { + console.log("logMessage context_getAppType_0200: error = " + error); + expect(error).assertEqual("system"); + } + var data1 = await context.getAppType(); + expect(typeof (data1)).assertEqual("string"); + expect(data1).assertEqual("system"); + done(); + console.log("------------------end context_getAppType_0200-------------------"); + }); + }) +} diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..fe2b0eecc --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import addContextAndAbilityJsunit from './addContextAndAbilityJsunit.test.ets'; +import getHapModuleInfoJsunit from './getHapModuleInfoJsunit.test.ets'; +import getAbilityInfoJsunit from './getAbilityInfoJsunit.test.ets'; +import getApplicationContext from './getApplicationContextJsunit.test.ets'; +import getAppVersionInfoJsunit from './getAppVersionInfoJsunit.test.ets'; +import ContextJsunit from './ContextJsunit.test.ets'; + +export default function testsuite() { + ContextJsunit(); + addContextAndAbilityJsunit(); + getHapModuleInfoJsunit(); + getAbilityInfoJsunit(); + getApplicationContext(); + getAppVersionInfoJsunit(); +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/Utils.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/Utils.ets new file mode 100644 index 000000000..8d2d038c5 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/Utils.ets @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default class Utils { + static sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(reject) + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + + static getNowTime() { + return new Date().getTime(); + } + + /** + * 接口调用时间 + * @param startTime 接口调用开始时间 + * @param endTime 接口调用结束时间 + */ + static getDurationTime(msg, startTime, endTime) { + console.info(msg + 'Get Interface startTime: ' + startTime); + console.info(msg + 'Get Interface endTime: ' + endTime); + var duration = (endTime - startTime) + console.info(msg + 'Get Interface Duration: ' + duration); + return duration; + } +} + + + + diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets new file mode 100644 index 000000000..bfef54ca0 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets @@ -0,0 +1,301 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, it, expect} from 'hypium/index'; +import Utils from './Utils'; +import ability_featureAbility from '@ohos.ability.featureAbility'; +import ability_particleAbility from '@ohos.ability.particleAbility'; +import abilityManager from "@ohos.application.appManager" + +const TAG_TEST_0100 = ' context_isUpdatingConfigurations_test_0100 '; +const TAG_TEST_0200 = ' context_isUpdatingConfigurations_test_0200 '; +const TAG_TEST_0300 = ' context_printDrawnCompleted_test_0100 '; +const TAG_TEST_0400 = ' context_printDrawnCompleted_test_0200 '; +const TAG_TEST_0500 = ' context_getAppMemorySize_test_0100 '; +const TAG_TEST_0600 = ' context_getAppMemorySize_test_0200 '; +const TAG_TEST_0700 = ' context_isRamConstrainedDevice_test_0100 '; +const TAG_TEST_0800 = ' context_isRamConstrainedDevice_test_0200 '; +const TAG_TEST_0900 = ' context_featureAbility_test_0100 '; +const TAG_TEST_0010 = ' context_featureAbility_test_0200 '; +const TAG_TEST_0011 = ' context_featureAbility_test_0300 '; +const TAG_TEST_0012 = ' context_featureAbility_test_0400 '; + +export default function addContextAndAbilityJsunit() { + describe('appInfoTest_ability_1', function () { + /* + * @tc.number: context_isUpdatingConfigurations_test_0100 + * @tc.name: isUpdatingConfigurations : Obtains whether the configuration of the current ability is changing. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it(TAG_TEST_0100, 0, async function (done) { + console.info(TAG_TEST_0100 + 'promise START'); + let detailed; + var startTime = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + await context.isUpdatingConfigurations().then((data) => { + var endTime = Utils.getNowTime(); + Utils.getDurationTime(TAG_TEST_0100, startTime, endTime) + console.info(TAG_TEST_0100 + ' promise data is:' + JSON.stringify(data)); + detailed = data; + }).catch((error) => { + console.error(TAG_TEST_0100 + 'promise errors is: ' + JSON.stringify(error)); + }) + expect(typeof (detailed)).assertEqual("boolean"); + expect(detailed).assertEqual(false); + done(); + console.log('------------------ ' + TAG_TEST_0100 + ' end -------------------'); + }); + + /* + * @tc.number: context_isUpdatingConfigurations_test_0200 + * @tc.name: isUpdatingConfigurations : Obtains whether the configuration of the current ability is changing. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it(TAG_TEST_0200, 0, async function (done) { + let detailed; + console.info(TAG_TEST_0200 + 'callBack START'); + try { + var startTime = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + context.isUpdatingConfigurations((error, data) => { + var endTime = Utils.getNowTime(); + Utils.getDurationTime(TAG_TEST_0200, startTime, endTime) + detailed = data; + console.info(TAG_TEST_0200 + ' callBack succeeded. data is:' + JSON.stringify(data)); + }); + } catch (error) { + console.error(TAG_TEST_0200 + 'Operation failed. Cause: ' + JSON.stringify(error)); + } + await Utils.sleep(2000) + expect(typeof (detailed)).assertEqual("boolean"); + expect(detailed).assertEqual(false); + done(); + console.log('------------------ ' + TAG_TEST_0200 + ' end -------------------'); + }); + + /* + * @tc.number: context_printDrawnCompleted_test_0100 + * @tc.name: printDrawnCompleted : Inform the system of the time required to complete the drawing of the page + capability. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it(TAG_TEST_0300, 0, async function (done) { + let detailed; + console.info(TAG_TEST_0300 + 'callBack START'); + var startTime = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + await context.printDrawnCompleted().then((data) => { + var endTime = Utils.getNowTime(); + Utils.getDurationTime(TAG_TEST_0300, startTime, endTime) + console.info(TAG_TEST_0300 + ' promise data is:' + JSON.stringify(data)); + detailed = data; + }).catch((error) => { + console.error(TAG_TEST_0300 + 'promise error is: ' + JSON.stringify(error)); + }); + await Utils.sleep(2000) + expect(detailed).assertEqual(null); + done(); + console.log('------------------ ' + TAG_TEST_0300 + ' end -------------------'); + }) + + + /* + * @tc.number: context_printDrawnCompleted_test_0200 + * @tc.name: printDrawnCompleted : Inform the system of the time required to complete the drawing of the page + capability. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it(TAG_TEST_0400, 0, async function (done) { + let detailed; + console.info(TAG_TEST_0400 + 'callBack START'); + try { + var startTime = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + context.printDrawnCompleted((error, data) => { + var endTime = Utils.getNowTime(); + Utils.getDurationTime(TAG_TEST_0300, startTime, endTime) + detailed = data; + console.info(TAG_TEST_0400 + ' callBack succeeded. data is:' + JSON.stringify(data)); + }); + } catch (error) { + console.error(TAG_TEST_0400 + 'Operation failed. Cause: ' + JSON.stringify(error)); + } + await Utils.sleep(2000) + expect(detailed).assertEqual(null); + done(); + console.log('------------------ ' + TAG_TEST_0400 + ' end -------------------'); + }) + + + /* + * @tc.number: context_getAppMemorySize_test_0100 + * @tc.name: getAppMemorySize : Obtains the memory size of the application. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it(TAG_TEST_0500, 0, async function (done) { + console.info(TAG_TEST_0500 + 'promise START'); + let detailed; + var startTime = await Utils.getNowTime(); + await abilityManager.getAppMemorySize() + .then((data) => { + var endTime = Utils.getNowTime(); + Utils.getDurationTime(TAG_TEST_0500, startTime, endTime) + console.info(TAG_TEST_0500 + ' promise data is:' + JSON.stringify(data)); + detailed = data; + }).catch((error) => { + console.error(TAG_TEST_0500 + 'promise errors is: ' + JSON.stringify(error)); + }) + await Utils.sleep(2000) + expect(typeof (detailed)).assertEqual("number"); + expect(detailed).assertEqual(512); + done(); + console.log('------------------ ' + TAG_TEST_0500 + ' end -------------------'); + }); + + /* + * @tc.number: context_getAppMemorySize_test_0200 + * @tc.name: getAppMemorySize : Obtains the memory size of the application. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it(TAG_TEST_0600, 0, async function (done) { + console.info(TAG_TEST_0600 + 'callBack START'); + var startTime = await Utils.getNowTime(); + abilityManager.getAppMemorySize((error, data) => { + var endTime = Utils.getNowTime(); + Utils.getDurationTime(TAG_TEST_0500, startTime, endTime) + console.info(TAG_TEST_0600 + ' callBack error is: ' + JSON.stringify(error)); + console.info(TAG_TEST_0600 + ' callBack data is:' + JSON.stringify(data)); + expect(typeof (data)).assertEqual("number"); + expect(data).assertEqual(512); + console.log('------------------ ' + TAG_TEST_0600 + ' end -------------------'); + done(); + }) + }); + + /* + * @tc.number: context_isRamConstrainedDevice_test_0100 + * @tc.name: isRamConstrainedDevice : Obtains whether the current device has low ram. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it(TAG_TEST_0700, 0, async function (done) { + let detailed; + console.info(TAG_TEST_0700 + 'promise START'); + var startTime = await Utils.getNowTime(); + await abilityManager.isRamConstrainedDevice().then((data) => { + var endTime = Utils.getNowTime(); + Utils.getDurationTime(TAG_TEST_0500, startTime, endTime) + console.info(TAG_TEST_0700 + ' promise data is:' + JSON.stringify(data)); + detailed = data; + }).catch((error) => { + console.error(TAG_TEST_0700 + 'promise errors is: ' + JSON.stringify(error)); + }) + await Utils.sleep(1000) + expect(typeof (detailed)).assertEqual("boolean"); + expect(detailed).assertEqual(false) + done(); + console.log('------------------ ' + TAG_TEST_0700 + ' end -------------------'); + }); + + /* + * @tc.number: context_isRamConstrainedDevice_test_0200 + * @tc.name: isRamConstrainedDevice : Obtains whether the current device has low ram. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it(TAG_TEST_0800, 0, async function (done) { + console.info(TAG_TEST_0800 + 'callBack START'); + var startTime = await Utils.getNowTime(); + abilityManager.isRamConstrainedDevice((error, data) => { + var endTime = Utils.getNowTime(); + Utils.getDurationTime(TAG_TEST_0500, startTime, endTime) + console.info(TAG_TEST_0800 + ' callBack error is:' + error); + console.info(TAG_TEST_0800 + ' callBack data is:' + JSON.stringify(data)); + expect(typeof (data)).assertEqual("boolean"); + expect(data).assertEqual(false); + done(); + }) + console.log('------------------ ' + TAG_TEST_0800 + ' end -------------------'); + }); + /* + * @tc.number: context_featureAbility_test_0100 + * @tc.name: featureAbility.ErrorCode : featureAbility.ErrorCode + * @tc.desc: Check the featureAbility.ErrorCode.NO_ERROR + * @tc.level 0 + */ + it(TAG_TEST_0900, 0, async function (done) { + console.info(TAG_TEST_0900 + ' NO_ERROR START'); + var no_error = ability_featureAbility.ErrorCode.NO_ERROR + console.info(TAG_TEST_0900 + ' featureAbility no_error is: ' + no_error); + expect(typeof (no_error)).assertEqual("number"); + expect(no_error).assertEqual(0); + done(); + console.log('------------------ ' + TAG_TEST_0900 + ' end -------------------'); + }); + + /* + * @tc.number: context_featureAbility_test_0200 + * @tc.name: featureAbility.ErrorCode : featureAbility.ErrorCode + * @tc.desc: Check the featureAbility.ErrorCode.INVALID_PARAMETER + * @tc.level 0 + */ + it(TAG_TEST_0010, 0, async function (done) { + console.info(TAG_TEST_0010 + ' INVALID_PARAMETER START'); + var invalid_parameter = ability_featureAbility.ErrorCode.INVALID_PARAMETER + console.info(TAG_TEST_0010 + ' featureAbility invalid_parameter is: ' + invalid_parameter); + expect(typeof (invalid_parameter)).assertEqual("number"); + expect(invalid_parameter).assertEqual(-1); + done(); + console.log('------------------ ' + TAG_TEST_0010 + ' end -------------------'); + }); + + /* + * @tc.number: context_featureAbility_test_0300 + * @tc.name: featureAbility.ErrorCode : featureAbility.ErrorCode + * @tc.desc: Check the featureAbility.ErrorCode.ABILITY_NOT_FOUND + * @tc.level 0 + */ + it(TAG_TEST_0011, 0, async function (done) { + console.info(TAG_TEST_0011 + ' ABILITY_NOT_FOUND START'); + var ability_not_found = ability_featureAbility.ErrorCode.ABILITY_NOT_FOUND + console.info(TAG_TEST_0011 + ' featureAbility ability_not_found is: ' + ability_not_found); + expect(typeof (ability_not_found)).assertEqual("number"); + expect(ability_not_found).assertEqual(-2); + done(); + console.log('------------------ ' + TAG_TEST_0011 + ' end -------------------'); + }); + + /* + * @tc.number: context_featureAbility_test_0400 + * @tc.name: featureAbility.ErrorCode : featureAbility.ErrorCode + * @tc.desc: Check the featureAbility.ErrorCode.PERMISSION_DENY + * @tc.level 0 + */ + it(TAG_TEST_0012, 0, async function (done) { + console.info(TAG_TEST_0012 + ' PERMISSION_DENY START'); + var permission_deny = ability_featureAbility.ErrorCode.PERMISSION_DENY + console.info(TAG_TEST_0012 + ' featureAbility permission_deny is: ' + permission_deny); + expect(typeof (permission_deny)).assertEqual("number"); + expect(permission_deny).assertEqual(-3); + done(); + console.log('------------------ ' + TAG_TEST_0012 + ' end -------------------'); + }); + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets new file mode 100644 index 000000000..82186bfa4 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets @@ -0,0 +1,333 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, it, expect} from 'hypium/index'; +import Utils from './Utils'; +import ability_featureAbility from '@ohos.ability.featureAbility'; + +export default function getHapModuleInfoJsunit() { + describe('appInfoTest_ability_3', function () { + + /** + * @tc.number: context_getAbilityInfo_test_0100 + * @tc.name: getAbilityInfo:Query the current attributionability details. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it('context_getAbilityInfo_test_0100', 0, async function (done) { + console.info('[context_getAbilityInfo_test_0100] START'); + await Utils.sleep(1000); + var timeOldStamp = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + await context.getAbilityInfo() + .then((data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getAbilityInfo_test_0100', timeOldStamp, timeNewStamp); + console.info('[context_getAbilityInfo_test_0100] data is:' + JSON.stringify(data)); + expect(typeof (data)).assertEqual("object"); + }).catch((error) => { + console.error('[context_getAbilityInfo_test_0100] failed:' + JSON.stringify(error)); + }) + var promise = await context.getAbilityInfo(); + console.info('--[context_getAbilityInfo_test_0100] check---'); + checkAbilityInfo('context_getAbilityInfo_test_0100', promise); + console.info('[context_getAbilityInfo_test_0100] FINISH'); + done(); + }); + + async function startAbility2() { + var str = { + "want": { + "bundleName": "com.ohos.acecollaboration", + "abilityName": "com.ohos.acecollaboration.MainAbility2", + }, + }; + ability_featureAbility.startAbility(str).then((data) => { + console.info('context_getAbilityInfo_test_0300 startMainAbility2 succeeded: ' + JSON.stringify(data)); + }).catch((error) => { + console.error('context_getAbilityInfo_test_0300 startMainAbility2 failed. Cause: ' + JSON.stringify(error)); + }); + } + + /** + * @tc.number: context_getAbilityInfo_test_0200 + * @tc.name: getAbilityInfo:Query the current attributionability details. + * @tc.desc: Check the return value of the interface (by AsyncCallback) + * @tc.level 0 + */ + it('context_getAbilityInfo_test_0200', 0, async function (done) { + try { + console.info('[context_getAbilityInfo_test_0200] START'); + await Utils.sleep(1000); + var timeOldStamp = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + context.getAbilityInfo((error, data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getAbilityInfo_test_0200', timeOldStamp, timeNewStamp); + console.info('[context_getAbilityInfo_test_0200] data is:' + JSON.stringify(data)); + expect(typeof (data)).assertEqual("object"); + }); + } catch (error) { + console.error('[context_getAbilityInfo_test_0200] failed: ' + JSON.stringify(error)); + } + var callback = await context.getAbilityInfo(); + console.info('---[context_getAbilityInfo_test_0200] check---'); + checkAbilityInfo('context_getAbilityInfo_test_0200', callback); + console.info('[context_getAbilityInfo_test_0200] FINISH'); + done(); + }) + + + /** + * @tc.number: context_getAbilityInfo_test_0300_1 + * @tc.name: getAbilityInfo:Query the current attributionability details. + * @tc.desc: Check the return value of the interface + * @tc.level 0 + */ + it('context_getAbilityInfo_test_0300_1', 0, async function (done) { + console.info('[context_getAbilityInfo_test_0300] STARTability'); + startAbility2(); + done(); + }); + + /** + * @tc.number: context_getAbilityInfo_test_0400 + * @tc.name: getAbilityInfo:Query the current attributionability details. + * @tc.desc: Check the return value of the interface (by promise) + * @tc.level 0 + */ + it('context_getAbilityInfo_test_0400', 0, async function (done) { + console.info('[context_getAbilityInfo_test_0400] START'); + await Utils.sleep(1000); + var timeOldStamp = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + await context.getAbilityInfo() + .then((data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getAbilityInfo_test_0400', timeOldStamp, timeNewStamp); + console.info('[context_getAbilityInfo_test_0400] data is:' + JSON.stringify(data)); + expect(typeof (data)).assertEqual("object"); + }).catch((error) => { + console.error('[context_getAbilityInfo_test_0400] failed:' + JSON.stringify(error)); + }) + var promise = await context.getAbilityInfo(); + console.info('--[context_getAbilityInfo_test_0400] check---'); + checkAbilityInfo('context_getAbilityInfo_test_0400', promise); + console.info('[context_getAbilityInfo_test_0400] FINISH'); + done(); + }); + + function checkAbilityInfo(msg, data) { + console.log(msg + "checkAbilityInfo start " + JSON.stringify(data)); + console.log(msg + "checkAbilityInfo bundleName : " + data.bundleName); + console.log(msg + "checkAbilityInfo name : " + data.name); + console.log(msg + "checkAbilityInfo label : " + data.label); + console.log(msg + "checkAbilityInfo description : " + data.description); + console.log(msg + "checkAbilityInfo icon : " + data.icon); + console.log(msg + "checkAbilityInfo descriptionId : " + data.descriptionId); + console.log(msg + "checkAbilityInfo iconId : " + data.iconId); + console.log(msg + "checkAbilityInfo moduleName : " + data.moduleName); + console.log(msg + "checkAbilityInfo process : " + data.process); + console.log(msg + "checkAbilityInfo targetAbility : " + data.targetAbility); + console.log(msg + "checkAbilityInfo backgroundModes : " + data.backgroundModes); + console.log(msg + "checkAbilityInfo isVisible : " + data.isVisible); + console.log(msg + "checkAbilityInfo formEnabled : " + data.formEnabled); + console.log(msg + "checkAbilityInfo type : " + data.type) + console.log(msg + "checkAbilityInfo orientation : " + data.orientation); + console.log(msg + "checkAbilityInfo launchMode : " + data.launchMode); + console.log(msg + "checkAbilityInfo permissions length : " + data.permissions.length); + for (var j = 0; j < data.permissions.length; j++) { + console.log(msg + "getAbilityInfo data.permissions[" + j + "] : " + data.permissions[j]); + } + console.log(msg + "checkAbilityInfo deviceTypes length : " + data.deviceTypes.length); + for (var k = 0; k < data.deviceTypes.length; k++) { + console.log(msg + "getAbilityInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]); + } + console.log(msg + "checkAbilityInfo deviceCapabilities length : " + data.deviceCapabilities.length); + for (var i = 0; i < data.deviceCapabilities.length; i++) { + console.log(msg + "getAbilityInfo data.deviceCapabilities[" + i + "] : " + data.deviceCapabilities[i]); + } + console.log(msg + "checkAbilityInfo readPermission : " + data.readPermission); + console.log(msg + "checkAbilityInfo writePermission : " + data.writePermission); + console.log(msg + "checkAbilityInfo formEntity : " + data.formEntity); + console.log(msg + "checkAbilityInfo minFormHeight : " + data.minFormHeight); + console.log(msg + "checkAbilityInfo defaultFormHeight : " + data.defaultFormHeight); + console.log(msg + "checkAbilityInfo minFormWidth : " + data.minFormWidth); + console.log(msg + "checkAbilityInfo defaultFormWidth : " + data.defaultFormWidth); + console.log(msg + "checkAbilityInfo uri : " + data.uri); + console.log(msg + "checkAbilityInfo customizeData : " + data.customizeData); + console.log(msg + "checkAbilityInfo labelId : " + data.labelId); + console.log(msg + "checkAbilityInfo subType : " + data.subType); + + expect(typeof (data)).assertEqual("object"); + expect(typeof (data.bundleName)).assertEqual("string"); + expect(typeof (data.name)).assertEqual("string"); + expect(typeof (data.label)).assertEqual("string"); + expect(typeof (data.description)).assertEqual("string"); + expect(typeof (data.icon)).assertEqual("string"); + expect(typeof (data.labelId)).assertEqual("number"); + expect(typeof (data.descriptionId)).assertEqual("number"); + expect(typeof (data.iconId)).assertEqual("number"); + expect(typeof (data.moduleName)).assertEqual("string"); + expect(typeof (data.process)).assertEqual("string"); + expect(typeof (data.targetAbility)).assertEqual("string"); + expect(typeof (data.backgroundModes)).assertEqual("number"); + expect(typeof (data.isVisible)).assertEqual("boolean"); + expect(typeof (data.formEnabled)).assertEqual("boolean"); + expect(typeof (data.type)).assertEqual("number"); + expect(typeof (data.subType)).assertEqual("number"); + expect(typeof (data.orientation)).assertEqual("number"); + expect(typeof (data.launchMode)).assertEqual("number"); + expect(Array.isArray(data.permissions)).assertEqual(true); + expect(Array.isArray(data.deviceTypes)).assertEqual(true); + expect(Array.isArray(data.deviceCapabilities)).assertEqual(true); + expect(typeof (data.readPermission)).assertEqual("string"); + expect(typeof (data.writePermission)).assertEqual("string"); + expect(typeof (data.applicationInfo)).assertEqual("object"); + expect(typeof (data.formEntity)).assertEqual("number"); + expect(typeof (data.minFormHeight)).assertEqual("number"); + expect(typeof (data.defaultFormHeight)).assertEqual("number"); + expect(typeof (data.minFormWidth)).assertEqual("number"); + expect(typeof (data.defaultFormWidth)).assertEqual("number"); + expect(typeof (data.uri)).assertEqual("string"); + + expect(data.bundleName).assertEqual("com.ohos.acecollaboration"); + expect(data.name).assertEqual("com.ohos.acecollaboration.MainAbility"); + expect(data.label).assertEqual("$string:entry_MainAbility"); + expect(data.description).assertEqual("$string:mainability_description"); + expect(data.icon).assertEqual("$media:icon"); + expect(data.descriptionId > 0).assertTrue(); + expect(data.iconId > 0).assertTrue(); + expect(data.moduleName).assertEqual("entry"); + expect(data.process).assertEqual(""); + expect(data.targetAbility).assertEqual(""); + expect(data.backgroundModes).assertEqual(0); + expect(data.isVisible).assertEqual(true); + expect(data.formEnabled).assertEqual(false); + expect(data.type).assertEqual(1); + expect(data.orientation).assertEqual(0); + expect(data.launchMode).assertEqual(1); + expect(data.deviceTypes[0]).assertEqual("phone"); + expect(data.readPermission).assertEqual(""); + expect(data.writePermission).assertEqual(""); + checkApplicationInfo(msg, data.applicationInfo); + expect(data.formEntity).assertEqual(0); + expect(data.minFormHeight).assertEqual(0); + expect(data.defaultFormHeight).assertEqual(0); + expect(data.minFormWidth).assertEqual(0); + expect(data.defaultFormWidth).assertEqual(0); + expect(data.uri).assertEqual(""); + expect(data.labelId > 0).assertTrue(); + expect(data.subType).assertEqual(0); + + console.log(msg + "---checkAbilityInfo End--- "); + } + + function checkApplicationInfo(msg, info) { + console.log(msg + "checkApplicationInfo start : " + JSON.stringify(info)); + console.log(msg + "checkApplicationInfo name : " + info.name); + console.log(msg + "checkApplicationInfo description : " + info.description); + console.log(msg + "checkApplicationInfo descriptionId : " + info.descriptionId); + console.log(msg + "checkApplicationInfo systemApp : " + info.systemApp); + console.log(msg + "checkApplicationInfo enabled : " + info.enabled); + console.log(msg + "checkApplicationInfo label : " + info.label); + console.log(msg + "checkApplicationInfo labelId : " + info.labelId); + console.log(msg + "checkApplicationInfo icon : " + info.icon); + console.log(msg + "checkApplicationInfo iconId : " + info.iconId); + console.log(msg + "checkApplicationInfo process : " + info.process); + console.log(msg + "checkApplicationInfo supportedModes : " + info.supportedModes); + + console.log(msg + "checkApplicationInfo moduleSourceDirs length : " + info.moduleSourceDirs.length); + for (var j = 0; j < info.moduleSourceDirs.length; j++) { + console.log(msg + "checkApplicationInfo info.moduleSourceDirs[" + j + "] : " + info.moduleSourceDirs[j]); + } + console.log(msg + "checkApplicationInfo permissions length : " + info.permissions.length); + for (var k = 0; k < info.permissions.length; k++) { + console.log(msg + "checkApplicationInfo info.permissions[" + k + "] : " + info.permissions[k]); + } + console.log(msg + "checkApplicationInfo moduleInfos length : " + info.moduleInfos.length); + for (var i = 0; i < info.moduleInfos.length; i++) { + console.log(msg + "checkApplicationInfo info.moduleInfos[" + i + "].moduleName : " + + info.moduleInfos[i].moduleName); + console.log(msg + "checkApplicationInfo info.moduleInfos[" + i + "].moduleSourceDir : " + + info.moduleInfos[i].moduleSourceDir); + } + console.log(msg + "checkApplicationInfo entryDir : " + info.entryDir); + + expect(typeof (info)).assertEqual("object"); + expect(typeof (info.name)).assertEqual("string"); + expect(typeof (info.description)).assertEqual("string"); + expect(typeof (info.descriptionId)).assertEqual("number"); + expect(typeof (info.systemApp)).assertEqual("boolean"); + expect(typeof (info.enabled)).assertEqual("boolean"); + expect(typeof (info.label)).assertEqual("string"); + expect(typeof (info.labelId)).assertEqual("string"); + expect(typeof (info.icon)).assertEqual("string"); + expect(typeof (info.iconId)).assertEqual("string"); + expect(typeof (info.process)).assertEqual("string"); + expect(typeof (info.supportedModes)).assertEqual("number"); + expect(Array.isArray(info.moduleSourceDirs)).assertEqual(true); + expect(Array.isArray(info.permissions)).assertEqual(true); + expect(Array.isArray(info.moduleInfos)).assertEqual(true); + expect(typeof (info.entryDir)).assertEqual("string"); + + expect(info.name).assertEqual("com.ohos.acecollaboration"); + expect(info.description).assertEqual("$string:mainability_description"); + expect(info.descriptionId > 0).assertTrue(); + expect(info.systemApp).assertEqual(true); + expect(info.enabled).assertEqual(true); + expect(info.label).assertEqual("$string:entry_MainAbility"); + expect(info.icon).assertEqual("$media:icon"); + expect(info.process).assertEqual(""); + expect(info.supportedModes).assertEqual(0); + expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + if (info.moduleSourceDirs.length == 1){ + expect(info.moduleInfos[0].moduleName).assertEqual("entry"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + }else if(info.moduleSourceDirs.length == 2) { + if (info.moduleInfos[0].moduleName == "myapplication1") { + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication1"); + expect(info.moduleInfos[1].moduleName).assertEqual("entry"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + }else{ + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication2"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication2"); + expect(info.moduleInfos[1].moduleName).assertEqual("entry"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + } + }else { + expect(info.moduleInfos[0].moduleName).assertEqual("myapplication1"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication1"); + expect(info.moduleInfos[1].moduleName).assertEqual("myapplication2"); + expect(info.moduleInfos[1].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.example.myapplication2"); + expect(info.moduleInfos[2].moduleName).assertEqual("entry"); + expect(info.moduleInfos[2].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + + "com.ohos.acecollaboration/com.ohos.acecollaboration"); + } + + console.log(msg + "---checkApplicationInfo End--- "); + + } + + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets new file mode 100644 index 000000000..df44372bd --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, it, expect} from 'hypium/index'; +import Utils from './Utils'; +import ability_featureAbility from '@ohos.ability.featureAbility'; + +export default function getHapModuleInfoJsunit() { + describe('appInfoTest_ability_5', function () { + /** + * @tc.number: context_getAppVersionInfo_test_0100 + * @tc.name: getAppVersionInfo:Gets the version information for the application. + * @tc.desc: Check the return type of the interface (by Promise) + * @tc.level 0 + */ + it('context_getAppVersionInfo_test_0100', 0, async function (done) { + console.info('[context_getAppVersionInfo_test_0100] START'); + await Utils.sleep(1000); + var timeOldStamp = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + context.getAppVersionInfo() + .then((data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getAppVersionInfo_test_0100', timeOldStamp, timeNewStamp); + console.info('[context_getAppVersionInfo_test_0100] data is:' + JSON.stringify(data)); + expect(typeof (data)).assertEqual("object"); + }).catch((error) => { + console.error('[context_getAppVersionInfo_test_0100] failed:' + JSON.stringify(error)); + }) + var promise = await context.getAppVersionInfo(); + console.info('---[context_getAppVersionInfo_test_0100] check---'); + checkAppVersionInfo('context_getAppVersionInfo_test_0100', promise); + console.info('[context_getAppVersionInfo_test_0100] FINISH'); + done(); + }); + + /** + * @tc.number: context_getAppVersionInfo_test_0200 + * @tc.name: getAppVersionInfo:Gets the version information for the application. + * @tc.desc: Check the return type of the interface (by Callback) + * @tc.level 0 + */ + it('context_getAppVersionInfo_test_0200', 0, async function (done) { + try { + console.info('[context_getAppVersionInfo_test_0200] START'); + await Utils.sleep(1000); + var timeOldStamp = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + context.getAppVersionInfo((error, data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getAppVersionInfo_test_0200', timeOldStamp, timeNewStamp); + console.info('[context_getAppVersionInfo_test_0200] data is:' + JSON.stringify(data)); + expect(typeof (data)).assertEqual("object"); + }); + } + catch (error) { + console.error('[context_getAppVersionInfo_test_0200] failed: ' + JSON.stringify(error)); + } + var callback = await context.getAppVersionInfo(); + console.info('---[context_getAppVersionInfo_test_0200] check---'); + checkAppVersionInfo('context_getAppVersionInfo_test_0200', callback); + console.info('[context_getAppVersionInfo_test_0200] FINISH'); + done(); + }); + + function checkAppVersionInfo(msg, data) { + console.log(msg + "checkAppVersionInfo start : " + JSON.stringify(data)); + console.log(msg + "checkAppVersionInfo appName : " + data.appName); + console.log(msg + "checkAppVersionInfo versionCode : " + data.versionCode); + console.log(msg + "checkAppVersionInfo versionName : " + data.versionName); + expect(typeof (data)).assertEqual("object"); + expect(typeof (data.appName)).assertEqual("string"); + expect(typeof (data.versionCode)).assertEqual("number"); + expect(typeof (data.versionName)).assertEqual("string"); + expect(data.appName).assertEqual(""); + expect(data.versionCode).assertEqual(1000000); + expect(data.versionName).assertEqual("1.0.0"); + console.log(msg + "---checkAppVersionInfo End--- "); + } + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets new file mode 100644 index 000000000..915bf9f23 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, it, expect} from 'hypium/index'; +import Utils from './Utils'; +import ability_featureAbility from '@ohos.ability.featureAbility'; + +export default function getHapModuleInfoJsunit() { + describe('appInfoTest_ability_4', function () { + /** + * @tc.number: context_getApplicationContext_test_0100 + * @tc.name: getApplicationContext:Gets the application context information. + * @tc.desc: Check the return value of the interface + * @tc.level 0 + */ + it('context_getApplicationContext_test_0100', 0, async function (done) { + try { + console.info('[context_getApplicationContext_test_0100] START'); + await Utils.sleep(1000); + var timeOldStamp = await Utils.getNowTime(); + var context = ability_featureAbility.getContext().getApplicationContext(); + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getApplicationContext_test_0100', timeOldStamp, timeNewStamp); + console.info('[context_getApplicationContext_test_0100] data is:' + JSON.stringify(context)); + } + catch (error) { + console.error('[context_getApplicationContext_test_0100] failed:' + JSON.stringify(error)); + } + expect(typeof (context)).assertEqual("object"); + console.info('[context_getApplicationContext_test_0100] FINISH'); + done(); + }); + + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets new file mode 100644 index 000000000..df1ef556f --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets @@ -0,0 +1,233 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, it, expect} from 'hypium/index'; +import Utils from './Utils'; +import ability_featureAbility from '@ohos.ability.featureAbility'; + +export default function getHapModuleInfoJsunit() { + describe('appInfoTest_ability_6', function () { + /** + * @tc.number: context_getHapModuleInfo_test_0100 + * @tc.name: getHapModuleInfo:Obtains the HapModuleInfo object of the application. + * @tc.desc: Check the return type of the interface (by Promise) + * @tc.level 0 + */ + it('context_getHapModuleInfo_test_0100', 0, async function (done) { + console.info('[context_getHapModuleInfo_test_0100] START'); + await Utils.sleep(1000); + var timeOldStamp = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + context.getHapModuleInfo() + .then((data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getHapModuleInfo_test_0100', timeOldStamp, timeNewStamp); + console.info('[context_getHapModuleInfo_test_0100] data is:' + JSON.stringify(data)); + expect(typeof (data)).assertEqual("object"); + }) + .catch((error) => { + console.error('[context_getHapModuleInfo_test_0100] failed:' + JSON.stringify(error)); + }) + var promise = await context.getHapModuleInfo(); + console.info('---[context_getHapModuleInfo_test_0100] check---'); + checkHapModuleInfo('context_getHapModuleInfo_test_0100', promise); + console.info('[context_getHapModuleInfo_test_0100] FINISH'); + done(); + }); + + /** + * @tc.number: context_getHapModuleInfo_test_0200 + * @tc.name: getHapModuleInfo:Obtains the HapModuleInfo object of the application. + * @tc.desc: Check the return type of the interface (by Callback) + * @tc.level 0 + */ + it('context_getHapModuleInfo_test_0200', 0, async function (done) { + let callback; + try { + console.info('[context_getHapModuleInfo_test_0200] START'); + var timeOldStamp = await Utils.getNowTime(); + var context = ability_featureAbility.getContext(); + context.getHapModuleInfo((error, data) => { + var timeNewStamp = Utils.getNowTime(); + Utils.getDurationTime('context_getHapModuleInfo_test_0200', timeOldStamp, timeNewStamp); + console.info('[context_getHapModuleInfo_test_0200] data is:' + JSON.stringify(data)); + callback = data; + expect(typeof (data)).assertEqual("object"); + }); + } catch (error) { + console.error('[context_getHapModuleInfo_test_0200] failed: ' + JSON.stringify(error)); + } + await Utils.sleep(1000); + console.info('---[context_getHapModuleInfo_test_0200] check---'); + checkHapModuleInfo('context_getHapModuleInfo_test_0200', callback); + console.info('[context_getHapModuleInfo_test_0200] FINISH'); + done(); + }); + + function checkHapModuleInfo(msg, data) { + console.log(msg + "checkHapModuleInfo start " + JSON.stringify(data)); + console.log(msg + "checkHapModuleInfo name : " + data.name); + console.log(msg + "checkHapModuleInfo description : " + data.description); + console.log(msg + "checkHapModuleInfo descriptionId : " + data.descriptionId); + console.log(msg + "checkHapModuleInfo icon : " + data.icon); + console.log(msg + "checkHapModuleInfo label : " + data.label); + console.log(msg + "checkHapModuleInfo labelId : " + data.labelId); + console.log(msg + "checkHapModuleInfo iconId : " + data.iconId); + console.log(msg + "checkHapModuleInfo backgroundImg : " + data.backgroundImg); + console.log(msg + "checkHapModuleInfo supportedModes : " + data.supportedModes); + console.log(msg + "checkHapModuleInfo reqCapabilities length : " + data.reqCapabilities.length); + for (var j = 0; j < data.reqCapabilities.length; j++) { + console.log(msg + "getHapModuleInfo data.reqCapabilities[" + j + "] : " + data.reqCapabilities[j]); + } + console.log(msg + "checkHapModuleInfo deviceTypes length : " + data.deviceTypes.length); + for (var k = 0; k < data.deviceTypes.length; k++) { + console.log(msg + "getHapModuleInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]); + } + console.log(msg + "checkHapModuleInfo abilityInfos length : " + data.abilityInfos.length); + console.log(msg + "checkHapModuleInfo moduleName : " + data.moduleName); + console.log(msg + "checkHapModuleInfo mainAbilityName : " + data.mainAbilityName); + console.log(msg + "checkHapModuleInfo installationFree : " + data.installationFree); + expect(typeof (data)).assertEqual("object"); + expect(typeof (data.name)).assertEqual("string"); + expect(typeof (data.description)).assertEqual("string"); + expect(typeof (data.descriptionId)).assertEqual("number"); + expect(typeof (data.icon)).assertEqual("string"); + expect(typeof (data.label)).assertEqual("string"); + expect(typeof (data.labelId)).assertEqual("number"); + expect(typeof (data.iconId)).assertEqual("number"); + expect(typeof (data.backgroundImg)).assertEqual("string"); + expect(typeof (data.supportedModes)).assertEqual("number"); + expect(Array.isArray(data.reqCapabilities)).assertEqual(true); + expect(Array.isArray(data.deviceTypes)).assertEqual(true); + expect(Array.isArray(data.abilityInfos)).assertEqual(true); + expect(typeof (data.moduleName)).assertEqual("string"); + expect(typeof (data.mainAbilityName)).assertEqual("string"); + expect(typeof (data.installationFree)).assertEqual("boolean"); + expect(data.name).assertEqual("com.ohos.acecollaboration"); + expect(data.description).assertEqual(""); + expect(data.descriptionId).assertEqual(0); + expect(data.icon).assertEqual("$media:icon"); + expect(data.label).assertEqual("$string:entry_MainAbility"); + expect(data.labelId).assertEqual(0); + expect(data.iconId).assertEqual(0); + expect(data.backgroundImg).assertEqual(""); + expect(data.supportedModes).assertEqual(0); + expect(data.deviceTypes[0]).assertEqual("phone"); + checkAbilityInfo(msg,data.abilityInfos[0]); + expect(data.moduleName).assertEqual("entry") + expect(data.mainAbilityName).assertEqual(""); + expect(data.installationFree).assertEqual(false); + console.log(msg + "---checkHapModuleInfo End---"); + } + + function checkAbilityInfo(msg,data) { + console.log(msg+ "checkAbilityInfo start " + JSON.stringify(data)); + console.log(msg+ "checkAbilityInfo bundleName : " + data.bundleName); + console.log(msg+ "checkAbilityInfo name : " + data.name); + console.log(msg+ "checkAbilityInfo label : " + data.label); + console.log(msg+ "checkAbilityInfo description : " + data.description); + console.log(msg+ "checkAbilityInfo icon : " + data.icon); + console.log(msg+ "checkAbilityInfo descriptionId : " + data.descriptionId); + console.log(msg+ "checkAbilityInfo iconId : " + data.iconId); + console.log(msg+ "checkAbilityInfo moduleName : " + data.moduleName); + console.log(msg+ "checkAbilityInfo process : " + data.process); + console.log(msg+ "checkAbilityInfo targetAbility : " + data.targetAbility); + console.log(msg+ "checkAbilityInfo backgroundModes : " + data.backgroundModes); + console.log(msg+ "checkAbilityInfo isVisible : " + data.isVisible); + console.log(msg+ "checkAbilityInfo formEnabled : " + data.formEnabled); + console.log(msg+ "checkAbilityInfo type : " + data.type) + console.log(msg+ "checkAbilityInfo orientation : " + data.orientation); + console.log(msg+ "checkAbilityInfo launchMode : " + data.launchMode); + console.log(msg+ "checkAbilityInfo permissions length : " + data.permissions.length); + for (var j = 0; j < data.permissions.length; j++) { + console.log(msg+ "getAbilityInfo data.permissions[" + j + "] : " + data.permissions[j]); + } + console.log(msg+ "checkAbilityInfo deviceTypes length : " + data.deviceTypes.length); + for (var k = 0; k < data.deviceTypes.length; k++) { + console.log(msg+ "getAbilityInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]); + } + console.log(msg+ "checkAbilityInfo deviceCapabilities length : " + data.deviceCapabilities.length); + for (var i = 0; i < data.deviceCapabilities.length; i++) { + console.log(msg+ "getAbilityInfo data.deviceCapabilities[" + i + "] : " + data.deviceCapabilities[i]); + } + console.log(msg+ "checkAbilityInfo readPermission : " + data.readPermission); + console.log(msg+ "checkAbilityInfo writePermission : " + data.writePermission); + console.log(msg+ "checkAbilityInfo formEntity : " + data.formEntity); + console.log(msg+ "checkAbilityInfo minFormHeight : " + data.minFormHeight); + console.log(msg+ "checkAbilityInfo defaultFormHeight : " + data.defaultFormHeight); + console.log(msg+ "checkAbilityInfo minFormWidth : " + data.minFormWidth); + console.log(msg+ "checkAbilityInfo defaultFormWidth : " + data.defaultFormWidth); + console.log(msg+ "checkAbilityInfo uri : " + data.uri); + console.log(msg+ "checkAbilityInfo labelId : " + data.labelId); + console.log(msg+ "checkAbilityInfo subType : " + data.subType); + expect(typeof (data)).assertEqual("object"); + expect(typeof (data.bundleName)).assertEqual("string"); + expect(typeof (data.name)).assertEqual("string"); + expect(typeof (data.label)).assertEqual("string"); + expect(typeof (data.description)).assertEqual("string"); + expect(typeof (data.icon)).assertEqual("string"); + expect(typeof (data.labelId)).assertEqual("number"); + expect(typeof (data.descriptionId)).assertEqual("number"); + expect(typeof (data.iconId)).assertEqual("number"); + expect(typeof (data.moduleName)).assertEqual("string"); + expect(typeof (data.process)).assertEqual("string"); + expect(typeof (data.targetAbility)).assertEqual("string"); + expect(typeof (data.backgroundModes)).assertEqual("number"); + expect(typeof (data.isVisible)).assertEqual("boolean"); + expect(typeof (data.formEnabled)).assertEqual("boolean"); + expect(typeof (data.type)).assertEqual("number"); + expect(typeof (data.subType)).assertEqual("number"); + expect(typeof (data.orientation)).assertEqual("number"); + expect(typeof (data.launchMode)).assertEqual("number"); + expect(Array.isArray(data.permissions)).assertEqual(true); + expect(Array.isArray(data.deviceTypes)).assertEqual(true); + expect(Array.isArray(data.deviceCapabilities)).assertEqual(true); + expect(typeof (data.readPermission)).assertEqual("string"); + expect(typeof (data.writePermission)).assertEqual("string"); + expect(typeof (data.applicationInfo)).assertEqual("object"); + expect(typeof (data.formEntity)).assertEqual("number"); + expect(typeof (data.minFormHeight)).assertEqual("number"); + expect(typeof (data.defaultFormHeight)).assertEqual("number"); + expect(typeof (data.minFormWidth)).assertEqual("number"); + expect(typeof (data.defaultFormWidth)).assertEqual("number"); + expect(typeof (data.uri)).assertEqual("string"); + expect(data.bundleName).assertEqual("com.ohos.acecollaboration"); + expect(data.name).assertEqual("com.ohos.acecollaboration.MainAbility"); + expect(data.label).assertEqual("$string:entry_MainAbility"); + expect(data.description).assertEqual("$string:mainability_description"); + expect(data.icon).assertEqual("$media:icon"); + expect(data.moduleName).assertEqual("entry"); + expect(data.process).assertEqual(""); + expect(data.targetAbility).assertEqual(""); + expect(data.backgroundModes).assertEqual(0); + expect(data.isVisible).assertEqual(true); + expect(data.formEnabled).assertEqual(false); + expect(data.type).assertEqual(1); + expect(data.orientation).assertEqual(0); + expect(data.launchMode).assertEqual(1); + expect(data.deviceTypes[0]).assertEqual("phone"); + expect(data.readPermission).assertEqual(""); + expect(data.writePermission).assertEqual(""); + expect(data.formEntity).assertEqual(0); + expect(data.minFormHeight).assertEqual(0); + expect(data.defaultFormHeight).assertEqual(0); + expect(data.minFormWidth).assertEqual(0); + expect(data.defaultFormWidth).assertEqual(0); + expect(data.uri).assertEqual(""); + expect(data.subType).assertEqual(0); + console.log(msg+ "---checkAbilityInfo End--- "); + } + + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..2a4a2f9f0 --- /dev/null +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,56 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "mainability_description", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + }, + { + "name": "description_serviceability2", + "value": "hap sample empty service" + }, + { + "name": "description_serviceability3", + "value": "hap sample empty service" + }, + { + "name": "description_serviceability4", + "value": "hap sample empty service" + }, + { + "name": "description_serviceability5", + "value": "hap sample empty service" + }, + { + "name": "description_mainability2", + "value": "eTS_Empty Ability2" + }, + { + "name": "entry_MainAbility2", + "value": "MainAbility2" + }, + { + "name": "description_serviceability6", + "value": "hap sample empty service" + }, + { + "name": "description_serviceability7", + "value": "hap sample empty service" + }, + { + "name": "TestAbility_desc", + "value": "description" + }, + { + "name": "TestAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsabilitymanageretstest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsabilitymanageretstest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsabilitymanageretstest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsabilitymanageretstest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actscalltest/BUILD.gn b/ability/ability_runtime/actscalltest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/BUILD.gn rename to ability/ability_runtime/actscalltest/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/AppScope/app.json b/ability/ability_runtime/actscalltest/systemappcalleea/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/AppScope/app.json rename to ability/ability_runtime/actscalltest/systemappcalleea/AppScope/app.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/AppScope/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemappcalleea/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemappcalleea/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actscalltest/systemappcalleea/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actscalltest/systemappcalleea/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/BUILD.gn b/ability/ability_runtime/actscalltest/systemappcalleea/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/BUILD.gn rename to ability/ability_runtime/actscalltest/systemappcalleea/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/Test.json b/ability/ability_runtime/actscalltest/systemappcalleea/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/Test.json rename to ability/ability_runtime/actscalltest/systemappcalleea/Test.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/SecondAbility/SecondAbility.ts new file mode 100644 index 000000000..b0f77555b --- /dev/null +++ b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/SecondAbility/SecondAbility.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemAppCalleeA MainAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA SecondAbility Call_Finish<======') + }) + + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemAppCalleeA MainAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +export default class SecondAbility extends Ability { + test2200(data) { + console.log("SystemAppCalleeA SecondAbility test2200"); + let recvData = new MySequenceable(0, '', ''); + data.readSequenceable(recvData); + let result = new MySequenceable(recvData.num + 1, recvData.str + "SystemAppCalleeA", ''); + return result; + } + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemAppCalleeA SecondAbility onCreate") + globalThis.abilityWant = want; + globalThis.abilityContext2 = this.context; + this.callee.on('test2200', this.test2200); + this.callee.on('testCall', testCall); + this.callee.on('testCallWithResult', testCallWithResult); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemAppCalleeA SecondAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemAppCalleeA SecondAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemAppCalleeA SecondAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemAppCalleeA SecondAbility onForeground"); + } + + onBackground() { + // Ability has back to background + console.log("SystemAppCalleeA SecondAbility onBackground") + } +}; diff --git a/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/ThirdAbility/ThirdAbility.ts b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/ThirdAbility/ThirdAbility.ts new file mode 100644 index 000000000..5fe516ffb --- /dev/null +++ b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/ThirdAbility/ThirdAbility.ts @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemAppCallerA MainAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA SecondAbility Call_Finish<======') + }) + + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemAppCallerA MainAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +export default class ThirdAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemAppCalleeA ThirdAbility onCreate") + this.callee.on('testCall', testCall); + this.callee.on('testCallWithResult', testCallWithResult); + globalThis.abilityWant = want; + globalThis.abilityContext3 = this.context; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemAppCalleeA ThirdAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemAppCalleeA ThirdAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemAppCalleeA ThirdAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemAppCalleeA ThirdAbility onForeground"); + } + + onBackground() { + // Ability has back to background + console.log("SystemAppCalleeA ThirdAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/module.json rename to ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcalleea/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalltest/systemappcalleea/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcalleea/signature/openharmony_sx.p7b rename to ability/ability_runtime/actscalltest/systemappcalleea/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/AppScope/app.json b/ability/ability_runtime/actscalltest/systemappcallera/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/AppScope/app.json rename to ability/ability_runtime/actscalltest/systemappcallera/AppScope/app.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/AppScope/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemappcallera/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemappcallera/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actscalltest/systemappcallera/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actscalltest/systemappcallera/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/BUILD.gn b/ability/ability_runtime/actscalltest/systemappcallera/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/BUILD.gn rename to ability/ability_runtime/actscalltest/systemappcallera/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/Test.json b/ability/ability_runtime/actscalltest/systemappcallera/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/Test.json rename to ability/ability_runtime/actscalltest/systemappcallera/Test.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/SecondAbility/SecondAbility.ts new file mode 100644 index 000000000..f341cffce --- /dev/null +++ b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/SecondAbility/SecondAbility.ts @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemAppCallerA SecondAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA SecondAbility Call_Finish<======') + }) + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemAppCallerA SecondAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +export default class SecondAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemAppCallerA SecondAbility onCreate") + globalThis.abilityWant = want; + globalThis.abilityContext = this.context; + this.callee.on('testCall', testCall); + this.callee.on('testCallWithResult', testCallWithResult); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemAppCallerA SecondAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemAppCallerA SecondAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemAppCallerA SecondAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemAppCallerA SecondAbility onForeground"); + if ((globalThis.abilityWant.parameters.case_num == "case0700") || + (globalThis.abilityWant.parameters.case_num == "case0800")) { + console.log("SystemAppCallerA SecondAbility special process in"); + var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; + var commonEventData = { + data: publishData, + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>SystemAppCallerA SecondAbility Call_Finish<======') + }) + } + } + + onBackground() { + // Ability has back to background + console.log("SystemAppCallerA SecondAbility onBackground") + } +}; diff --git a/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/ThirdAbility/ThirdAbility.ts b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/ThirdAbility/ThirdAbility.ts new file mode 100644 index 000000000..5f17f742f --- /dev/null +++ b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/ThirdAbility/ThirdAbility.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemAppCallerA ThirdAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA ThirdAbility Call_Finish<======') + }) + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemAppCallerA ThirdAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +export default class ThirdAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemAppCallerA ThirdAbility onCreate") + globalThis.abilityWant = want; + globalThis.abilityContext = this.context; + this.callee.on('testCall', testCall); + this.callee.on('testCallWithResult', testCallWithResult); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemAppCallerA ThirdAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemAppCallerA ThirdAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemAppCallerA ThirdAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemAppCallerA ThirdAbility onForeground"); + if ((globalThis.abilityWant.parameters.case_num == "case0700") || + (globalThis.abilityWant.parameters.case_num == "case0800")) { + var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; + var commonEventData = { + data: publishData, + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>SystemAppCallerA ThirdAbility Call_Finish<======') + }) + } + } + + onBackground() { + // Ability has back to background + console.log("SystemAppCallerA ThirdAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/module.json rename to ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallera/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalltest/systemappcallera/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallera/signature/openharmony_sx.p7b rename to ability/ability_runtime/actscalltest/systemappcallera/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/AppScope/app.json b/ability/ability_runtime/actscalltest/systemappcallerb/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/AppScope/app.json rename to ability/ability_runtime/actscalltest/systemappcallerb/AppScope/app.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/AppScope/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemappcallerb/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemappcallerb/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actscalltest/systemappcallerb/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actscalltest/systemappcallerb/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/BUILD.gn b/ability/ability_runtime/actscalltest/systemappcallerb/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/BUILD.gn rename to ability/ability_runtime/actscalltest/systemappcallerb/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/Test.json b/ability/ability_runtime/actscalltest/systemappcallerb/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/Test.json rename to ability/ability_runtime/actscalltest/systemappcallerb/Test.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/module.json rename to ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerb/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalltest/systemappcallerb/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerb/signature/openharmony_sx.p7b rename to ability/ability_runtime/actscalltest/systemappcallerb/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/AppScope/app.json b/ability/ability_runtime/actscalltest/systemappcallerc/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/AppScope/app.json rename to ability/ability_runtime/actscalltest/systemappcallerc/AppScope/app.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/AppScope/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemappcallerc/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemappcallerc/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actscalltest/systemappcallerc/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actscalltest/systemappcallerc/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/BUILD.gn b/ability/ability_runtime/actscalltest/systemappcallerc/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/BUILD.gn rename to ability/ability_runtime/actscalltest/systemappcallerc/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/Test.json b/ability/ability_runtime/actscalltest/systemappcallerc/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/Test.json rename to ability/ability_runtime/actscalltest/systemappcallerc/Test.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/module.json rename to ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actscalltest/systemappcallerc/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalltest/systemappcallerc/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemappcallerc/signature/openharmony_sx.p7b rename to ability/ability_runtime/actscalltest/systemappcallerc/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/AppScope/app.json b/ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/AppScope/app.json rename to ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/app.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/BUILD.gn b/ability/ability_runtime/actscalltest/systemcallentrytest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/BUILD.gn rename to ability/ability_runtime/actscalltest/systemcallentrytest/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/Test.json b/ability/ability_runtime/actscalltest/systemcallentrytest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/Test.json rename to ability/ability_runtime/actscalltest/systemcallentrytest/Test.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/SecondAbility/SecondAbility.ts new file mode 100644 index 000000000..9ea84282b --- /dev/null +++ b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/SecondAbility/SecondAbility.ts @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +var callerA = "SystemAppCallerA" +var callSeqA= new Array(); +var callerB = "SystemAppCallerB" +var callSeqB= new Array(); +var callerC = "SystemAppCallerC" +var callSeqC= new Array(); +var seq = 0; + +function isArrayEqual(a1, a2) { + return a1.length==a2.length && a1.every(function(value,index) { return value === a2[index]}); +} +function isArrayEqualWithoutOrder(a1, a2) { + if (a1.length != a2.length) { + return false; + } + for (let ind in a1) { + if (a2.indexOf(a1[ind]) == -1) { + return false; + }; + } + return true; +} +var expectStressResult=[0,1,2,3,4,5,6,7,8,9]; + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest SecondAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA SecondAbility Call_Finish<======') + }) + return recvSequence; +} + +function testCall2(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest SecondAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed2'; + var commonEventData = { + code: 0, + data: 'calleeCheckCall2Param', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA SecondAbility Call_Finish<======') + }) + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest SecondAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +function test2100ReleaseCallback(data) { + console.log('SystemCallTest SecondAbility test2100ReleaseCallback:' + data); + test2100ReleaseFlag = data.toString(); +} + +var test2100ReleaseFlag = ''; + +export default class SecondAbility extends Ability { + + test2100(data) { + let recvData = new MySequenceable(0, '', ''); + data.readSequenceable(recvData); + let want = { + bundleName: "com.example.systemcalltest", + abilityName: "com.example.systemcalltest.MainAbility", + }; + console.log("SystemCallTest SecondAbility test2100 before startAbilityByCall"); + let resultData = new MySequenceable(0, '', ''); + globalThis.abilityContext2.startAbilityByCall(want).then((caller) => { + let param = new MySequenceable(recvData.num + 1, recvData.str + "Second", recvData.result); + caller.onRelease(test2100ReleaseCallback); + for (let start=Date.now(); Date.now() - start <= 200;); + caller.callWithResult('test2100', param).then((data2) => { + data2.readSequenceable(resultData); + caller.release(); + for (let start=Date.now(); Date.now() - start <= 200;); + resultData.result = test2100ReleaseFlag; + let commonEventData = { + parameters: { + num: resultData.num, + str: resultData.str, + result: resultData.result, + } + }; + commonEvent.publish('call_case2100_test_result', commonEventData, (err) => { + console.log('SystemCallTest SecondAbility publish call_case2200_test_result event'); + }) + + }); + }); + return resultData; + } + + testOff(data) { + let recvSequence = new MySequenceable(0, '', ''); + data.readSequenceable(recvSequence); + return recvSequence; + } + + stressMethod(data) { + let recvData = new MySequenceable(0, '', ''); + data.readSequenceable(recvData); + console.log('SystemCallTest SecondAbility stressMethod caller ' + recvData.str); + if (recvData.str == callerA) { + callSeqA.push(recvData.num); + } else if (recvData.str == callerB) { + callSeqB.push(recvData.num); + } else if (recvData.str == callerC) { + callSeqC.push(recvData.num); + } + seq++; + if (seq >= 30) { + console.log('SystemCallTest SecondAbility stressMethod SystemAppCallerA ' + callSeqA); + console.log('SystemCallTest SecondAbility stressMethod SystemAppCallerB ' + callSeqB); + console.log('SystemCallTest SecondAbility stressMethod SystemAppCallerC ' + callSeqC); + let stressResult=isArrayEqualWithoutOrder(callSeqA, expectStressResult); + stressResult=stressResult&&isArrayEqualWithoutOrder(callSeqB, expectStressResult); + stressResult=stressResult&&isArrayEqualWithoutOrder(callSeqC, expectStressResult); + console.log('SystemCallTest SecondAbility stressMethod stressResult ' + stressResult); + let commonEventData = { + data: stressResult.toString(), + }; + commonEvent.publish('com.example.systemcalltest.Test5600', commonEventData, (err) => { + console.log('SystemCallTest SecondAbility stress test result event'); + }); + seq=0; + callSeqA = []; + callSeqB = []; + callSeqC = []; + } + return recvData; + } + + loopMethod(data) { + let recvData = new MySequenceable(0, '', ''); + data.readSequenceable(recvData); + return new MySequenceable(recvData.num + 1, recvData.str, ''); + } + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemCallTest SecondAbility onCreate") + globalThis.abilityWant = want; + globalThis.secondCallee = this.callee; + globalThis.abilityContext2 = this.context; + this.callee.on('test2100', this.test2100); + this.callee.on('testOff', this.testOff); + this.callee.on('stressMethod', this.stressMethod); + this.callee.on('loopMethod', this.loopMethod); + this.callee.on('testCall', testCall); + this.callee.on('testCall2', testCall2); + this.callee.on('testCallWithResult', testCallWithResult); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemCallTest SecondAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemCallTest SecondAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/second/second", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemCallTest SecondAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemCallTest SecondAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("SystemCallTest SecondAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/module.json rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalltest/systemcallentrytest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallentrytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actscalltest/systemcallentrytest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/AppScope/app.json b/ability/ability_runtime/actscalltest/systemcallfeature/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/AppScope/app.json rename to ability/ability_runtime/actscalltest/systemcallfeature/AppScope/app.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/AppScope/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemcallfeature/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemcallfeature/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actscalltest/systemcallfeature/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actscalltest/systemcallfeature/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/BUILD.gn b/ability/ability_runtime/actscalltest/systemcallfeature/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/BUILD.gn rename to ability/ability_runtime/actscalltest/systemcallfeature/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/Test.json b/ability/ability_runtime/actscalltest/systemcallfeature/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/Test.json rename to ability/ability_runtime/actscalltest/systemcallfeature/Test.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/module.json rename to ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actscalltest/systemcallfeature/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalltest/systemcallfeature/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/systemcallfeature/signature/openharmony_sx.p7b rename to ability/ability_runtime/actscalltest/systemcallfeature/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/AppScope/app.json b/ability/ability_runtime/actscalltest/thirdappa/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/AppScope/app.json rename to ability/ability_runtime/actscalltest/thirdappa/AppScope/app.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/AppScope/resources/base/element/string.json b/ability/ability_runtime/actscalltest/thirdappa/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/thirdappa/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actscalltest/thirdappa/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actscalltest/thirdappa/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/BUILD.gn b/ability/ability_runtime/actscalltest/thirdappa/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/BUILD.gn rename to ability/ability_runtime/actscalltest/thirdappa/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/Test.json b/ability/ability_runtime/actscalltest/thirdappa/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/Test.json rename to ability/ability_runtime/actscalltest/thirdappa/Test.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actscalltest/thirdappa/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actscalltest/thirdappa/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actscalltest/thirdappa/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actscalltest/thirdappa/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/module.json b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/module.json rename to ability/ability_runtime/actscalltest/thirdappa/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/thirdappa/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actscalltest/thirdappa/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actscalltest/thirdappa/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdappa/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalltest/thirdappa/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdappa/signature/openharmony_sx.p7b rename to ability/ability_runtime/actscalltest/thirdappa/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/AppScope/app.json b/ability/ability_runtime/actscalltest/thirdcalltest/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/AppScope/app.json rename to ability/ability_runtime/actscalltest/thirdcalltest/AppScope/app.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actscalltest/thirdcalltest/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/thirdcalltest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actscalltest/thirdcalltest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actscalltest/thirdcalltest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/BUILD.gn b/ability/ability_runtime/actscalltest/thirdcalltest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/BUILD.gn rename to ability/ability_runtime/actscalltest/thirdcalltest/BUILD.gn diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/Test.json b/ability/ability_runtime/actscalltest/thirdcalltest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/Test.json rename to ability/ability_runtime/actscalltest/thirdcalltest/Test.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/FifthAbility/FifthAbility.ts b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/FifthAbility/FifthAbility.ts new file mode 100644 index 000000000..66fbe5dde --- /dev/null +++ b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/FifthAbility/FifthAbility.ts @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest FifthAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA FifthAbility Call_Finish<======') + }) + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest FifthAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +export default class FifthAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemCallTest FifthAbility onCreate") + globalThis.abilityWant = want; + this.callee.on('testCall', testCall); + this.callee.on('testCallWithResult', testCallWithResult); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemCallTest FifthAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemCallTest FifthAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/second/second", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemCallTest FifthAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemCallTest FifthAbility onForeground") + if ((globalThis.abilityWant.parameters.case_num == "case1300") || + (globalThis.abilityWant.parameters.case_num == "case1400")) { + var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; + var commonEventData = { + data: publishData, + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>SystemAppCallerA FifthAbility Call_Finish<======') + }) + } + } + + onBackground() { + // Ability has back to background + console.log("SystemCallTest FifthAbility onBackground") + } +}; diff --git a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/ForthAbility/ForthAbility.ts b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/ForthAbility/ForthAbility.ts new file mode 100644 index 000000000..d59601caf --- /dev/null +++ b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/ForthAbility/ForthAbility.ts @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest ForthAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA ForthAbility Call_Finish<======') + }) + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest ForthAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +export default class ForthAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemCallTest ForthAbility onCreate") + globalThis.abilityWant = want; + this.callee.on('testCall', testCall); + this.callee.on('testCallWithResult', testCallWithResult); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemCallTest ForthAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemCallTest ForthAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/second/second", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemCallTest ForthAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemCallTest ForthAbility onForeground") + if ((globalThis.abilityWant.parameters.case_num == "case1300") || + (globalThis.abilityWant.parameters.case_num == "case1400")) { + var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; + var commonEventData = { + data: publishData, + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>SystemAppCallerA ForthAbility Call_Finish<======') + }) + } + } + + onBackground() { + // Ability has back to background + console.log("SystemCallTest ForthAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/SecondAbility/SecondAbility.ts new file mode 100644 index 000000000..062dcef19 --- /dev/null +++ b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/SecondAbility/SecondAbility.ts @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest SecondAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA SecondAbility Call_Finish<======') + }) + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest SecondAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +export default class SecondAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemCallTest SecondAbility onCreate") + globalThis.abilityWant = want; + this.callee.on('testCall', testCall); + this.callee.on('testCallWithResult', testCallWithResult); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemCallTest SecondAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemCallTest SecondAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/second/second", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemCallTest SecondAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemCallTest SecondAbility onForeground") + if ((globalThis.abilityWant.parameters.case_num == "case1300") || + (globalThis.abilityWant.parameters.case_num == "case1400")) { + var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; + var commonEventData = { + data: publishData, + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>SystemAppCallerA SecondAbility Call_Finish<======') + }) + } + } + + onBackground() { + // Ability has back to background + console.log("SystemCallTest SecondAbility onBackground") + } +}; diff --git a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/ThirdAbility/ThirdAbility.ts b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/ThirdAbility/ThirdAbility.ts new file mode 100644 index 000000000..9aa3312ee --- /dev/null +++ b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/ThirdAbility/ThirdAbility.ts @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +class MySequenceable { + num: number = 0; + str: String = ""; + result: String = ""; + + constructor(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + setMySequence(num, string, result) { + this.num = num; + this.str = string; + this.result = result; + } + + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + messageParcel.writeString(this.result); + return true; + } + + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + this.result = messageParcel.readString(); + return true; + } +} + +function testCall(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest ThirdAbility on testCall <======') + data.readSequenceable(recvSequence); + var result = recvSequence.str + 'processed'; + var commonEventData = { + code: 0, + data: 'calleeCheckCallParam', + parameters: { + num: recvSequence.num, + str: recvSequence.str, + result: result + } + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>CallTestSysA ThirdAbility Call_Finish<======') + }) + return recvSequence; +} + +function testCallWithResult(data) { + let recvSequence = new MySequenceable(0, '', ''); + console.log('======>SystemCallTest ThirdAbility on testCall <======') + data.readSequenceable(recvSequence); + let result = recvSequence.str + 'processed'; + recvSequence.setMySequence(recvSequence.num, recvSequence.str, result); + + return recvSequence; +} + +export default class ThirdAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SystemCallTest ThirdAbility onCreate") + globalThis.abilityWant = want; + this.callee.on('testCall', testCall); + this.callee.on('testCallWithResult', testCallWithResult); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SystemCallTest ThirdAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SystemCallTest ThirdAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/second/second", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SystemCallTest ThirdAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SystemCallTest ThirdAbility onForeground") + if ((globalThis.abilityWant.parameters.case_num == "case1300") || + (globalThis.abilityWant.parameters.case_num == "case1400")) { + var publishData = globalThis.abilityWant.parameters.case_num + "targetForeground"; + var commonEventData = { + data: publishData, + } + commonEvent.publish('CallTest', commonEventData, (err) => { + console.log('======>SystemAppCallerA ThirdAbility Call_Finish<======') + }) + } + } + + onBackground() { + // Ability has back to background + console.log("SystemCallTest ThirdAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/List.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/module.json b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/module.json rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalltest/thirdcalltest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actscalltest/thirdcalltest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actscalltest/thirdcalltest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/BUILD.gn rename to ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts new file mode 100644 index 000000000..a7b0c3975 --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts @@ -0,0 +1,254 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import dataAbility from '@ohos.data.dataAbility' +import featureAbility from '@ohos.ability.featureAbility' +import fileio from '@ohos.fileio' +import dataRdb from '@ohos.data.rdb' + +const TABLE_NAME = 'book' +const STORE_CONFIG = {name: 'book.db'} +const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)' +let rdbStore: any = undefined +const TAG = 'ACTS_ DataAbility.data' +const context = featureAbility.getContext() + +let defaultReturn = 1; +let returnError = 0; +let returnError1 = -1; +let returnError2 = -2; +let returnError3 = -3; +let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility"); + +export default { + + onInitialized(abilityInfo) { + console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName) + dataRdb.getRdbStore(context, STORE_CONFIG, 1, (err, store) => { + console.debug('ACTS_ [data]getRdbStoreThen') + store.executeSql(SQL_CREATE_TABLE, []) + rdbStore = store + }); + }, + + insert(uri, valueBucket, callback) { + console.debug(TAG + ' insert start 1121') + console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket)) + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) + console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) + console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) + if (valueBucket.age != 24) { + err = "Error age" + callback(err, returnError2); + } + if (valueBucket.name != "ActsDataAbilityHelperTest") { + err = "Error name" + callback(err, returnError2); + } + if (valueBucket.salary != 2024.20) { + err = "Error salary" + callback(err, returnError2); + } + + err = "Error insert" + console.debug(TAG + ' rdbStore.insert ') + rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + + query(uri, columns, predicates, callback) { + console.debug(TAG + ' query start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.query(rdbPredicates, columns, callback) + }, + + update(uri, valueBucket, predicates, callback) { + console.debug(TAG + 'update start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) + console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) + console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) + if (valueBucket.age != 24) { + err = "Error age" + callback(err, returnError2); + } + if (valueBucket.name != "ActsDataAbilityHelperTest") { + err = "Error name" + callback(err, returnError2); + } + if (valueBucket.salary != 2024.20) { + err = "Error salary" + callback(err, returnError2); + } + + err = "Error update" + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + + delete(uri, predicates, callback) { + console.debug(TAG + 'delete start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.delete(rdbPredicates, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + call(uri, method, arg, extras, callback) { + console.debug(TAG + 'call start') + console.debug(TAG + 'uri---->' + uri) + console.debug(TAG + 'method---->' + uri) + }, + + batchInsert(uri, values, callback) { + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + for (var j = 0; j < values.length; j++) { + rdbStore.insert("EMPLOYEE", values[j], function (err, ret) { + console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret)) + }) + } + console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length)) + callback(err, values.length); + }, + + getType(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by getType ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + callback("success", uri); + }, + + getFileTypes(uri, mimeTypeFilter, callback) { + console.info(TAG + '==================== DataAbility test interface by GetFileTypes ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + let type1 = " "; + let type2 = " "; + let type3 = " "; + let types; + if (mimeTypeFilter == "*/*") { + type1 = ("hap"); + type2 = ("jpg"); + type3 = ("image/png"); + types = [type1, type2, type3]; + } else if (mimeTypeFilter == "image/*") { + type1 = ("image/png"); + types = [type1]; + } else if (mimeTypeFilter == "*/jpg") { + type1 = ("jpg"); + types = [type1]; + } + + console.log(TAG + "GetFileTypes callback ret:" + JSON.stringify(types)) + callback("success", types); + }, + + openFile(uri, mode, callback) { + console.info(TAG + '==================== DataAbility test interface by openFile ================'); + let defaultReturn = 1; + let returnError1 = -1; + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") || + mode == ("rw") || mode == ("rwt"))) { + if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) { + defaultReturn = returnError2; + } else + defaultReturn = returnError3; + } + console.info(TAG + " path = /data/test "); + let path = "/data/test" + fileio.stat(path).then(function (stat) { + console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat)); + }).catch(function (err) { + console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err); + defaultReturn = returnError1; + }); + console.info(TAG + " path ==>" + path); + callback("success", defaultReturn); + }, + + normalizeUri(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by normalizeUri ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, ""); + } + callback("success", uri); + }, + + denormalizeUri(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================'); + console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri)); + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, ""); + } + callback("success", uri); + } +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts new file mode 100644 index 000000000..cd2464a1f --- /dev/null +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts @@ -0,0 +1,254 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import dataAbility from '@ohos.data.dataAbility' +import featureAbility from '@ohos.ability.featureAbility' +import fileio from '@ohos.fileio' +import dataRdb from '@ohos.data.rdb' + +const TABLE_NAME = 'book' +const STORE_CONFIG = {name: 'book.db'} +const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)' +let rdbStore: any = undefined +const TAG = 'ACTS_ DataAbility.data' +const context = featureAbility.getContext() + +let defaultReturn = 1; +let returnError = 0; +let returnError1 = -1; +let returnError2 = -2; +let returnError3 = -3; +let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility2"); + +export default { + + onInitialized(abilityInfo) { + console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName) + dataRdb.getRdbStore(context, STORE_CONFIG, 1, (err, store) => { + console.debug('ACTS_ [data]getRdbStoreThen') + store.executeSql(SQL_CREATE_TABLE, []) + rdbStore = store + }); + }, + + insert(uri, valueBucket, callback) { + console.debug(TAG + ' insert start 1121') + console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket)) + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) + console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) + console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) + if (valueBucket.age != 24) { + err = "Error age" + callback(err, returnError2); + } + if (valueBucket.name != "ActsDataAbilityHelperTest") { + err = "Error name" + callback(err, returnError2); + } + if (valueBucket.salary != 2024.20) { + err = "Error salary" + callback(err, returnError2); + } + + err = "Error insert" + console.debug(TAG + ' rdbStore.insert ') + rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + + query(uri, columns, predicates, callback) { + console.debug(TAG + ' query start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.query(rdbPredicates, columns, callback) + }, + + update(uri, valueBucket, predicates, callback) { + console.debug(TAG + 'update start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + console.debug(TAG + ' valueBucket.age =>' + valueBucket.age) + console.debug(TAG + ' valueBucket.name =>' + valueBucket.name) + console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary) + if (valueBucket.age != 24) { + err = "Error age" + callback(err, returnError2); + } + if (valueBucket.name != "ActsDataAbilityHelperTest") { + err = "Error name" + callback(err, returnError2); + } + if (valueBucket.salary != 2024.20) { + err = "Error salary" + callback(err, returnError2); + } + + err = "Error update" + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + + delete(uri, predicates, callback) { + console.debug(TAG + 'delete start') + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates) + rdbStore.delete(rdbPredicates, function (err, resultSet) { + console.log(TAG + "insert callback resultSet:" + resultSet + + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err) + callback(err, defaultReturn); + }) + }, + call(uri, method, arg, extras, callback) { + console.debug(TAG + 'call start') + console.debug(TAG + 'uri---->' + uri) + console.debug(TAG + 'method---->' + uri) + }, + + batchInsert(uri, values, callback) { + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + + for (var j = 0; j < values.length; j++) { + rdbStore.insert("EMPLOYEE", values[j], function (err, ret) { + console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret)) + }) + } + console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length)) + callback(err, values.length); + }, + + getType(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by getType ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + callback("success", uri); + }, + + getFileTypes(uri, mimeTypeFilter, callback) { + console.info(TAG + '==================== DataAbility test interface by GetFileTypes ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + let type1 = " "; + let type2 = " "; + let type3 = " "; + let types; + if (mimeTypeFilter == "*/*") { + type1 = ("hap"); + type2 = ("jpg"); + type3 = ("image/png"); + types = [type1, type2, type3]; + } else if (mimeTypeFilter == "image/*") { + type1 = ("image/png"); + types = [type1]; + } else if (mimeTypeFilter == "*/jpg") { + type1 = ("jpg"); + types = [type1]; + } + + console.log(TAG + "GetFileTypes callback ret:" + JSON.stringify(types)) + callback("success", types); + }, + + openFile(uri, mode, callback) { + console.info(TAG + '==================== DataAbility test interface by openFile ================'); + let defaultReturn = 1; + let returnError1 = -1; + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, returnError1); + } + if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") || + mode == ("rw") || mode == ("rwt"))) { + if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) { + defaultReturn = returnError2; + } else + defaultReturn = returnError3; + } + console.info(TAG + " path = /data/test "); + let path = "/data/test" + fileio.stat(path).then(function (stat) { + console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat)); + }).catch(function (err) { + console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err); + defaultReturn = returnError1; + }); + console.info(TAG + " path ==>" + path); + callback("success", defaultReturn); + }, + + normalizeUri(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by normalizeUri ================'); + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, ""); + } + callback("success", uri); + }, + + denormalizeUri(uri, callback) { + console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================'); + console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri)); + + let err = "Error Uri" + if (uri != dataAbilityUri) { + console.debug(TAG + ' uri != dataAbilityUri') + callback(err, ""); + } + callback("success", uri); + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsdataabilityrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/Test.json diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/DataAbilityHelperJsSt.test.js diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/List.test.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsfwkdataaccessortest/actsfwkdataaccessortest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/BUILD.gn b/ability/ability_runtime/actsserviceabilityclienttest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/BUILD.gn rename to ability/ability_runtime/actsserviceabilityclienttest/BUILD.gn diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/Test.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/Test.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/Test.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/Test.json diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/config.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/config.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/config.json diff --git a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/app.js b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/List.test.js b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/StServiceAbilityClient.test.js b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/StServiceAbilityClient.test.js similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/StServiceAbilityClient.test.js rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/entry/src/main/js/test/StServiceAbilityClient.test.js diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityclienttest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/BUILD.gn b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/BUILD.gn rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/BUILD.gn diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/config.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/AbilityStage.ts b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/AbilityStage.ts rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/AbilityStage.ts b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/AbilityStage.ts rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/BUILD.gn rename to ability/ability_runtime/actsstartcomponenttest/BUILD.gn diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json new file mode 100644 index 000000000..092fe3b37 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.actsspecifieduseractionextensionzerotest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/BUILD.gn rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/BUILD.gn diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json new file mode 100644 index 000000000..febfcbe0a --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json @@ -0,0 +1,49 @@ + +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "120000", + "package": "com.example.actsspecifieduseractionextensionzerotest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsSpecifiedUserActionextensionZeroTest.hap", + "ActsSpecifiedUserActionextensiononeTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "PushKit", + "push": [ + "ActsSpecifiedUserActionextensionZeroTest.hap->/system/app/ActsSpecifiedUserActionextensionZeroTest.hap"] + }, + { + "type": "ShellKit", + "run-command": [ + "acm create -n 101 -t normal", + "acm create -n 102 -t normal", + "acm switch -i 101" + ], + "teardown-command":[ + "acm delete -i 101", + "acm delete -i 102" + ] + }, + { + "type": "PushKit", + "push": [ + "ActsSpecifiedUserActionextensiononeTest.hap->/system/app/ActsSpecifiedUserActionextensiononeTest.hap"] + }, + { + "type": "ShellKit", + "run-command": [ + "acm switch -i 100" + ] + } + ] +} + diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..196c3b8b3 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageContext = this.context; + globalThis.startnum = 0 + console.log("MyAbilityStage finish") + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..77038a5e9 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate"); + globalThis.abilityWant = want; + globalThis.abilityContext = this.context + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy"); + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate"); + windowStage.setUIContent(this.context, "pages/index/index", null); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy"); + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground"); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground"); + } +}; diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..892ee1bfb --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); + console.debug("====>close this context====>") + globalThis.ability2Context.terminateSelf(); +} + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility2 onCreate") + + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility2 onWindowStageCreate") + globalThis.ability2Context = this.context + windowStage.setUIContent(this.context, "pages/index", null) + commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts new file mode 100644 index 000000000..4a1e4947d --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import rpc from '@ohos.rpc'; +import osaccount from '@ohos.account.osAccount' +globalThis.ACCOUNT_ID100; +globalThis.ACCOUNT_ID101; +globalThis.ACCOUNT_ID102; +class Stub extends rpc.RemoteObject { + constructor(des) { + super(des); + } + // process client's request + onRemoteRequest(code, data, reply, option) { + reply.writeNoException(); + reply.writeString("success"); + return true; + } +} + +function onConnectCallback(element) { + console.log('connectAbilityWithAccount onConnect element.bundleName : ' + element.bundleName) + console.log('connectAbilityWithAccount onConnect element.abilityName : ' + element.abilityName) +} + +function onDisconnectCallback(element) { + console.log('connectAbilityWithAccount onDisconnect element.bundleName : ' + element.bundleName) + console.log('connectAbilityWithAccount onDisconnect element.abilityName : ' + element.abilityName) +} + +function onFailedCallback(code) { + console.log('connectAbilityWithAccount onFailed errCode : ' + code) +} + +export default class ServiceAbility extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility onCreate'); + } + onDestory(){ + console.log('ServiceAbility onDestory'); + } + onRequest(want,startId) { + console.log('ServiceAbility onRequest'); + } + + onConnect(want) { + console.log('ServiceAbility onConnect'); + console.log('globalThis.startnum is ' + globalThis.startnum); + + switch (globalThis.startnum) { + case 1: + console.log('ServiceAbility case 1'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' + },globalThis.ACCOUNT_ID100 ,{ + windowMode: 2, + displayId: 1 + }).then(() => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0100 ====>success!") + }) + console.debug("====>case 1 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + case 2: + console.log('ServiceAbility case 2'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' + },globalThis.ACCOUNT_ID102 ,{ + windowMode: 2, + displayId: 1 + }).then(() => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0300 ====>success!") + }) + console.debug("====>case 2 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + case 3: + console.log('ServiceAbility case 3'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.MainAbility2' + },globalThis.ACCOUNT_ID101,((err, data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0500====>fail!!!"+ JSON.stringify(err)) + console.log("====>end ACTS_StartServiceAbilityWithAccount_0500====>sunccess!"+ JSON.stringify(data)) + })) + console.debug("====>case 3 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + case 4: + console.log('ServiceAbility case 4'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' + },globalThis.ACCOUNT_ID102, { + windowMode: 2, + displayId: 1 + },((err, data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0600====>fail!!!"+ JSON.stringify(err)) + console.log("====>end ACTS_StartServiceAbilityWithAccount_0600====>sunccess!"+ JSON.stringify(data)) + })) + console.debug("====>case 4 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + case 5: + console.log('ServiceAbility case 5'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' + },globalThis.ACCOUNT_ID100).then((data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0700====>success!"+ JSON.stringify(data)) + }) + break; + case 6: + console.log('ServiceAbility case 6'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' + },globalThis.ACCOUNT_ID102,((err, data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0900====>fail!!!") + console.log("====>end ACTS_StartServiceAbilityWithAccount_0900====>sunccess!") + })) + console.debug("====>case 6 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + case 7: + console.log('ServiceAbility case 7'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' + }, globalThis.ACCOUNT_ID101,((err, data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_1100====>fail!!!"+ JSON.stringify(err)) + console.log("====>end ACTS_StartServiceAbilityWithAccount_1100====>sunccess!"+ JSON.stringify(data)) + })) + console.debug("====>case 7 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + case 8: + console.log('ServiceAbility case 8'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' + }, globalThis.ACCOUNT_ID102,((err, data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_1200====>fail!!!"+ JSON.stringify(err)) + console.log("====>end ACTS_StartServiceAbilityWithAccount_1200====>sunccess!"+ JSON.stringify(data)) + })) + console.debug("====>case 8 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + case 9: + console.log('ServiceAbility case 9'); + this.context.connectAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2', + action: "StartAbilityPromise" + }, globalThis.ACCOUNT_ID100, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback, + },) + break; + case 10: + console.log('ServiceAbility case 10'); + this.context.connectAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2', + action: "StartAbilityPromise" + },globalThis.ACCOUNT_ID102, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback, + },) + + console.debug("====>case 10 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + default: + console.log("====> ServiceAbility end default =====>") + break; + } + } + onDisconnect(want) { + console.log('ServiceAbility onDisconnect, want:' + want.abilityName); + } + + onDestroy() { + console.log('ServiceAbility onDestroy'); + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/service.ts diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts new file mode 100644 index 000000000..c70f0a2d3 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import Want from '@ohos.application.Want'; +import commonEvent from "@ohos.commonEvent" +import rpc from '@ohos.rpc'; + +export default class ServiceAbility2 extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility2 onCreate'); + globalThis.abilityWant = want; + } + + onDestory(){ + console.log('ServiceAbility2 onDestory'); + } + + onRequest(want,startId) { + console.log('ServiceAbility2 onRequest'); + commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { + console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") + this.context.terminateSelf(); + console.log("====> terminateSelf End=====>") + }); + } + + onConnect(want: Want) { + console.log('ServiceAbility2 onConnect'); + if (want.action == 'StartAbilityPromise') { + console.log('stub StartAbilityPromise OnConnect start '); + commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { + console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") + this.context.terminateSelf(); + console.log("====> StartAbilityPromise End=====>") + }); + } + return new rpc.RemoteObject('connect'); + } + + onDisconnect(want) { + console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); + } + + onDestroy() { + console.log('ServiceAbility2 onDestroy'); + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/service.ts similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets new file mode 100644 index 000000000..a35863614 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets @@ -0,0 +1,833 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent' +import osaccount from '@ohos.account.osAccount' + +var ACTS_ABILITYCONTEX = { + events: ["ABILITYCONTEX_Start_CommonEvent"] +}; + +const START_ABILITY_TIMEOUT = 3000; +console.debug("====>in Ability.test====>"); + +export default function abilityTest(abilityContext) { + console.debug("====>in ACTS_InterfaceMultiUsers====>"); + describe('ACTS_StartService', function () { + beforeAll(function(done) { + var osAccountManager = osaccount.getAccountManager(); + console.debug("====>get AccountManager finish===="); + osAccountManager.activateOsAccount(100, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + setTimeout(()=>{ + osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ + console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); + globalThis.ACCOUNT_ID100 = data1[0]; + osAccountManager.activateOsAccount(101, (err)=>{ + console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); + setTimeout(()=>{ + osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ + console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); + globalThis.ACCOUNT_ID101 = data2[0]; + osAccountManager.activateOsAccount(102, (err)=>{ + console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); + osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ + console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); + globalThis.ACCOUNT_ID102 = data3[0]; + osAccountManager.activateOsAccount(100, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + done(); + }) + }) + }) + }) + },3000) + }) + }) + },3000) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0100 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : In multi-user non-concurrent mode, + * the specified user is equal to the current user and the user's task list exists (promise) + */ + it('ACTS_StartServiceAbilityWithAccount_0100', 0, async function (done) { + let Subscriber + var flag = true; + var startresult = false; + globalThis.startnum = 1; + + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_0100 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_0100 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_0100 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0100start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(() => { + done() + }, 1000) + } + + function timeout() { + console.debug('in ACTS_StartServiceAbilityWithAccount_0100 timeout'); + if (flag == true) { + expect().assertFail(); + console.debug('ACTS_StartServiceAbilityWithAccount_0100 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0300 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user does not have a task list (the user does not exist), call Promise + */ + it('ACTS_StartServiceAbilityWithAccount_0300', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 2; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_0300 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0300start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0500 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * the specified user is not equal to the current user, + * and the user's task list exists, call AsyncCallback + */ + it('ACTS_StartServiceAbilityWithAccount_0500', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 3; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + // setTimeout(() => { + + // }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_0500 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_0500 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_0500 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + done(); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0500start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0600 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user does not have a task list (the user does not exist), + * call AsyncCallback + */ + it('ACTS_StartServiceAbilityWithAccount_0600', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 4; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_0600 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_0600 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_0600 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0600start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0700 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user is equal to the current user, + * and the user's task list exists, call Promise + */ + it('ACTS_StartServiceAbilityWithAccount_0700', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 5; + + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0700start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(() => { + done() + }, 1000) + } + + function timeout() { + console.debug('in ACTS_StartServiceAbilityWithAccount_0700 timeout'); + if (flag == true) { + expect().assertFail(); + console.debug('ACTS_StartServiceAbilityWithAccount_0700 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0900 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user does not have a task list (the user does not exist), + * call Promise + */ + it('ACTS_StartServiceAbilityWithAccount_0900', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 6; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_0900 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_0900 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_0900 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0900start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_1100 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * the specified user is not equal to the current user, + * and the user's task list exists, call AsyncCallback + */ + it('ACTS_StartServiceAbilityWithAccount_1100', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 7; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_1100 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_1100 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_1100 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>1100start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_1200 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user does not have a task list (the user does not exist), + * call AsyncCallback + */ + it('ACTS_StartServiceAbilityWithAccount_1200', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 8; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_1200 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_1200 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_1200 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>1200start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0100 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user is equal to the current user and the user's task list exists + */ + it('ACTS_ConnectServiceAbilityWithAccount_0100', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 9; + + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0100 ConnectServiceAbility connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(() => { + done() + }, 1000) + } + + function timeout() { + console.debug('in ACTS_ConnectServiceAbilityWithAccount_0100 timeout'); + if (flag == true) { + expect().assertFail(); + console.debug('ACTS_ConnectServiceAbilityWithAccount_0100 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0300 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user does not have a task list (the user does not exist) + */ + it('ACTS_ConnectServiceAbilityWithAccount_0300', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 10; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_ConnectServiceAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_ConnectServiceAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_ConnectServiceAbilityWithAccount_0300 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0300 ConnectServiceAbility connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + }) +} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..14db13520 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityTest from './Ability.test.ets' + + +export default function testsuite(context) { + + console.debug("====>in list.test====>"); + abilityTest(context) + +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json new file mode 100644 index 000000000..79e3b5316 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json @@ -0,0 +1,131 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actsspecifieduseractionextensionzerotest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + }, + { + "name": "com.example.actsspecifieduseractionextensionzerotest.MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.example.actsspecifieduseractionextensionzerotest.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + }, + { + "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", + "name": "com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", + "reason": "ceshi" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", + "reason": "ceshi" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_100/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json new file mode 100644 index 000000000..3af757704 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.actsspecifieduseractionextensiononetest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/BUILD.gn rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/BUILD.gn diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json new file mode 100644 index 000000000..fed06e990 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json @@ -0,0 +1,67 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.example.actsspecifieduseractionextensiononetest", + "shell-timeout": "300000" + }, + "kits": [ + { + "type": "ShellKit", + "run-command": [ + "acm create -n 101 -t normal", + "acm create -n 102 -t normal", + "acm switch -i 101" + ], + "teardown-command":[ + "acm delete -i 101", + "acm delete -i 102" + ] + }, + { + "test-file-name": [ + "ActsSpecifiedUserActionextensiononeTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount" + ] + }, + { + "type": "PushKit", + "push": [ + "ActsSpecifiedUserActionextensiononeTest.hap->/system/app/ActsSpecifiedUserActionextensiononeTest.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "acm switch -i 100" + ] + }, + + { + "type": "PushKit", + "push": [ + "ActsSpecifiedUserActionextensionZeroTest.hap->/system/app/ActsSpecifiedUserActionextensionZeroTest.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "acm switch -i 101" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/*.hap" + ] + } + ] +} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..70b1618e9 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageContext = this.context; + globalThis.startnum = 0 + console.log("MyAbilityStage finish") + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..8be28c127 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate"); + globalThis.abilityWant = want; + globalThis.abilityContext = this.context + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy"); + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate"); + windowStage.setUIContent(this.context, "pages/index/index", null); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy"); + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground"); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground"); + } +}; diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..ea606f686 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); + console.debug("====>close this context====>") + globalThis.ability2Context.terminateSelf(); +} + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility2 onCreate") + + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility2 onWindowStageCreate") + globalThis.ability2Context = this.context + windowStage.setUIContent(this.context, "pages/index", null) + commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts new file mode 100644 index 000000000..83124f2c7 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import rpc from '@ohos.rpc'; +class Stub extends rpc.RemoteObject { + constructor(des) { + super(des); + } + // process client's request + onRemoteRequest(code, data, reply, option) { + reply.writeNoException(); + reply.writeString("success"); + return true; + } +} + +function onConnectCallback(element) { + console.log('connectAbilityWithAccount onConnect element.bundleName : ' + element.bundleName) + console.log('connectAbilityWithAccount onConnect element.abilityName : ' + element.abilityName) +} + +function onDisconnectCallback(element) { + console.log('connectAbilityWithAccount onDisconnect element.bundleName : ' + element.bundleName) + console.log('connectAbilityWithAccount onDisconnect element.abilityName : ' + element.abilityName) +} + +function onFailedCallback(code) { + console.log('connectAbilityWithAccount onFailed errCode : ' + code) +} + +export default class ServiceAbility extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility onCreate'); + } + onDestory(){ + console.log('ServiceAbility onDestory'); + } + onRequest(want,startId) { + console.log('ServiceAbility onRequest'); + } + + onConnect(want) { + console.log('ServiceAbility onConnect'); + console.log('globalThis.startnum is ' + globalThis.startnum); + + switch (globalThis.startnum) { + case 1: + console.log('ServiceAbility case 1'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' + },100, { + windowMode: 2, + displayId: 1 + }).then((data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0200 ====>success!") + }) + console.debug("====>case 1 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + break; + + case 2: + console.log('ServiceAbility case 2'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' + }, globalThis.ACCOUNT_ID100).then((data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0800====>success!"+ JSON.stringify(data)) + }) + console.debug("====>case 3 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + + case 3: + console.log('ServiceAbility case 3'); + this.context.connectAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensionzerotest', + abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' + }, globalThis.ACCOUNT_ID100, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback, + },) + console.debug("====>case 5 end====>"); + var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); + console.log('ThirdAbility onConnect before return:') + return myStub; + break; + case 4: + console.log('ServiceAbility case 4'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' + },101,((err, data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_1000====>fail!!!"+ JSON.stringify(err)) + console.log("====>end ACTS_StartServiceAbilityWithAccount_1000====>sunccess!"+ JSON.stringify(data)) + })) + break; + case 5: + console.log('ServiceAbility case 5'); + this.context.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' + }, globalThis.ACCOUNT_ID101,((err, data) => { + console.log("====>end ACTS_StartServiceAbilityWithAccount_0400====>fail!!!"+ JSON.stringify(err)) + console.log("====>end ACTS_StartServiceAbilityWithAccount_0400====>sunccess!"+ JSON.stringify(data)) + })) + break; + default: + console.log("====> ServiceAbility end default =====>") + break; + } + } + onDisconnect(want) { + console.log('ServiceAbility onDisconnect, want:' + want.abilityName); + } + + onDestroy() { + console.log('ServiceAbility onDestroy'); + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/service.ts diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts new file mode 100644 index 000000000..bedb30215 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import Want from '@ohos.application.Want'; +import commonEvent from "@ohos.commonEvent" +import rpc from '@ohos.rpc'; + +export default class ServiceAbility2 extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility2 onCreate'); + globalThis.abilityWant = want; + } + + onDestory(){ + console.log('ServiceAbility2 onDestory'); + } + + onRequest(want,startId) { + console.log('ServiceAbility2 onRequest'); + commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { + console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") + this.context.terminateSelf(); + console.log("====> terminateSelf End=====>") + }); + } + + onConnect(want: Want) { + console.log('ServiceAbility2 onConnect'); + return new rpc.RemoteObject('connect'); + } + + onDisconnect(want) { + console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); + } + + onDestroy() { + console.log('ServiceAbility2 onDestroy'); + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/service.ts similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets new file mode 100644 index 000000000..35c028727 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets @@ -0,0 +1,458 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent' +import osaccount from '@ohos.account.osAccount' + + +var ACTS_ABILITYCONTEX = { + events: ["ABILITYCONTEX_Start_CommonEvent"] +}; + +const START_ABILITY_TIMEOUT = 3000; +console.debug("====>in Ability.test====>"); + +export default function abilityTest(abilityContext) { + console.debug("====>in ACTS_InterfaceMultiUsers====>"); + describe('ACTS_StartService', function () { + beforeAll(function(done) { + var osAccountManager = osaccount.getAccountManager(); + console.debug("====>get AccountManager finish===="); + osAccountManager.activateOsAccount(100, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + setTimeout(()=>{ + osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ + console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); + globalThis.ACCOUNT_ID100 = data1[0]; + osAccountManager.activateOsAccount(101, (err)=>{ + console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); + setTimeout(()=>{ + osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ + console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); + globalThis.ACCOUNT_ID101 = data2[0]; + osAccountManager.activateOsAccount(102, (err)=>{ + console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); + osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ + console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); + globalThis.ACCOUNT_ID102 = data3[0]; + osAccountManager.activateOsAccount(101, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + done(); + }) + }) + }) + }) + },3000) + }) + }) + },3000) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0200 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * the specified user is not equal to the current user, + * and the user's task list exists, call Promise + */ + it('ACTS_StartServiceAbilityWithAccount_0200', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 1; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_0200 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0200start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0800 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * the specified user is not equal to the current user, + * and the user's task list exists, call Promise + */ + it('ACTS_StartServiceAbilityWithAccount_0800', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 2; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + done(); + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_0800 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_0800 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_0800 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0800start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0200 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * the specified user is not equal to the current user, + * and the user's task list exists + */ + it('ACTS_ConnectServiceAbilityWithAccount_0200', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 3; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect().assertFail(); + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>ACTS_ConnectServiceAbilityWithAccount_0200 disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>ACTS_ConnectServiceAbilityWithAccount_0200 in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_ConnectServiceAbilityWithAccount_0200 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 0200start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_1000 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user is equal to the current user, + * and the user's task list exists, call AsyncCallback + */ + it('ACTS_StartServiceAbilityWithAccount_1000', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 4; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_1000 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_1000 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_1000 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>1000start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_StartServiceAbilityWithAccount_0400 + * @tc.name : In multi-user non-concurrent mode + * @tc.desc : System application, in multi-user non-concurrent mode, + * when the specified user is equal to the current user, + * and the user's task list exists, call AsyncCallback + */ + it('ACTS_StartServiceAbilityWithAccount_0400', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 5; + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + + function SubscribeCallBack(err, data) { + expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); + console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); + if (data.event == "ABILITYCONTEX_Start_CommonEvent") { + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + abilityContext.disconnectAbility(globalThis.number).then((err) => { + console.debug("====>err is====>" + JSON.stringify(err)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(() => { + done(); + }, 1000) + } + + function onConnectCallback(element, remote) { + console.log('ACTS_StartServiceAbilityWithAccount_0400 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_StartServiceAbilityWithAccount_0400 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_StartServiceAbilityWithAccount_0400 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0400start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.example.actsspecifieduseractionextensiononetest', + abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..443639553 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityTest from './Ability.test.ets' + + +export default function testsuite(context) { + + console.debug("====>in list.test====>"); + abilityTest(context) + +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json new file mode 100644 index 000000000..3b963d0c7 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json @@ -0,0 +1,131 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actsspecifieduseractionextensiononetest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + }, + { + "name": "com.example.actsspecifieduseractionextensiononetest.MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.example.actsspecifieduseractionextensiononetest.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + }, + { + "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", + "name": "com.example.actsspecifieduseractionextensiononetest.ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", + "reason": "ceshi" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", + "reason": "ceshi" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserActionExtension_101/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json new file mode 100644 index 000000000..51a7178ef --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.actsspecifieduseractionzerotest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/BUILD.gn rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/BUILD.gn diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/Test.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/Test.json new file mode 100644 index 000000000..50653b9cf --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/Test.json @@ -0,0 +1,50 @@ + +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.example.actsspecifieduseractionzerotest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsSpecifiedUserActionZeroTest.hap", + "ActsSpecifiedUserActiononeTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "PushKit", + "push": [ + "ActsSpecifiedUserActionZeroTest.hap->/system/app/ActsSpecifiedUserActionZeroTest.hap"] + }, + { + "type": "ShellKit", + "run-command": [ + "acm create -n 101 -t normal", + "acm create -n 102 -t normal", + "acm switch -i 101" + ] + }, + { + "type": "PushKit", + "push": [ + "ActsSpecifiedUserActiononeTest.hap->/system/app/ActsSpecifiedUserActiononeTest.hap"] + }, + { + "type": "ShellKit", + "run-command": [ + "acm switch -i 100" + ], + "teardown-command":[ + "acm delete -i 101", + "acm delete -i 102" + ] + } + +] +} + diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..08dee1230 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..69a9a4bac --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..209189314 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); + console.debug("====>close this context====>") + globalThis.ability2Context.terminateSelf(); +} +export default class MainAbility2 extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility2 onCreate") + + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility2 onWindowStageCreate") + globalThis.ability2Context = this.context + windowStage.setUIContent(this.context, "pages/index", null) + commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/service.ts similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..72baf47de --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityTest from './abilityTest.ets' + + +export default function testsuite(context) { + + abilityTest(context) + +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets new file mode 100644 index 000000000..7951c6ae3 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets @@ -0,0 +1,935 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent'; +import osaccount from '@ohos.account.osAccount' + +var ACTS_ABILITYCONTEX = { + events: ["ABILITYCONTEX_Start_CommonEvent"] +}; +var ACCOUNT_ID100; +var ACCOUNT_ID101; +var ACCOUNT_ID102; + +const START_ABILITY_TIMEOUT = 3000; +export default function abilityTest(abilityContext) { + describe('ACTS_AbilityContext', function () { + beforeAll(function(done) { + var osAccountManager = osaccount.getAccountManager(); + console.debug("====>get AccountManager finish===="); + osAccountManager.activateOsAccount(100, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + setTimeout(()=>{ + osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ + console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); + ACCOUNT_ID100 = data1[0]; + osAccountManager.activateOsAccount(101, (err)=>{ + console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); + setTimeout(()=>{ + osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ + console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); + ACCOUNT_ID101 = data2[0]; + osAccountManager.activateOsAccount(102, (err)=>{ + console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); + osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ + console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); + ACCOUNT_ID102 = data3[0]; + osAccountManager.activateOsAccount(100, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + done(); + }) + }) + }) + }) + },3000) + }) + }) + },3000) + }) + }) + + + /* + * @tc.number: ACTS_StartStandardAbilityWithAccount_0100 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user is equal to the current user and the user's task list exists, + * call the AbilityContext::startAbilityWithAccount interface of + * Promise (with the StartOptions parameter) to start Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0100', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0100====>start") + var Subscriber; + var flag = false; + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_0100====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>ACTS_StartStandardAbilityWithAccount_0100 UnSubscribeCallback====>"); + setTimeout(function(){ + done(); + },2000) + } + + function timeout() { + if(flag == false) { + expect().assertFail(); + console.debug('ACTS_StartStandardAbilityWithAccount_0100 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID100, + { + windowMode: 2, + displayId: 1 + }).then((data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0100====>success!"+ JSON.stringify(data)) + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_0300 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), + * call the AbilityContext::startAbilityWithAccount interface of + * Promise (with the StartOptions parameter) to start Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0300', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0300 ====> start") + + function timeout() { + console.debug('ACTS_StartStandardAbilityWithAccount_0300 ====> timeout'); + done(); + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility12' + },ACCOUNT_ID102, + { + windowMode: 2, + displayId: 1 + }).then((data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0300====>success!"+ JSON.stringify(data)) + expect().assertFail(); + done(); + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_0500 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, + * call the AbilityContext::startAbilityWithAccount interface + * of AsyncCallback (with the StartOptions parameter) to start Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0500', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0500 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_0500====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityWithAccount_0500 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + },ACCOUNT_ID101, { + windowMode: 2, + displayId: 1 + }, ((err, data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0500====>success!!!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_0600 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), call the + * AbilityContext::startAbilityWithAccount interface of + * AsyncCallback (with the StartOptions parameter) to start the Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0600', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0600 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_0600====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityWithAccount_0600 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID102, { + windowMode: 2, + displayId: 1 + }, ((err, data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0600====>success!!!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_0700 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the + * AbilityCont. + * ext::startAbilityWithAccount interface of Promise (without the StartOptions parameter) + * to start Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0700', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0700 ====> start") + + var Subscriber; + var flag = false; + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_0700====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>ACTS_StartStandardAbilityWithAccount_0700 UnSubscribeCallback====>"); + done(); + } + + function timeout() { + if(flag == false) { + expect().assertFail(); + console.debug('ACTS_StartStandardAbilityWithAccount_0700 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID100).then((data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0700====>success!"+ JSON.stringify(data)) + }) + }) + + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_0900 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), call + * the AbilityContext::startAbilityWithAccount interface of + * Promise (without the StartOptions parameter) to start the Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0900', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0900 ====> start") + + var Subscriber; + + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_0900====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityWithAccount_0900 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID102).then((data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0900====>success!"+ JSON.stringify(data)) + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_1100 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the + * AbilityContext::startAbilityWithAccount interface of + * AsyncCallback (without the StartOptions parameter) to start the Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_1100', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_1100 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_1100====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityWithAccount_1100 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + },ACCOUNT_ID101, ((err, data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_1100====>success!!!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_1200 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), call the + * AbilityContext::startAbilityWithAccount interface of + * AsyncCallback (without the StartOptions parameter) to start the Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_1200', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_1200 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_1200====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityWithAccount_1200 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID102,((err, data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_1200====>success!!!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0100 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user is equal to the current user and the user's task list exists, + * call the Promise's AbilityContext::startAbilityForResultWithAccount + * (with the StartOptions parameter) interface to start Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0100', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0100 ====> start") + var Subscriber; + var flag = false; + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_0100====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>ACTS_StartStandardAbilityForResultWithAccount_0100 UnSubscribeCallback====>"); + done(); + } + + function timeout() { + if(flag == false){ + expect().assertFail(); + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0100 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + }, ACCOUNT_ID100, + { + windowMode: 2, + displayId: 1 + }).then((data) => { + console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0100====>success!"+ JSON.stringify(data)) + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0300 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), + * call the AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) + * interface of Promise to start Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0300', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0300 ====> start") + + function timeout() { + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0300 ====> timeout'); + done(); + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID102, + { + windowMode: 2, + displayId: 1 + }).then((data) => { + console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0300====>success!"+ JSON.stringify(data)) + expect().assertFail(); + done(); + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0500 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the + * AsyncCallback's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) + * interface to start Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0500', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0500 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_0500====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0500 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + }, ACCOUNT_ID101, + { + windowMode: 2, + displayId: 1 + }, ((err, data) => { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0500 === success!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0600 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), call the + * AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) interface of + * AsyncCallback to start the Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0600', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0600 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_0600====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0600 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + }, ACCOUNT_ID102, + { + windowMode: 2, + displayId: 1 + }, ((err, data) => { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0600 === success!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0700 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user is equal to the current user and the user's task list exists, + * call the Promise's AbilityContext::startAbilityForResultWithAccount + * (without the StartOptions parameter) interface to start the Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0700', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0700 ====> start") + + var Subscriber; + var flag = false; + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_0700====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + if(flag == false) + { + expect().assertFail(); + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0700 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + }, ACCOUNT_ID100).then((data) => { + console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0700====>success!"+ JSON.stringify(data)) + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0900 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), call the + * AbilityContext::startAbilityForResultWithAccount (no StartOptions parameter) interface of + * Promise to start Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0900', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0900 ====> start") + + function timeout() { + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0900 ====> timeout'); + done(); + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID102).then((data) => { + console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0900====>success!"+ JSON.stringify(data)) + expect().assertFail(); + done(); + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1100 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, + * call the AsyncCallback's + * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) interface + * to start the Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_1100', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_1100 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_1100====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityForResultWithAccount_1100 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + }, ACCOUNT_ID101, ((err, data) => { + console.log("ACTS_StartStandardAbilityForResultWithAccount_1100 === success!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1200 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), + * call the AbilityContext::startAbilityForResultWithAccount (no StartOptions parameter) + * interface of AsyncCallback to start Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_1200', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_1200 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_1200====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + }, ACCOUNT_ID102, ((err, data) => { + console.log("ACTS_StartStandardAbilityForResultWithAccount_1200 === success!" + JSON.stringify(data)) + })) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityForResultWithAccount_1200 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /** + * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0100 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is equal to the current user and the user's task list exists, + * call the AbilityContext::connectAbilityWithAccount interface to connect to Ability. + */ + it('ACTS_ConnectStandardAbilityWithAccount_0100', 0, async function (done) { + console.log("ACTS_ConnectStandardAbilityWithAccount_0100====>start") + var Subscriber; + var flag = true; + var number = 0; + + function onConnectCallback(element, remote) { + console.log('ACTS_ConnectStandardAbilityWithAccount_0100 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_ConnectStandardAbilityWithAccount_0100 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug('ACTS_ConnectStandardAbilityWithAccount_0100 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>WithAccount 0100 Subscribe CallBack data:====>" + JSON.stringify(data)); + abilityContext.disconnectAbility(number).then((err)=>{ + console.debug("====>err is====>" + JSON.stringify(err)); + }) + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_ConnectStandardAbilityWithAccount_0100====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>ACTS_ConnectStandardAbilityWithAccount_0100 UnSubscribeCallback====>"); + done(); + } + + function timeout() { + if(flag == false) { + expect().assertFail(); + console.debug('ACTS_ConnectStandardAbilityWithAccount_0100 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start connectAbilityWithAccount====>"); + number = await abilityContext.connectAbilityWithAccount({ + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', + action: "StartAbilityPromise" + }, ACCOUNT_ID100,{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + }) + + /** + * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0300 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user does not have a task list (the user does not exist), + * call the AbilityContext::connectAbilityWithAccount interface to connect the Ability. + */ + it('ACTS_ConnectStandardAbilityWithAccount_0300', 0, async function (done) { + console.log("ACTS_ConnectStandardAbilityWithAccount_0300 ====> start") + var Subscriber; + var flag = true; + var number = 0; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>WithAccount 0300 Subscribe CallBack data:====>" + JSON.stringify(data)); + abilityContext.disconnectAbility(number).then((err)=>{ + console.debug("====>err is====>" + JSON.stringify(err)); + }) + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function onConnectCallback(element, remote) { + console.log('ACTS_ConnectStandardAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_ConnectStandardAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_ConnectStandardAbilityWithAccount_0300====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>start connectAbilityWithAccount====>"); + number = await abilityContext.connectAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', + action: "StartAbilityPromise" + },ACCOUNT_ID102 ,{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json new file mode 100644 index 000000000..c353cc06d --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json @@ -0,0 +1,122 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actsspecifieduseractionzerotest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + }, + { + "name": "com.example.actsspecifieduseractionzerotest.MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", + "name": "com.example.actsspecifieduseractionzerotest.ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", + "reason": "ceshi" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", + "reason": "ceshi" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_100/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json new file mode 100644 index 000000000..9b04e81d7 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.actsspecifieduseractiononetest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/BUILD.gn rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/BUILD.gn diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/Test.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/Test.json new file mode 100644 index 000000000..a8c171bda --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/Test.json @@ -0,0 +1,63 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.example.actsspecifieduseractiononetest", + "shell-timeout": "300000" + }, + "kits": [ + { + "type": "ShellKit", + "run-command": [ + "acm create -n 101 -t normal", + "acm create -n 102 -t normal", + "acm switch -i 101" + ] + }, + { + "test-file-name": [ + "ActsSpecifiedUserActiononeTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount" + ] + }, + { + "type": "PushKit", + "push": [ + "ActsSpecifiedUserActiononeTest.hap->/system/app/ActsSpecifiedUserActiononeTest.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "acm switch -i 100" + ] + }, + + { + "type": "PushKit", + "push": [ + "ActsSpecifiedUserActionZeroTest.hap->/system/app/ActsSpecifiedUserActionZeroTest.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "acm switch -i 101" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/*.hap" + ] + } + ] +} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..8375d5492 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..69a9a4bac --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..6176b8ae0 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); + console.debug("====>close this context====>") + globalThis.ability2Context.terminateSelf(); +} + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility2 onCreate") + + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility2 onWindowStageCreate") + globalThis.ability2Context = this.context + commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/service.ts similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..5635f2840 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityTest from './abilityTest.ets' + + +export default function testsuite(context) { + + abilityTest(context) + +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets new file mode 100644 index 000000000..470e2e0f6 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets @@ -0,0 +1,540 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent'; +import osaccount from '@ohos.account.osAccount' + +var ACTS_ABILITYCONTEX = { + events: ["ABILITYCONTEX_Start_CommonEvent"] +}; +var ACCOUNT_ID100; +var ACCOUNT_ID101; +var ACCOUNT_ID102; + +const START_ABILITY_TIMEOUT = 3000; +export default function abilityTest(abilityContext) { + describe('ACTS_AbilityContext', function () { + beforeAll(function(done) { + var osAccountManager = osaccount.getAccountManager(); + console.debug("====>get AccountManager finish===="); + osAccountManager.activateOsAccount(100, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + setTimeout(()=>{ + osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ + console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); + ACCOUNT_ID100 = data1[0]; + osAccountManager.activateOsAccount(101, (err)=>{ + console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); + setTimeout(()=>{ + osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ + console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); + ACCOUNT_ID101 = data2[0]; + osAccountManager.activateOsAccount(102, (err)=>{ + console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); + osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ + console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); + console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); + ACCOUNT_ID102 = data3[0]; + osAccountManager.activateOsAccount(101, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + done(); + }) + }) + }) + }) + },3000) + }) + }) + },3000) + }) + }) + + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_0200 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, + * call the Promise's AbilityContext::startAbilityWithAccount + * interface (with the StartOptions parameter) to start Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0200', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0200====>start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_0200====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityWithAccount_0200 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID100, + { + windowMode: 2, + displayId: 1 + }).then((data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0200====>success!"+ JSON.stringify(data)) + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_0400 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user is equal to the current user and the user's task list exists, + * call the AbilityContext::startAbilityWithAccount interface of + * AsyncCallback (with the StartOptions parameter) to start Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0400', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0400 ====> start") + + var Subscriber; + var flag = false; + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_0400====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + if(flag == false){ + expect().assertFail(); + console.debug('ACTS_StartStandardAbilityWithAccount_0400 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + done(); + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + },ACCOUNT_ID101, + { + windowMode: 2, + displayId: 1 + }, ((err, data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0400====>success!!!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_0800 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, + * call the Promise's AbilityContext::startAbilityWithAccount + * interface (without the StartOptions parameter) to start the Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_0800', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_0800 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_0800====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityWithAccount_0800 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + },ACCOUNT_ID100).then((data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_0800====>success!"+ JSON.stringify(data)) + }) + }) + + + /** + * @tc.number: ACTS_StartStandardAbilityWithAccount_1000 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the + * AbilityContext::startAbilityWithAccount interface of + * AsyncCallback (without the StartOptions parameter) to start the Ability. + */ + it('ACTS_StartStandardAbilityWithAccount_1000', 0, async function (done) { + console.log("ACTS_StartStandardAbilityWithAccount_1000 ====> start") + + var Subscriber; + var flag = false; + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityWithAccount_1000====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + if(flag == false){ + expect().assertFail(); + console.debug('ACTS_StartStandardAbilityWithAccount_1000 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbility====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + },ACCOUNT_ID101, ((err, data) => { + console.log("====>end ACTS_StartStandardAbilityWithAccount_1000====>success!!!" + JSON.stringify(data)) + })) + }) + + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0200 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the + * Promise's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) + * interface to start Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0200', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0200 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_0200====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0200 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + }, ACCOUNT_ID100, + { + windowMode: 2, + displayId: 1 + }).then((data) => { + console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0200====>success!"+ JSON.stringify(data)) + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0400 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the + * AsyncCallback's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) + * interface to start the Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0400', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0400 ====> start") + + var Subscriber; + var flag = false; + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_0400====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + if(flag == false){ + expect().assertFail(); + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0400 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + }, ACCOUNT_ID101, + { + windowMode: 2, + displayId: 1 + }, ((err, data) => { + console.log("StartStandardAbilityForResultWithAccount_0400 === success!" + JSON.stringify(data)) + })) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0800 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, + * call the Promise's + * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) interface + * to start Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_0800', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_0800 ====> start") + + var Subscriber; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_0800====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_StartStandardAbilityForResultWithAccount_0800 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' + }, ACCOUNT_ID100).then((data) => { + console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0800====>success!"+ JSON.stringify(data)) + }) + }) + + /** + * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1000 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, + * call the AsyncCallback's + * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) + * interface to start the Ability. + */ + it('ACTS_StartStandardAbilityForResultWithAccount_1000', 0, async function (done) { + console.log("ACTS_StartStandardAbilityForResultWithAccount_1000 ====> start") + var flag = false; + var Subscriber; + + function SubscribeCallBack(err, data) { + flag = true; + expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); + console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_StartStandardAbilityForResultWithAccount_1000====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + if(flag == false){ + expect().assertFail(); + console.debug('ACTS_StartStandardAbilityForResultWithAccount_1000 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + + } + } + + + setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>start startAbilityForResult====>"); + await abilityContext.startAbilityForResultWithAccount( + { + bundleName: 'com.example.actsspecifieduseractiononetest', + abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' + }, ACCOUNT_ID101, ((err, data) => { + console.log("ACTS_StartStandardAbilityForResultWithAccount_1000 === success!" + JSON.stringify(data)) + })) + }) + + + /** + * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0200 + * @tc.name: Provides a system interface to specify user startup components (standard page). + * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, + * call the AbilityContext::connectAbilityWithAccount interface to connect the Ability. + */ + it('ACTS_ConnectStandardAbilityWithAccount_0200', 0, async function (done) { + console.log("ACTS_ConnectStandardAbilityWithAccount_0200 ====> start") + var Subscriber; + var flag = true; + var number = 0; + + function SubscribeCallBack(err, data) { + expect().assertFail(); + console.debug("====>WithAccount 0300 Subscribe CallBack data:====>" + JSON.stringify(data)); + abilityContext.disconnectAbility(number).then((err)=>{ + console.debug("====>err is====>" + JSON.stringify(err)); + }) + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function onConnectCallback(element, remote) { + console.log('ACTS_ConnectStandardAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_ConnectStandardAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + + commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { + console.debug("ACTS_ConnectStandardAbilityWithAccount_0200====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>start connectAbilityWithAccount====>"); + number = await abilityContext.connectAbilityWithAccount( + { + bundleName: 'com.example.actsspecifieduseractionzerotest', + abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', + action: "StartAbilityPromise" + },ACCOUNT_ID102 ,{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + done(); + } + + function timeout() { + console.debug('ACTS_ConnectStandardAbilityWithAccount_0200 ====> timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json new file mode 100644 index 000000000..d1014c0d7 --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json @@ -0,0 +1,110 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actsspecifieduseractiononetest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + }, + { + "name": "com.example.actsspecifieduseractiononetest.MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", + "name": "com.example.actsspecifieduseractiononetest.ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsstartcomponenttest/SpecifiedUserAction_101/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/BUILD.gn b/ability/ability_runtime/actsstserviceabilityclientcase/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/BUILD.gn rename to ability/ability_runtime/actsstserviceabilityclientcase/BUILD.gn diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/Test.json b/ability/ability_runtime/actsstserviceabilityclientcase/Test.json similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/Test.json rename to ability/ability_runtime/actsstserviceabilityclientcase/Test.json diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/config.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/config.json rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/app.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/app.js rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/actsstserviceabilityclientcase/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstserviceabilityclientcase/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/actsstserviceabilityclientcase/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsstserviceabilityclientcase/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/BUILD.gn rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/Test.json b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/Test.json rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/Test.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/AbilityStage.ts new file mode 100644 index 000000000..d5ebbe661 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/AbilityStage.ts @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilitySatage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate"); + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..c89305ea6 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + console.log("jws onCreate"); + } + + onDestroy() { + console.log("jws onDestroy"); + } + + onWindowStageCreate(windowStage) { + console.log("jws onWindowStageCreate"); + } + + onWindowStageDestroy() { + console.log("jws onWindowStageDestroy"); + } + + onForeground() { + console.log("jws onForeground"); + } + + onBackground() { + console.log("jws onBackground"); + } + + call(){ + + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/app.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..bc26cd000 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "ServiceExtAbility" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + }, + { + "name": "description_dataability", + "value": "hap sample empty provider" + }, + { + "name": "description_mainability2", + "value": "eTS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + }, + { + "name": "description_testdataability", + "value": "hap sample empty provider" + }, + { + "name": "permreason_dataability", + "value": "request dataability premission" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json new file mode 100644 index 000000000..ac69de9d7 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.acts.actsinterfacemultiusersextensiontest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/BUILD.gn rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/BUILD.gn diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/Test.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/Test.json rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/Test.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..69bd30f43 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from "@ohos.commonEvent" + +export default class MainAbility2 extends Ability { + + onCreate(want, launchParam) { + console.log("MainAbility2 onCreate"); + globalThis.abilityContext = this.context + } + + onDestroy() { + console.log("MainAbility2 onDestroy"); + } + + onWindowStageCreate(windowStage) { + console.log("MainAbility2 onWindowStageCreate"); + windowStage.setUIContent(this.context, "pages/index/second", null); + commonEvent.publish("ACTS_InterfaceMultiUsersExtension_CommonEvent", () => { + console.log("publish Publish ACTS_InterfaceMultiUsersExtension_CommonEvent callback") + globalThis.abilityContext.terminateSelf().then(() => { + commonEvent.publish("ACTS_TerminateSelf_CommonEvent", ()=>{ + console.log('terminateSelf promise'); + }); + }); + }) + } + + onWindowStageDestroy() { + console.log("MainAbility2 onWindowStageDestroy"); + } + + onForeground() { + console.log("MainAbility2 onForeground"); + } + + onBackground() { + console.log("MainAbility2 onBackground"); + } +}; diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets new file mode 100644 index 000000000..2bb0df57e --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets @@ -0,0 +1,974 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent' +import osaccount from '@ohos.account.osAccount' + +var subscriberInfo_MainAbility = { + events: ["ACTS_InterfaceMultiUsersExtension_CommonEvent"] + }; +var subscriberInfo_MainAbility2 = { + events: ["ACTS_TerminateSelf_CommonEvent"] +}; +var subscriberInfo_MainAbility3 = { + events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"] +}; +var osAccountManager +const START_ABILITY_TIMEOUT = 6000; +globalThis.number = 0; +console.debug("====>in Ability.test====>"); +export default function abilityTest(abilityContext) { + console.debug("====>in function abilityTest====>"); + describe('ActsInterfaceMultiUsersExtensionTest', function () { + afterAll(function() { + osAccountManager = osaccount.getAccountManager(); + console.debug("====>get AccountManager finish===="); + osAccountManager.activateOsAccount(100, (err)=>{ + console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); + osAccountManager.removeOsAccount(101, (err)=>{ + console.debug("====>remove localId: 101" + " err:" + JSON.stringify(err)); + }) + }) + }) + console.debug("====>in ACTS_InterfaceMultiUsers====>"); + /* + * @tc.number : ACTS_ExtensionStartAbility_0100 + * @tc.name : start new ability + * @tc.desc : Start an ability with the parameter startability with options succeeded.(promise) + */ + it('ACTS_ExtensionStartAbility_0100', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 1 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); + console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo) => { + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0100start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(()=>{ + done() + },1000) + } + + function timeout() { + console.debug('in ACTS_ExtensionStartAbility_0100 timeout'); + if(flag == true) { + expect().assertFail(); + console.debug('ACTS_ExtensionStartAbility_0100 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_0200 + * @tc.name : start new ability + * @tc.desc : Start an ability with the parameter startability with options failed.(promise) + */ + it('ACTS_ExtensionStartAbility_0200', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 2 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect().assertFail(); + expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); + console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(()=>{ + done(); + },1000) + } + function onConnectCallback(element, remote) { + console.log(' onConnectCallback====> element=' + JSON.stringify(element)); + console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug('ACTS_ExtensionStartAbility_0200 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0200start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + },{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_0300 + * @tc.name : start new ability + * @tc.desc : Start an ability with the parameter startability with options succeeded.(callback) + */ + it('ACTS_ExtensionStartAbility_0300', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum=3 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); + console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0300start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(()=>{ + done() + },1000) + } + + function timeout() { + console.debug('in ACTS_ExtensionStartAbility_0300 timeout'); + if(flag == true) { + expect().assertFail(); + console.debug('ACTS_ExtensionStartAbility_0300 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_0400 + * @tc.name : start new ability + * @tc.desc : Start an ability with the parameter startability with options failed.(callback) + */ + it('ACTS_ExtensionStartAbility_0400', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 4 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect().assertFail(); + expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); + console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(()=>{ + done(); + },1000) + } + function onConnectCallback(element, remote) { + console.log(' onConnectCallback====> element=' + JSON.stringify(element)); + console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug('ACTS_ExtensionStartAbility_0400 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0400start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + },{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_0500 + * @tc.name : start new ability + * @tc.desc : Starting mainability2 with startability succeeded.(promise) + */ + it('ACTS_ExtensionStartAbility_0500', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 5 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); + console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0500start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(()=>{ + done() + },1000) + } + + function timeout() { + console.debug('in ACTS_ExtensionStartAbility_0500 timeout'); + if(flag == true) { + expect().assertFail(); + console.debug('ACTS_ExtensionStartAbility_0500 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_0600 + * @tc.name : start new ability + * @tc.desc : Starting mainability2 with startability failed.(promise) + */ + it('ACTS_ExtensionStartAbility_0600', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 6 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect().assertFail(); + expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); + console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(()=>{ + done(); + },1000) + } + function onConnectCallback(element, remote) { + console.log(' onConnectCallback====> element=' + JSON.stringify(element)); + console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug('ACTS_ExtensionStartAbility_0600 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0600start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + },{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_0700 + * @tc.name : start new ability + * @tc.desc : Starting mainability2 with startability succeeded.(callback) + */ + it('ACTS_ExtensionStartAbility_0700', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum=7 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); + console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0700start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(()=>{ + done() + },1000) + } + + function timeout() { + console.debug('in ACTS_ExtensionStartAbility_0700 timeout'); + if(flag == true) { + expect().assertFail(); + console.debug('ACTS_ExtensionStartAbility_0700 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_0800 + * @tc.name : start new ability + * @tc.desc : Starting mainability2 with startability failed.(callback) + */ + it('ACTS_ExtensionStartAbility_0800', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 8 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect().assertFail(); + expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); + console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(()=>{ + done(); + },1000) + } + function onConnectCallback(element, remote) { + console.log(' onConnectCallback====> element=' + JSON.stringify(element)); + console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug('ACTS_ExtensionStartAbility_0800 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0800start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + },{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_0900 + * @tc.name : start new ability + * @tc.desc : Starting mainability2 with startability succeeded.(callback) + */ + it('ACTS_ExtensionStartAbility_0900', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum=13 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent").assertTrue(); + console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){ + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + commonEvent.createSubscriber(subscriberInfo_MainAbility3).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0900start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(()=>{ + done() + },1000) + } + + function timeout() { + console.debug('in ACTS_ExtensionStartAbility_0900 timeout'); + if(flag == true) { + expect().assertFail(); + console.debug('ACTS_ExtensionStartAbility_0900 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + + }) + + /* + * @tc.number : ACTS_ExtensionStartAbility_1000 + * @tc.name : start new ability + * @tc.desc : Starting mainability2 with startability succeeded.(callback) + */ + it('ACTS_ExtensionStartAbility_1000', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum=14 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent").assertTrue(); + console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){ + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + commonEvent.createSubscriber(subscriberInfo_MainAbility3).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>1000start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(()=>{ + done() + },1000) + } + + function timeout() { + console.debug('in ACTS_ExtensionStartAbility_1000 timeout'); + if(flag == true) { + expect().assertFail(); + console.debug('ACTS_ExtensionStartAbility_1000 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + + }) + + /* + * @tc.number : ACTS_ExtensionTerminateSelf_0100 + * @tc.name : Use terminateself to terminate ability + * @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(promise) + */ + it('ACTS_ExtensionTerminateSelf_0100', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 9 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); + console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_TerminateSelf_CommonEvent"){ + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function onConnectCallback(element, remote) { + console.log('onConnectCallback====> element=' + JSON.stringify(element)); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0100start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + },{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(()=>{ + done() + },1000) + } + + function timeout() { + console.debug('in ACTS_ExtensionTerminateSelf_0100 timeout'); + if(flag == true) { + expect().assertFail(); + console.debug('ACTS_ExtensionTerminateSelf_0100 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + /* + * @tc.number : + * @tc.name : Use terminateself to terminate ability + * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(promise) + */ + it('ACTS_ExtensionTerminateSelf_0200', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 10 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect().assertFail(); + expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); + console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_TerminateSelf_CommonEvent"){ + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(()=>{ + done(); + },1000) + } + function onConnectCallback(element, remote) { + console.log(' onConnectCallback====> element=' + JSON.stringify(element)); + console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug(' - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0200start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + },{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + }) + /* + * @tc.number : ACTS_ExtensionTerminateSelf_0300 + * @tc.name : Use terminateself to terminate ability + * @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(callback) + */ + it('ACTS_ExtensionTerminateSelf_0300', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 11 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); + console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_TerminateSelf_CommonEvent"){ + startresult = true + } + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0300start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(true); + setTimeout(()=>{ + done() + },1000) + } + + function timeout() { + console.debug('in ACTS_ExtensionTerminateSelf_0300 timeout'); + if(flag == true) { + expect().assertFail(); + console.debug('ACTS_ExtensionTerminateSelf_0300 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + + setTimeout(timeout, START_ABILITY_TIMEOUT); + + }) + /* + * @tc.number : ACTS_ExtensionTerminateSelf_0400 + * @tc.name : Use terminateself to terminate ability + * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(callback) + */ + it('ACTS_ExtensionTerminateSelf_0400', 0, async function (done) { + let Subscriber + var flag = true + var startresult = false + globalThis.startnum = 12 + console.log('====>globalThis.startnum is====>' + globalThis.startnum); + function SubscribeCallBack (err, data) { + expect().assertFail(); + expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); + console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); + if(data.event == "ACTS_TerminateSelf_CommonEvent"){ + startresult = true + } + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + expect(startresult).assertEqual(false); + abilityContext.disconnectAbility(globalThis.number).then((data)=>{ + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + setTimeout(()=>{ + done(); + },1000) + } + function onConnectCallback(element, remote) { + console.log('ACTS_ExtensionTerminateSelf_0400 onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_ExtensionTerminateSelf_0400 onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(()=> { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if(flag == true) { + console.debug('ACTS_ExtensionTerminateSelf_0400 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { + console.debug("====>Create Subscriber====>"); + data.getSubscribeInfo().then(async (SubscribeInfo)=>{ + console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0400start connectAbility====>"); + globalThis.number = await abilityContext.connectAbility( + { + bundleName: 'com.acts.actsinterfacemultiusersextensiontest', + abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' + },{ + onConnect:onConnectCallback, + onDisconnect:onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + }) + }) + }) +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json new file mode 100644 index 000000000..44fb329d1 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json @@ -0,0 +1,120 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.acts.actsinterfacemultiusersextensiontest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + }, + { + "name": "com.acts.actsinterfacemultiusersextensiontest.MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait" + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.acts.actsinterfacemultiusersextensiontest.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + }, + { + "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", + "name": "com.acts.actsinterfacemultiusersextensiontest.ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION" + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_RUNNING_INFO", + "reason": "need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", + "reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", + "reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" + } + ] + } +} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersExtensionSystemTest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/app.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/app.json new file mode 100644 index 000000000..12dc0a920 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.acts.killprocesshap", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/Test.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/Test.json rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/Test.json diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..c4fe28ae1 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne() { + console.debug("====>Publish CallBack ACTS_KillProcess====>"); +} + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + commonEvent.publish("ACTS_KillProcess", PublishCallBackOne); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json new file mode 100644 index 000000000..7c50780a2 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json @@ -0,0 +1,38 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.acts.killprocesshap.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + + } +} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/app.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/app.json new file mode 100644 index 000000000..5acc8f76a --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.acts.killprocessthirdhap", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/Test.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/Test.json rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/Test.json diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..c3d2af559 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import appManager from '@ohos.application.appManager' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + console.log("in killhap onForeground") + setTimeout(()=>{ + appManager.killProcessesByBundleName('com.example.killprocessthirdhap').then((data)=>{ + console.info('====>ACTS_KillProcess_0100 killProcessesByBundleName=====>' + JSON.stringify(data)) + }) + },2000) + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json new file mode 100644 index 000000000..99b6752f5 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json @@ -0,0 +1,37 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.acts.killprocessthirdhap.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/app.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/app.json new file mode 100644 index 000000000..fd6cc6153 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.acts.killprocessthirdhap2", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/Test.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/Test.json rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/Test.json diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..3eaadf9ce --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import appManager from '@ohos.application.appManager' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + console.log("in killhap onForeground") + setTimeout(()=>{ + appManager.killProcessesByBundleName('com.example.killprocessthirdhap2',(err,data)=>{ + console.info('====>ACTS_KillProcess_0100 killProcessesByBundleName=====>' + JSON.stringify(data)) + }) + },2000) + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json new file mode 100644 index 000000000..933db7e82 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json @@ -0,0 +1,37 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.acts.killprocessthirdhap2.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/AppScope/app.json b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/AppScope/app.json rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/AppScope/app.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/BUILD.gn rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/BUILD.gn diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/Test.json b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/Test.json rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/Test.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility3/MainAbility3.ts b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility3/MainAbility3.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility3/MainAbility3.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/MainAbility3/MainAbility3.ts diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..f4e1c2a61 --- /dev/null +++ b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityTest from './Ability.test.ets' + +export default function testsuite(context) { + console.debug("====>in list.test====>"); + abilityTest(context) +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsusers/BUILD.gn b/ability/ability_runtime/actsusers/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/BUILD.gn rename to ability/ability_runtime/actsusers/BUILD.gn diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json new file mode 100644 index 000000000..6ff764e5d --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.actsconnectabilitysystemabilitytest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/BUILD.gn b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/BUILD.gn rename to ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/BUILD.gn diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/Test.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/Test.json new file mode 100644 index 000000000..9af58d08c --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/Test.json @@ -0,0 +1,31 @@ + +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "120000", + "package": "com.example.actsconnectabilitysystemabilitytest", + "shell-timeout": "60000" + }, + "kits": [ + { + "type": "ShellKit", + "run-command": [ + "acm create -n 101 -t normal", + "acm switch -i 101" + ], + "teardown-command":[ + "acm delete -i 101" + ] + }, + { + "test-file-name": [ + "ActsConnectAbilitySystemAbilityTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + + ] +} + diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..f1ff325c5 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,42 @@ +import Ability from '@ohos.application.Ability' +// import commonEvent from '@ohos.commonEvent' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("AbilityMultiInstanceTest onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("AbilityMultiInstanceTest onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("AbilityMultiInstanceTest onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("AbilityMultiInstanceTest onWindowStageDestroy") + } + + + onForeground() { + // Ability has brought to foreground + console.log("AbilityMultiInstanceTest onForeground") + } + + onBackground() { + // Ability has back to background + console.log("AbilityMultiInstanceTest onBackground") + } + +}; diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts new file mode 100644 index 000000000..8fecdd411 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import commonEvent from '@ohos.commonEvent' +import Want from '@ohos.application.Want'; +import rpc from '@ohos.rpc'; +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' + +var conn = -1; +function publishCallBackOne () { + console.log("========Publish CallBack AMS_ConnectAbility_0100_commonEvent========"); +} +function publishCallBackTwo () { + console.log("========Publish CallBack AMS_ConnectAbility_0200_commonEvent========"); +} +function publishCallBackThree () { + console.log("========Publish CallBack AMS_ConnectAbility_0300_commonEvent========"); +} +function publishCallBackFour () { + console.log("========Publish CallBack AMS_ConnectAbility_0400_commonEvent========"); +} +function publishCallBackFive () { + console.log("========Publish CallBack AMS_ConnectAbility_0500_commonEvent========"); +} +function publishCallBackSix () { + console.log("========Publish CallBack AMS_ConnectAbility_0600_commonEvent========"); +} +function publishCallBackzero () { + console.log("========Publish CallBack AMSc_disonnectAbility_0100_commonEvent========"); +} +function publishCallBackttwo () { + console.log("========Publish CallBack AMSc_disonnectAbility_0200_commonEvent========"); +} + +class Stub extends rpc.RemoteObject { + constructor(des) { + super(des); + } + onRemoteRequest(code, data, reply, option) { + reply.writeNoException(); + reply.writeString("success"); + return true; + } +} + +function onConnectCallback(element) { + console.log('ACTS_ConnectAbility_0100 ConnectAbility onConnect element.bundleName : ' + element.bundleName) + console.log('ACTS_ConnectAbility_0100 ConnectAbility onConnect element.abilityName : ' + element.abilityName) +} + +function onDisconnectCallback1(element) { + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) +} +function onDisconnectCallback2(element) { + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) +} +function onDisconnectCallback3(element) { + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) +} +function onDisconnectCallback4(element) { + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) +} +function onDisconnectCallback5(element) { + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) +} +function onDisconnectCallback6(element) { + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName) + console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName) +} +function onFailedCallback(code) { + console.log('ACTS_ConnectAbility_0100 ConnectAbility onFailed errCode : ' + code) +} + + +export default class ServiceAbility extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility onCreate, want: ' + want.abilityName); + } + + onRequest(want, startId) { + console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); + + console.log('ServiceAbility registerApplicationStateObserver begin'); + console.log('ServiceAbility registerApplicationStateObserver end, conn: ' + conn); + } + + onConnect(want) { + console.log('ServiceAbility onConnect, want:' + want.abilityName); + let extensionContext = this.context + if (want.action == "one") { + commonEvent.publish("AMS_ConnectAbility_0100_commonEvent", publishCallBackOne); + } + ; + if (want.action == "two") { + commonEvent.publish("AMS_ConnectAbility_0200_commonEvent", publishCallBackTwo); + } + ; + if (want.action == "Three") { + commonEvent.publish("AMS_ConnectAbility_0300_commonEvent", publishCallBackThree); + } + ; + if (want.action == "Four") { + commonEvent.publish("AMS_ConnectAbility_0400_commonEvent", publishCallBackFour); + } + ; + if (want.action == "Five") { + commonEvent.publish("AMS_ConnectAbility_0500_commonEvent", publishCallBackFive); + } + ; + if (want.action == "Six") { + commonEvent.publish("AMS_ConnectAbility_0600_commonEvent", publishCallBackSix); + } + ; + if (want.action == "Seven") { + extensionContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility2", + }, + { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback1, + onFailed: onFailedCallback, + }, + ); + var myStub4 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); + return myStub4; + }; + if (want.action == "Eight") { + extensionContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility3", + }, + { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback6, + onFailed: onFailedCallback, + }, + ); + var myStub1 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); + return myStub1; + }; + if (want.action == "Nine") { + console.log('connectAbility 111'); + let num = extensionContext.connectAbility( + { + bundleName: 'com.example.actsconnectabilitysystemabilitytest', + abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' + }, + { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback2, + onFailed: onFailedCallback, + },) + setTimeout(()=>{ + extensionContext.disconnectAbility(num).then(()=>{ + console.log('in disconnectAbility'); + }) + },1000) + var myStub2 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); + return myStub2; + + }; + if (want.action == "Ten") { + console.log('connectAbility 222'); + let num = extensionContext.connectAbility( + { + bundleName: 'com.example.actsconnectabilitysystemabilitytest', + abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' + }, + { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback3, + onFailed: onFailedCallback, + },) + setTimeout(()=>{ + extensionContext.disconnectAbility(num).then(()=>{ + console.log('in disconnectAbility2'); + }) + },1000) + var myStub3 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); + return myStub3; + + }; + if (want.action == "Ten one") { + console.log('connectAbility 333'); + let num = extensionContext.connectAbility( + { + bundleName: 'com.example.actsconnectabilitysystemabilitytest', + abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' + }, + { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback4, + onFailed: onFailedCallback, + },) + setTimeout(()=>{ + extensionContext.disconnectAbility(2222).then(()=>{ + console.log('in disconnectAbility3'); + }) + },1000) + var myStub5 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); + return myStub5; + + }; + if (want.action == "Ten two") { + console.log('connectAbility 444'); + let num = extensionContext.connectAbility( + { + bundleName: 'com.example.actsconnectabilitysystemabilitytest', + abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' + }, + { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback5, + onFailed: onFailedCallback, + },) + setTimeout(()=>{ + extensionContext.disconnectAbility(2222).then(()=>{ + console.log('in disconnectAbility4'); + }) + },1000) + var myStub6 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility"); + return myStub6; + + }; + } + + onDisconnect(want) { + console.log('ServiceAbility onDisconnect, want:' + want.abilityName); + commonEvent.publish("AMSc_disonnectAbility_0100_commonEvent",publishCallBackzero); + commonEvent.publish("AMSc_disonnectAbility_0200_commonEvent",publishCallBackttwo); + } + + onDestroy() { + console.log('ServiceAbility onDestroy'); + } +} + diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/service.ts diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts new file mode 100644 index 000000000..8ebb5e216 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import commonEvent from "@ohos.commonEvent" +import Want from '@ohos.application.Want'; +import rpc from '@ohos.rpc'; + +export default class ServiceAbility2 extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility2 onCreate'); + globalThis.abilityWant = want; + } + + onDestory(){ + console.log('ServiceAbility2 onDestory'); + } + + onRequest(want,startId) { + console.log('ServiceAbility2 onRequest'); + } + + onConnect(want: Want) { + console.log('ServiceAbility2 onConnect'); + commonEvent.publish("AMS_ConnectAbility_0700_commonEvent", () => { + console.log("publish Publish AMS_ConnectAbility_0700_commonEvent callback"); + }) + commonEvent.publish("AMS_ConnectAbility_0900_commonEvent", () => { + console.log("publish Publish AMS_ConnectAbility_0900_commonEvent callback"); + }) + commonEvent.publish("AMS_ConnectAbility_1000_commonEvent", () => { + console.log("publish Publish AMS_ConnectAbility_1000_commonEvent callback"); + }) + commonEvent.publish("AMS_ConnectAbility_1100_commonEvent", () => { + console.log("publish Publish AMS_ConnectAbility_1100_commonEvent callback"); + }) + commonEvent.publish("AMS_ConnectAbility_1200_commonEvent", () => { + console.log("publish Publish AMS_ConnectAbility_1200_commonEvent callback"); + }) + return new rpc.RemoteObject('connect'); + } + + + onDisconnect(want) { + console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); + } + + onDestroy() { + console.log('ServiceAbility2 onDestroy'); + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/index/index.ets new file mode 100644 index 000000000..c5de5b34c --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/index/index.ets @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct MyComponent { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World1111111') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..f59236655 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityTest from './manyusersabilitytest.test.ets' +export default function testsuite(context) { + + abilityTest(context) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets new file mode 100644 index 000000000..509061299 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets @@ -0,0 +1,814 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent' + + +var subscriberInfoStartAbility_0100 = { + events: ["AMS_ConnectAbility_0100_commonEvent"], +}; +var subscriberInfoStartAbility_0200 = { + events: ["AMS_ConnectAbility_0200_commonEvent"], +}; +var subscriberInfoStartAbility_0300 = { + events: ["AMS_ConnectAbility_0300_commonEvent"], +}; +var subscriberInfoStartAbility_0400 = { + events: ["AMS_ConnectAbility_0400_commonEvent"], +}; +var subscriberInfoStartAbility_0500 = { + events: ["AMS_ConnectAbility_0500_commonEvent"], +}; +var subscriberInfoStartAbility_0600 = { + events: ["AMS_ConnectAbility_0600_commonEvent"], +}; +var subscriberInfoStartAbility_0700 = { + events: ["AMS_ConnectAbility_0700_commonEvent"], +}; +var subscriberInfoStartAbility_0800 = { + events: ["AMS_ConnectAbility_0800_commonEvent"], +}; +var subscriberInfoStartAbility_0900 = { + events: ["AMS_ConnectAbility_0900_commonEvent"], +}; + +var subscriberInfoStartAbility_1000 = { + events: ["AMS_ConnectAbility_1000_commonEvent"], +}; + +var subscriberInfoStartAbility_1100 = { + events: ["AMS_ConnectAbility_1100_commonEvent"], +}; + +var subscriberInfoStartAbility_1200 = { + events: ["AMS_ConnectAbility_1200_commonEvent"], +}; +var unsubscriberInfoStartAbility_0100 = { + events: ["AMSc_disonnectAbility_0100_commonEvent"], +}; +var unsubscriberInfoStartAbility_0200 = { + events: ["AMSc_disonnectAbility_0200_commonEvent"], +}; + + +const START_ABILITY_TIMEOUT = 1000; +globalThis.number = 0; + +export default function abilityTest(abilityContext) { + describe('ActssystemabilityTest', function () { + function onFailedCallBack(code) { + console.log('ACTS_ConnectAbility_0200 Connectability errcode:' + code); + } + + /* + * @tc.number: ACTS_ConnectAbility_0100 + * @tc.name: Connects a service ability + * @tc.desc: Connects a service ability + */ + it('ACTS_ConnectAbility_0100', 0, async function (done) { + console.log('ACTS_ConnectAbility_0100====ACTS_ConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent"); + console.debug("====>ACTS_ConnectAbility_0100 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ConnectAbility_0100 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + + } + + + commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { + console.debug("====>ACTS_ConnectAbility_0100 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + done(); + } + + function timeout() { + expect().assertFail(); + console.debug('AMS_ConnectAbility_0100 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ConnectAbility_0100 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "one", + }, + ); + console.debug("====>ACTS_ConnectAbility_0100 4 "); + + }) + + /* + * @tc.number: ACTS_ConnectAbility_0200 + * @tc.name: Connects a service ability + * @tc.desc: Connects a service ability + */ + it('ACTS_ConnectAbility_0200', 0, async function (done) { + console.log('ACTS_ConnectAbility_0200====Subscribe CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0200_commonEvent"); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { + console.debug("====>Create Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack====>"); + done(); + } + function timeout() { + console.debug('AMS_ConnectAbility_0200 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbilityone", + action: "two", + }, + { + onFailed: onFailedCallBack, + }, + ); + }) + + /* + * @tc.number: ACTS_DisconnectAbility_0100 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_DisconnectAbility_0100', 0, async function (done) { + console.log('ACTS_DisconnectAbility_0100====ACTS_DisconnectAbility_0100 5 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + console.debug("====>ACTS_DisconnectAbility_0100 6====>"); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_DisconnectAbility_0100 6====>"); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => { + console.debug("====>ACTS_DisconnectAbility_0100 2 Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack====>"); + setTimeout(()=> + { + done() + }, 1000)}; + function timeout() { + expect().assertFail(); + console.debug('AMS_DonnectAbility_0300 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_DisconnectAbility_0100 3====>"); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Three", + }, + ); + console.debug("====>ACTS_DisconnectAbility_0100 4====>"); + }) + + /* + * @tc.number: ACTS_DisconnectAbility_0200 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_DisconnectAbility_0200', 0, async function (done) { + console.log('ACTS_DisconnectAbility_0200 1====ACTS_DisconnectAbility_0200 3 CallBack1 data:====>" + JSON.stringify(data)); + commonEvent.createSubscriber(unsubscriberInfoStartAbility_0100).then(async (data) => { + console.debug("====>ACTS_DisconnectAbility_0200 6 Subscriber====>"); + subscriberdisconnect = data; + await commonEvent.subscribe(subscriberdisconnect, subscribedisconnectback); + console.debug("====>ACTS_DisconnectAbility_0200 1111 connectAbility1====>"); + + console.debug("====>ACTS_DisconnectAbility_0200 1111 connectAbility2====>"); + console.debug("====>ACTS_DisconnectAbility_0200 66 Subscriber====>"); + abilityContext.disconnectAbility( + 999, + (error, data) => { + console.log('ACTS_DisconnectAbility_0200 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + }) + } + function subscribedisconnectback(err, data) { + console.debug("====>ACTS_DisconnectAbility_0200 7 CallBack2 data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberdisconnect, () => { + console.debug('unsubscribe subscriberdisconnect'); + commonEvent.unsubscribe(subscriber, () => { + console.debug('unsubscribe subscriber') + clearTimeout(id); + expect().assertFail(); + done(); + }) + }) + } + function timeout() { + console.debug('ACTS_DisconnectAbility_0200 8 timeout'); + commonEvent.unsubscribe(subscriberdisconnect, () => { + console.debug('unsubscribe subscriberdisconnect'); + commonEvent.unsubscribe(subscriber, () => { + console.debug('unsubscribe subscriber') + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('ACTS_DisconnectAbility_0200 9 DisconnectAbility result errCode : ' + error.code + " data: " + data) + console.debug("====>ACTS_DisconnectAbility_0200 99 Subscriber====>"); + setTimeout(() => { + done(); + }, 1000) + }); + }) + }) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_0400).then(async (data) => { + console.debug("====>ACTS_DisconnectAbility_0200 10 Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack) + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Four", + }, + ); + console.debug("====>connId is:====>" + JSON.stringify(connId)); + console.debug("====>ACTS_DisconnectAbility_0200 1010 Subscriber====>"); + }) + function unSubscribeCallback() { + console.debug("====>ACTS_DisconnectAbility_0200 1111 UnSubscribe CallBack====>"); + done(); + } + }) + + /* + * @tc.number: ACTS_DisconnectAbility_0300 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_DisconnectAbility_0300', 0, async function (done) { + console.log('ACTS_DisconnectAbility_0300====ACTS_DisconnectAbility_0300 4 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0500_commonEvent"); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('ACTS_DisconnectAbility_0300 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_0500).then(async (data) => { + console.debug("====>ACTS_DisconnectAbility_0300 1 Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>ACTS_DisconnectAbility_0300 6 CallBack====>"); + setTimeout(() => { + done(); + }, 1000) + } + function timeout() { + expect().assertFail(); + console.debug('AMS_ConnectAbility_0500 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('ACTS_DisconnectAbility_0300 7 DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_DisconnectAbility_0300 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Five", + }, + ); + console.debug("====>ACTS_DisconnectAbility_0300 4 "); + }) + + /* + * @tc.number: ACTS_DisconnectAbility_0400 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_DisconnectAbility_0400', 0, async function (done) { + console.log('ACTS_DisconnectAbility_0400 1====ACTS_DisconnectAbility_0400 3 CallBack1 data:====>" + JSON.stringify(data)); + commonEvent.createSubscriber(unsubscriberInfoStartAbility_0200).then(async (data) => { + console.debug("====>ACTS_DisconnectAbility_0400 6 Subscriber====>"); + subscriberdisconnect = data; + await commonEvent.subscribe(subscriberdisconnect, subscribedisconnectback); + console.debug("====>ACTS_DisconnectAbility_0400 1111 connectAbility1====>"); + + console.debug("====>ACTS_DisconnectAbility_0400 1111 connectAbility2====>"); + console.debug("====>ACTS_DisconnectAbility_0400 66 Subscriber====>"); + abilityContext.disconnectAbility( + 999, + (error, data) => { + console.log('ACTS_DisconnectAbility_0400 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + }) + } + function subscribedisconnectback(err, data) { + console.debug("====>ACTS_DisconnectAbility_0400 7 CallBack2 data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberdisconnect, () => { + console.debug('unsubscribe subscriberdisconnect'); + commonEvent.unsubscribe(subscriber, () => { + console.debug('unsubscribe subscriber') + clearTimeout(id); + expect().assertFail(); + done(); + }) + }) + } + function timeout() { + console.debug('ACTS_DisconnectAbility_0400 8 timeout'); + commonEvent.unsubscribe(subscriberdisconnect, () => { + console.debug('unsubscribe subscriberdisconnect'); + commonEvent.unsubscribe(subscriber, () => { + console.debug('unsubscribe subscriber') + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('ACTS_DisconnectAbility_0400 9 DisconnectAbility result errCode : ' + error.code + " data: " + data) + console.debug("====>ACTS_DisconnectAbility_0400 99 Subscriber====>"); + setTimeout(() => { + done(); + }, 1000) + }); + }) + }) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_0600).then(async (data) => { + console.debug("====>ACTS_DisconnectAbility_0400 10 Subscriber====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack) + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Six", + }, + ); + console.debug("====>connId is:====>" + JSON.stringify(connId)); + console.debug("====>ACTS_DisconnectAbility_0400 1010 Subscriber====>"); + }) + function unSubscribeCallback() { + console.debug("====>ACTS_DisconnectAbility_0400 1111 UnSubscribe CallBack====>"); + done(); + } + }) + + /* + * @tc.number: ACTS_ExtensionConnectAbility_0100 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_ExtensionConnectAbility_0100', 0, async function (done) { + console.log('ACTS_ExtensionConnectAbility_0100====ACTS_ExtensionConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0700_commonEvent"); + console.debug("====>ACTS_ExtensionConnectAbility_0100 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ExtensionConnectAbility_0100 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_0700).then(async (data) => { + console.debug("====>ACTS_ExtensionConnectAbility_0100 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + function timeout() { + expect().assertFail(); + console.debug('ACTS_ExtensionConnectAbility_0100 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ExtensionConnectAbility_0100 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Seven", + }, + ); + console.debug("====>ACTS_ExtensionConnectAbility_0100 4 "); + }) + + /* + * @tc.number: ACTS_ExtensionConnectAbility_0200 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_ExtensionConnectAbility_0200', 0, async function (done) { + console.log('ACTS_ExtensionConnectAbility_0200====ACTS_ExtensionConnectAbility_0200 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0800_commonEvent"); + console.debug("====>ACTS_ExtensionConnectAbility_0200 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ExtensionConnectAbility_0200 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_0800).then(async (data) => { + console.debug("====>ACTS_ExtensionConnectAbility_0200 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + function timeout() { + console.debug('ACTS_ExtensionConnectAbility_0200 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ExtensionConnectAbility_0200 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Eight", + }, + ); + console.debug("====>ACTS_ExtensionConnectAbility_0200 4 "); + }) + + /* + * @tc.number: ACTS_ExtensionDisconnectAbility_0100 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_ExtensionDisconnectAbility_0100', 0, async function (done) { + console.log('ACTS_ExtensionDisconnectAbility_0100====ACTS_ExtensionDisconnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0900_commonEvent"); + console.debug("====>ACTS_ExtensionDisconnectAbility_0100 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ExtensionDisconnectAbility_0100 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_0900).then(async (data) => { + console.debug("====>ACTS_ExtensionDisconnectAbility_0100 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + function timeout() { + expect().assertFail(); + console.debug('ACTS_ExtensionDisconnectAbility_0100 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ExtensionDisconnectAbility_0100 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Nine", + }, + ); + console.debug("====>ACTS_ExtensionDisconnectAbility_0100 4 "); + }) + + /* + * @tc.number: ACTS_ExtensionDisconnectAbility_0200 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_ExtensionDisconnectAbility_0200', 0, async function (done) { + console.log('ACTS_ExtensionDisconnectAbility_0200====ACTS_ExtensionDisconnectAbility_0200 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_1000_commonEvent"); + console.debug("====>ACTS_ExtensionDisconnectAbility_0200 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ExtensionDisconnectAbility_0200 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_1000).then(async (data) => { + console.debug("====>ACTS_ExtensionDisconnectAbility_0200 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + function timeout() { + expect().assertFail(); + console.debug('ACTS_ExtensionDisconnectAbility_0200 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ExtensionDisconnectAbility_0200 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Ten", + }, + ); + console.debug("====>ACTS_ExtensionDisconnectAbility_0200 4 "); + }) + + /* + * @tc.number: ACTS_ExtensionDisconnectAbility_0300 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_ExtensionDisconnectAbility_0300', 0, async function (done) { + console.log('ACTS_ExtensionDisconnectAbility_0300====ACTS_ExtensionDisconnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_1100_commonEvent"); + console.debug("====>ACTS_ExtensionDisconnectAbility_0300 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ExtensionDisconnectAbility_0300 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_1100).then(async (data) => { + console.debug("====>ACTS_ExtensionDisconnectAbility_0300 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + function timeout() { + console.debug('ACTS_ExtensionDisconnectAbility_0300 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ExtensionDisconnectAbility_0300 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Ten one", + }, + ); + console.debug("====>ACTS_ExtensionDisconnectAbility_0300 4 "); + }) + + /* + * @tc.number: ACTS_ExtensionDisconnectAbility_0400 + * @tc.name: DisConnects a service ability + * @tc.desc: DisConnects a service ability + */ + it('ACTS_ExtensionDisconnectAbility_0400', 0, async function (done) { + console.log('ACTS_ExtensionDisconnectAbility_0400====ACTS_ThirdPartyExtensionDisconnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_1200_commonEvent"); + console.debug("====>ACTS_ExtensionDisconnectAbility_0400 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ExtensionDisconnectAbility_0400 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + commonEvent.createSubscriber(subscriberInfoStartAbility_1200).then(async (data) => { + console.debug("====>ACTS_ExtensionDisconnectAbility_0400 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + }) + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + function timeout() { + console.debug('ACTS_ExtensionDisconnectAbility_0400 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ExtensionDisconnectAbility_0400 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsconnectabilitysystemabilitytest", + abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + action: "Ten two", + }, + ); + console.debug("====>ACTS_ExtensionDisconnectAbility_0400 4 "); + }) + }) +} + + diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json new file mode 100644 index 000000000..cf31417fd --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json @@ -0,0 +1,108 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actsconnectabilitysystemabilitytest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + }, + { + "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", + "name": "com.example.actsconnectabilitysystemabilitytest.ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", + "reason": "ceshi" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", + "reason": "ceshi" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsconnectabilitysystemabilitytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json new file mode 100644 index 000000000..7df200e76 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.actsextensionconnectabilitytest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/BUILD.gn b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/BUILD.gn rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/BUILD.gn diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json new file mode 100644 index 000000000..71a062990 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json @@ -0,0 +1,42 @@ + +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "120000", + "package": "com.example.actsextensionconnectabilitytest", + "shell-timeout": "60000" + }, + "kits": [ + { + "type": "ShellKit", + "run-command": [ + "acm create -n 101 -t normal", + "acm switch -i 101" + ], + "teardown-command":[ + "acm delete -i 101" + ] + }, + { + "test-file-name": [ + "ActsExtensionConnectAbilityTest.hap", + "actsServiceAbilityRelyHap.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "PushKit", + "push": [ + "actsServiceAbilityRelyHap.hap->/data/app/actsServiceAbilityRelyHap.hap"] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 777 /data/app/*.hap" + ] + } + ] +} + diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..f0bf6d03c --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.startnum = 0 + globalThis.stageContext = this.context; + + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..1ce4bf5e8 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("AbilityMultiInstanceTest onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("AbilityMultiInstanceTest onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("AbilityMultiInstanceTest onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("AbilityMultiInstanceTest onWindowStageDestroy") + } + + + onForeground() { + // Ability has brought to foreground + console.log("AbilityMultiInstanceTest onForeground") + } + + onBackground() { + // Ability has back to background + console.log("AbilityMultiInstanceTest onBackground") +} + +}; diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts new file mode 100644 index 000000000..fb5e06386 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import commonEvent from '@ohos.commonEvent' +import Want from '@ohos.application.Want'; +import rpc from '@ohos.rpc'; +function publishCallBackOne () { + console.log("========Publish CallBack AMS_ConnectAbility_0300_commonEvent========"); +} +function onConnectCallback(element) { + console.log('connectAbilityWithAccount onConnect element.bundleName : ' + element.bundleName) + console.log('connectAbilityWithAccount onConnect element.abilityName : ' + element.abilityName) +} + +function onDisconnectCallback(element) { + console.log('connectAbilityWithAccount onDisconnect element.bundleName : ' + element.bundleName) + console.log('connectAbilityWithAccount onDisconnect element.abilityName : ' + element.abilityName) +} + +function onFailedCallback(code) { + console.log('connectAbilityWithAccount onFailed errCode : ' + code) +} +var conn = -1; +export default class ServiceAbility extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility onCreate, want: ' + want.abilityName); + } + + onRequest(want, startId) { + console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); + + console.log('ServiceAbility registerApplicationStateObserver begin'); + console.log('ServiceAbility registerApplicationStateObserver end, conn: ' + conn); + } + + onConnect(want: Want) { + console.log('ServiceAbility onConnect, want:' + want.abilityName); + let extensionContext = this.context + if (want.action == "Three") { + console.log('connectAbility 111'); + let num = extensionContext.connectAbility( + { + bundleName: 'com.example.actsserviceabilityrelytest', + abilityName: 'com.example.actsserviceabilityrelytest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback, + },) + setTimeout(()=>{ + extensionContext.disconnectAbility(num).then(()=>{ + console.log('in disconnectAbility'); + }) + },1000) + + }; + commonEvent.publish("AMS_ConnectAbility_0300_commonEvent", publishCallBackOne); + return new rpc.RemoteObject('connect'); + }; + + onDisconnect(want) { + console.log('ServiceAbility onDisconnect, want:' + want.abilityName); + } + + onDestroy() { + console.log('ServiceAbility onDestroy'); + } +} + diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts new file mode 100644 index 000000000..bf2d6c334 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import commonEvent from '@ohos.commonEvent' +import Want from '@ohos.application.Want'; +import rpc from '@ohos.rpc'; +function publishCallBackOne () { + console.log("========Publish CallBack AMS_ConnectAbility_0400_commonEvent========"); +} +var conn = -1; +function onConnectCallback(element) { + console.log('connectAbilityWithAccount onConnect element.bundleName : ' + element.bundleName) + console.log('connectAbilityWithAccount onConnect element.abilityName : ' + element.abilityName) +} +function onDisconnectCallback(element) { + console.log('connectAbilityWithAccount onDisconnect element.bundleName : ' + element.bundleName) + console.log('connectAbilityWithAccount onDisconnect element.abilityName : ' + element.abilityName) +} +function onFailedCallback(code) { + console.log('connectAbilityWithAccount onFailed errCode : ' + code) +} +export default class ServiceAbility2 extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility onCreate, want: ' + want.abilityName); + } + + onRequest(want, startId) { + console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); + + console.log('ServiceAbility registerApplicationStateObserver begin'); + console.log('ServiceAbility registerApplicationStateObserver end, conn: ' + conn); + } + + onConnect(want: Want) { + console.log('ServiceAbility onConnect, want:' + want.abilityName); + let extensionContext = this.context + + console.log('connectAbility 222'); + let num = extensionContext.connectAbility( + { + bundleName: 'com.example.actsserviceabilityrelytest', + abilityName: 'com.example.actsserviceabilityrelytest.ServiceAbility' + }, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback, + },) + setTimeout(()=>{ + extensionContext.disconnectAbility(num).then(()=>{ + console.log('in disconnectAbility2'); + }) + },1000) + commonEvent.publish("AMS_ConnectAbility_0400_commonEvent", publishCallBackOne); + return new rpc.RemoteObject('connect'); + }; + + onDisconnect(want) { + console.log('ServiceAbility onDisconnect, want:' + want.abilityName); + } + + onDestroy() { + console.log('ServiceAbility onDestroy'); + } +} + diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..755f04974 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityTest from './actsextensionconnectabilitytest.test.ets' +export default function testsuite(context) { + + abilityTest(context) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets new file mode 100644 index 000000000..756d95099 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets @@ -0,0 +1,291 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent' + + +var subscriberInfoStartAbility_0100 = { + events: ["AMS_ConnectAbility_0100_commonEvent"], +}; +var subscriberInfoStartAbility_0200 = { + events: ["AMS_ConnectAbility_0200_commonEvent"], +}; +var subscriberInfoStartAbility_0300 = { + events: ["AMS_ConnectAbility_0300_commonEvent"], +}; +var subscriberInfoStartAbility_0400 = { + events: ["AMS_ConnectAbility_0400_commonEvent"], +}; +const START_ABILITY_TIMEOUT = 5000; +globalThis.number = 0; + +export default function abilityTest(abilityContext) { + describe('ActsExtensionConnectAbilityTest', function () { + + it('ACTS_ConnectAbility_0300', 0, async function (done) { + console.log('ACTS_ConnectAbility_0300====ACTS_ConnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent"); + console.debug("====>ACTS_ConnectAbility_0300 5 "); + abilityContext.disconnectAbility( + connId, + (err, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) + } + ); + console.debug("====>ACTS_ConnectAbility_0300 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + + } + + + commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { + console.debug("====>ACTS_ConnectAbility_0300 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack) + connId = await abilityContext.connectAbility({ + bundleName: "com.example.actsserviceabilityrelytest", + abilityName: "com.example.actsserviceabilityrelytest.ServiceAbility", + }, (err, data) => { + console.log('ACTS_ProcessManage SystemAppA onShowProcess startAbility startServiceAbility: ' + + JSON.stringify(err) + ", " + JSON.stringify(data)) + }) + }) + + + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + + function timeout() { + expect().assertFail(); + console.debug('ACTS_ConnectAbility_0300 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (err, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) + }); + } + + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ConnectAbility_0300 4 "); + + }) + + it('ACTS_ConnectAbility_0400', 0, async function (done) { + console.log('ACTS_ConnectAbility_0400====ACTS_ConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0200_commonEvent"); + console.debug("====>ACTS_ConnectAbility_0400 5 "); + abilityContext.disconnectAbility( + connId, + (err, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) + } + ); + console.debug("====>ACTS_ConnectAbility_0400 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + + } + + + commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { + console.debug("====>ACTS_ConnectAbility_0400 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + console.debug("====>ACTS_ConnectAbility_0400 3 "); + connId = await abilityContext.connectAbility({ + bundleName: "com.example.actsserviceabilityrelytest", + abilityName: "com.example.actsserviceabilityrelytest.ServiceAbility", + }, (err, data) => { + console.log('ACTS_ProcessManage SystemAppA onShowProcess startAbility startServiceAbility: ' + + JSON.stringify(err) + ", " + JSON.stringify(data)) + }) + console.debug("====>ACTS_ConnectAbility_0400 4 "); + }) + + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + + function timeout() { + expect().assertFail(); + console.debug('ACTS_ConnectAbility_0400 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (err, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) + }); + } + + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + + }) + + it('ACTS_ExtensionConnectAbility_0300', 0, async function (done) { + console.log('ACTS_ExtensionConnectAbility_0300====ACTS_ExtensionConnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0300_commonEvent"); + console.debug("====>ACTS_ExtensionConnectAbility_0300 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ExtensionConnectAbility_0300 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + + } + + + commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => { + console.debug("====>ACTS_ExtensionConnectAbility_0300 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsextensionconnectabilitytest", + abilityName: "com.example.actsextensionconnectabilitytest.ServiceAbility", + action:"Three", + }).then(()=>{ + console.debug("====>startAbility end====>"); + }) + console.debug("====>ACTS_ExtensionConnectAbility_0300 4 "); + }) + + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + + function timeout() { + expect().assertFail(); + console.debug('ACTS_ExtensionConnectAbility_0300 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + console.debug("====>ACTS_ExtensionConnectAbility_0300 3 "); + + }) + + it('ACTS_ExtensionConnectAbility_0400', 0, async function (done) { + console.log('ACTS_ExtensionConnectAbility_0400====ACTS_ExtensionConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); + clearTimeout(id); + expect(data.event).assertEqual("AMS_ConnectAbility_0400_commonEvent"); + console.debug("====>ACTS_ExtensionConnectAbility_0400 5 "); + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + } + ); + console.debug("====>ACTS_ExtensionConnectAbility_0400 6 "); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + + } + + + commonEvent.createSubscriber(subscriberInfoStartAbility_0400).then(async (data) => { + console.debug("====>ACTS_ExtensionConnectAbility_0400 2 Subscriber1====>"); + subscriber = data; + await commonEvent.subscribe(subscriber, subscribeCallBack); + console.debug("====>ACTS_ExtensionConnectAbility_0400 3 "); + connId = await abilityContext.connectAbility( + { + bundleName: "com.example.actsextensionconnectabilitytest", + abilityName: "com.example.actsextensionconnectabilitytest.ServiceAbility2", + action:"Four", + }, + ); + console.debug("====>ACTS_ExtensionConnectAbility_0400 4 "); + }) + + function unSubscribeCallback() { + console.debug("====>UnSubscribe CallBack1====>"); + setTimeout(() => { + done(); + }, 1000) + } + + function timeout() { + expect().assertFail(); + console.debug('ACTS_ExtensionConnectAbility_0400 timeout'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + abilityContext.disconnectAbility( + connId, + (error, data) => { + console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) + }); + } + + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + + }) + + + + }) +} + + diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json new file mode 100644 index 000000000..c67df1310 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json @@ -0,0 +1,100 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actsextensionconnectabilitytest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.example.actsextensionconnectabilitytest.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + }, + { + "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", + "name": "com.example.actsextensionconnectabilitytest.ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/AppScope/app.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/AppScope/app.json rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/app.json diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/BUILD.gn b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/BUILD.gn rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/BUILD.gn diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/Test.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/Test.json rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/Test.json diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts new file mode 100644 index 000000000..62a126278 --- /dev/null +++ b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import commonEvent from '@ohos.commonEvent' +import Want from '@ohos.application.Want'; +import rpc from '@ohos.rpc'; +function publishCallBackOne () { + console.log("========Publish CallBack AMS_ConnectAbility_0100_commonEvent========"); +} +function publishCallBackTwo () { + console.log("========Publish CallBack AMS_ConnectAbility_0200_commonEvent========"); +} + +export default class ServiceAbility extends ServiceExtensionAbility { + onCreate(want) { + console.log('ServiceAbility onCreate, want: ' + want.abilityName); + } + + onRequest(want, startId) { + console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); + } + + onConnect(want: Want) { + console.log('ServiceAbility onConnect, want:' + want.abilityName); + commonEvent.publish("AMS_ConnectAbility_0100_commonEvent", publishCallBackOne); + commonEvent.publish("AMS_ConnectAbility_0200_commonEvent", publishCallBackTwo); + return new rpc.RemoteObject('connect'); + }; + + onDisconnect(want) { + console.log('ServiceAbility onDisconnect, want:' + want.abilityName); + } + + onDestroy() { + console.log('ServiceAbility onDestroy'); + } +} + diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/module.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/module.json rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amscontextualinforquery/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/BUILD.gn diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json new file mode 100644 index 000000000..c3e2fb773 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.extensionmodule", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..24066f46c --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import rpc from '@ohos.rpc' + +var connection = -1; +let options = { + onConnect: function(elementName, proxy) { + console.log("mxh onConnect success"); + if (proxy == null) { + console.log("mxh proxy == null"); + return; + } + let option = new rpc.MessageOption(); + let data = new rpc.MessageParcel(); + let reply = new rpc.MessageParcel(); + data.writeInt(1); + data.writeInt(99); + proxy.sendRequest(1, data, reply, option); + let msg = reply.readInt(); + console.log("mxh onConnect msg:" + msg); + }, + + onDisconnect: function() {console.log("mxh onDisconnect success");}, + onFailed: function() {console.log("mxh onFailed");} +} +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + console.log('mxh MainAbility onCreate is called' + want + launchParam); + } + + onDestroy() { + console.log('mxh MainAbility onDestroy is called'); + } + + onWindowStageCreate(windowStage) { + console.log('mxh MainAbility onWindowStageCreate is called'); + let context = this.context; + globalThis.startServiceExtAbility = (() => { + console.log("mxh startServiceExtAbility begin"); + var want = { + "bundleName": "com.example.ohosproject.hmservice", + "abilityName": "ServiceExtAbility", + } + context.startAbility(want).then((data) => { + console.info("mxh startAbility success:" + JSON.stringify(data)); + }).catch((error) => { + console.error("mxh startAbility failed:" + JSON.stringify(error)); + }) + console.log("mxh startServiceExtAbility end"); + }) + + globalThis.connectServiceExtAbility = (() => { + console.log("mxh connectServiceExtAbility begin"); + var want = { + "bundleName": "com.example.ohosproject.hmservice", + "abilityName": "ServiceExtAbility", + } + connection = context.connectAbility(want, options); + console.log("mxh connectServiceExtAbility end, connection:" + connection); + }) + + globalThis.disconnectServiceExtAbility = (() => { + console.log("mxh disconnectServiceExtAbility begin"); + context.disconnectAbility(connection).then((data) => { + console.info("mxh startAbility success:" + JSON.stringify(data)); + }).catch((error) => { + console.error("mxh startAbility failed:" + JSON.stringify(error)); + }); + console.log("mxh disconnectServiceExtAbility end, connection:" + connection); + }) + + windowStage.setUIContent(this.context, 'pages/index/index', null); + } + + onWindowStageDestroy() { + console.log('mxh MainAbility onWindowStageDestroy is called'); + } + + onForeground() { + console.log('mxh MainAbility onForeground is called'); + } + + onBackground() { + console.log('mxh MainAbility onBackground is called'); + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json new file mode 100644 index 000000000..5688c398d --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json @@ -0,0 +1,100 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.acts.pmvendorappservice.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "ServiceExtAbility", + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "permissions": [ + "ohos.permission.USE_BLUETOOTH" + ], + "metadata": [ + { + "name": "ohos.extension.form", + "value": "MainAbility", + "resource": "@profile:form_config" + } + ], + "visible": true, + "type": "service" + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/profile/main_pages.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/app.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/app.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/BUILD.gn diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/Test.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/Test.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/Test.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json new file mode 100644 index 000000000..8ee1b11aa --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.staticextensioninfotest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..f0f8dec8b --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("ACTS_ProcessManage VendorAppService MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("ACTS_ProcessManage VendorAppService MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageDestroy") + } + + async onForeground() { + // Ability has brought to foreground + console.log("ACTS_ProcessManage VendorAppService MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("ACTS_ProcessManage VendorAppService MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json new file mode 100644 index 000000000..7c9e5a728 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json @@ -0,0 +1,90 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.staticextensioninfotest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.example.staticextensioninfotest.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ] + } +} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/app.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/app.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/BUILD.gn diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/Test.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/Test.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/Test.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfotest/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/app.json new file mode 100644 index 000000000..eaefec3d4 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.staticinformationmultihappackage", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/BUILD.gn diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..bb674485f --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("ACTS_getAbilityInfo_0400 MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("ACTS_getAbilityInfo_0400 MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("ACTS_getAbilityInfo_0400 MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("ACTS_getAbilityInfo_0400 MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_getAbilityInfo_0400 MainAbility onForeground") + if (globalThis.abilityWant.action == 'startHapA') { + globalThis.abilityContext.startAbility({ + bundleName: "com.example.staticinformationmultihappackage", + abilityName: "com.example.feature.MainAbility", + action: "startHapB" + }, (error, data) => { + console.log('ACTS_getAbilityInfo_0400 MainAbility onForeground - startAbility restart singleton: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + commonEvent.publish("MainAbility_Start_CommonEvent_multi_hap_entry", { + parameters: { + hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), + applicationInfo: JSON.stringify(globalThis.abilityContext.applicationInfo), + abilityInfo: JSON.stringify(globalThis.abilityContext.abilityInfo) + } + }, (err) => { + console.log("ACTS_getAbilityInfo_0400 MainAbility Publish CallBack onForeground") + }); + } + console.log("ACTS_getAbilityInfo_0400 MainAbility onForeground") + + if (globalThis.abilityWant.action == 'multiple') { + commonEvent.publish("MainAbility_Start_CommonEvent_multiple_hap_entry", { + parameters: { + hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), + applicationInfo: JSON.stringify(globalThis.abilityContext.applicationInfo), + abilityInfo: JSON.stringify(globalThis.abilityContext.abilityInfo) + } + }, (err) => { + console.log("ACTS_getAbilityInfo_0400 MainAbility Publish CallBack onForeground") + }); + } + } + + onBackground() { + // Ability has back to background + console.log("ACTS_getAbilityInfo_0400 MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json new file mode 100644 index 000000000..29f9d54c2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json @@ -0,0 +1,83 @@ +{ + "module": { + "name": "com.example.staticinformationmultihappackage", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.staticinformationmultihappackage.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.USE_BLUETOOTH", + "reason":"need use ohos.permission.USE_BLUETOOTH" + } + ] + } +} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/app.json new file mode 100644 index 000000000..eaefec3d4 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.staticinformationmultihappackage", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/BUILD.gn diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/Test.json new file mode 100644 index 000000000..d9fdcb92f --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..24d748e5f --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("ACTS_getAbilityInfo_0400 MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("ACTS_getAbilityInfo_0400 MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("ACTS_getAbilityInfo_0400 MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("ACTS_getAbilityInfo_0400 MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_getAbilityInfo_0400 MainAbility onForeground") + if (globalThis.abilityWant.action == 'startHapB') { + commonEvent.publish("MainAbility_Start_CommonEvent_multi_hap_feature", { + parameters: { + hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), + applicationInfo: JSON.stringify(globalThis.abilityContext.applicationInfo), + abilityInfo: JSON.stringify(globalThis.abilityContext.abilityInfo) + } + }, (err) => { + console.log("ACTS_getAbilityInfo_0400 MainAbility Publish CallBack onForeground") + }); + } + } + + onBackground() { + // Ability has back to background + console.log("ACTS_getAbilityInfo_0400 MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json new file mode 100644 index 000000000..ad3c7f200 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json @@ -0,0 +1,83 @@ +{ + "module": { + "name": "com.example.feature", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.feature.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.USE_BLUETOOTH", + "reason":"need use ohos.permission.USE_BLUETOOTH" + } + ] + } +} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/app.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/app.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/BUILD.gn diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/Test.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/Test.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/Test.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/app.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/app.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/BUILD.gn diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/Test.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/Test.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/Test.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets new file mode 100644 index 000000000..f2917e26e --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; +import commonEvent from '@ohos.commonEvent'; + +var subscriberInfo = { + events: ['MainAbility_Start_CommonEvent_multi_hap_entryB', 'MainAbility_Start_CommonEvent_multiple_hap_entry'] +}; + + +export default function abilityTest(abilityContext) { + describe('ActsAbilityMultipleTest', function () { + + /* + * @tc.number: ACTS_getAbilityInfo_0500 + * @tc.name: Starting singleton ability the second time does triggers onNewWant. + * @tc.desc: Starting singleton ability the second time does triggers onNewWant. + */ + it('ACTS_getAbilityInfo_0500', 0, async function (done) { + console.log("ACTS_getAbilityInfo_0500 --- start") + var Subscriber; + var EntryHap = false; + var FeatureHap = false; + + abilityContext.startAbility({ + bundleName: "com.example.staticquerytesttwo", + abilityName: "com.example.staticquerytesttwo.MainAbility", + action:"startmultiple" + }, (error, data) => { + console.log('ACTS_getAbilityInfo_0500 - startAbility start HapA: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_getAbilityInfo_0500====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + console.debug("ACTS_getAbilityInfo_0500====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_getAbilityInfo_0500====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + if (data.event == 'MainAbility_Start_CommonEvent_multi_hap_entryB') { + EntryHap = true; + console.log("ACTS_getAbilityInfo_0500====> MainAbility_Start_CommonEvent_multi_hap_entryB") + let abilityInfo = JSON.parse(data.parameters['abilityInfo']) + let hapModuleInfo = JSON.parse(data.parameters['hapModuleInfo']) + let applicationInfo =JSON.parse(data.parameters['applicationInfo']) + console.log("ACTS_getAbilityInfo_0500_entry_abilityInfo" + abilityInfo.name) + console.log("ACTS_getAbilityInfo_0500_entry_applicationInfo" + applicationInfo.name) + console.log("ACTS_getAbilityInfo_0500_entry_hapModuleInfo" + hapModuleInfo.name) + expect(abilityInfo.name).assertEqual("com.example.staticquerytesttwo.MainAbility"); + expect(applicationInfo.name).assertEqual("com.example.staticquerytesttwo"); + expect(hapModuleInfo.name).assertEqual("com.example.staticquerytesttwo"); + } else if (data.event == 'MainAbility_Start_CommonEvent_multiple_hap_entry'){ + FeatureHap = true; + console.log("ACTS_getAbilityInfo_0500====> MainAbility_Start_CommonEvent_multi_hap_feature") + let abilityInfo1 = JSON.parse(data.parameters['abilityInfo']) + let hapModuleInfo1 = JSON.parse(data.parameters['hapModuleInfo']) + let applicationInfo1 =JSON.parse(data.parameters['applicationInfo']) + console.log("ACTS_getAbilityInfo_0500_feature_abilityInfo" + abilityInfo1.name) + console.log("ACTS_getAbilityInfo_0500_feature_applicationInfo" + applicationInfo1.name) + console.log("ACTS_getAbilityInfo_0500_feature_hapModuleInfo" + hapModuleInfo1.name) + expect(abilityInfo1.name).assertEqual("com.example.staticinformationmultihappackage.MainAbility"); + expect(applicationInfo1.name).assertEqual("com.example.staticinformationmultihappackage"); + expect(hapModuleInfo1.name).assertEqual("com.example.staticinformationmultihappackage"); + } + if(EntryHap && FeatureHap){ + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + function UnSubscribeCallback() { + console.debug("ACTS_getAbilityInfo_0500====>UnSubscribe CallBack====>"); + done(); + } + }) + + }) +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/app.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/app.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/BUILD.gn diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/Test.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/Test.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/Test.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets new file mode 100644 index 000000000..93fb15b9c --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; +import commonEvent from '@ohos.commonEvent'; + +var subscriberInfo = { + events: ['MainAbility_Start_CommonEvent_multi_hap_entry', 'MainAbility_Start_CommonEvent_multi_hap_feature'], +}; + + +export default function abilityTest(abilityContext) { + describe('ActsAbilityMultiTest', function () { + + /** + * @tc.number: ACTS_getAbilityInfo_0400 + * @tc.name: Starting singleton ability the second time does triggers onNewWant. + * @tc.desc: Starting singleton ability the second time does triggers onNewWant. + */ + it('ACTS_getAbilityInfo_0400', 0, async function (done) { + console.log("ACTS_getAbilityInfo_0400 --- start") + var Subscriber; + var EntryHap = false; + var FeatureHap = false; + + abilityContext.startAbility({ + bundleName: "com.example.staticinformationmultihappackage", + abilityName: "com.example.staticinformationmultihappackage.MainAbility", + action:"startHapA" + }, (error, data) => { + console.log('ACTS_getAbilityInfo_0400 - startAbility start HapA: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_getAbilityInfo_0400====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + console.debug("ACTS_getAbilityInfo_0400====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_getAbilityInfo_0400====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + if (data.event == 'MainAbility_Start_CommonEvent_multi_hap_entry') { + EntryHap = true; + console.log("ACTS_getAbilityInfo_0400====> MainAbility_Start_CommonEvent_multi_hap_entry") + let abilityInfo = JSON.parse(data.parameters['abilityInfo']) + let hapModuleInfo = JSON.parse(data.parameters['hapModuleInfo']) + let applicationInfo =JSON.parse(data.parameters['applicationInfo']) + console.log("ACTS_getAbilityInfo_0400_entry_abilityInfo" + abilityInfo.name) + console.log("ACTS_getAbilityInfo_0400_entry_applicationInfo" + applicationInfo.name) + console.log("ACTS_getAbilityInfo_0400_entry_hapModuleInfo" + hapModuleInfo.name) + expect(abilityInfo.name).assertEqual("com.example.staticinformationmultihappackage.MainAbility"); + expect(applicationInfo.name).assertEqual("com.example.staticinformationmultihappackage"); + expect(hapModuleInfo.name).assertEqual("com.example.staticinformationmultihappackage"); + } else if (data.event == 'MainAbility_Start_CommonEvent_multi_hap_feature'){ + FeatureHap = true; + console.log("ACTS_getAbilityInfo_0400====> MainAbility_Start_CommonEvent_multi_hap_feature") + let abilityInfo1 = JSON.parse(data.parameters['abilityInfo']) + let hapModuleInfo1 = JSON.parse(data.parameters['hapModuleInfo']) + let applicationInfo1 =JSON.parse(data.parameters['applicationInfo']) + console.log("ACTS_getAbilityInfo_0400_feature_abilityInfo" + abilityInfo1.name) + console.log("ACTS_getAbilityInfo_0400_feature_applicationInfo" + applicationInfo1.name) + console.log("ACTS_getAbilityInfo_0400_feature_hapModuleInfo" + hapModuleInfo1.name) + expect(abilityInfo1.name).assertEqual("com.example.feature.MainAbility"); + expect(applicationInfo1.name).assertEqual("com.example.staticinformationmultihappackage"); + expect(hapModuleInfo1.name).assertEqual("com.example.feature"); + } + if(EntryHap && FeatureHap){ + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + function UnSubscribeCallback() { + console.debug("ACTS_getAbilityInfo_0400====>UnSubscribe CallBack====>"); + done(); + } + }) + + }) +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/app.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/app.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/Test.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/Test.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/Test.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/SecondMainAbility/SecondMainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/SecondMainAbility/SecondMainAbility.ts new file mode 100644 index 000000000..2c0c39850 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/SecondMainAbility/SecondMainAbility.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +export default class SecondAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("SecondAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("SecondAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("SecondAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/index", null) + globalThis.ability2Context = this.context; + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("SecondAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("SecondAbility onForeground") + if (globalThis.abilityWant.action == 'getAbilityContext2') { + commonEvent.publish("SecondAbility_Start_CommonEvent_ability", { + parameters: { + hapModuleInfo: JSON.stringify(globalThis.abilityContext.currentHapModuleInfo), + applicationInfo: JSON.stringify(globalThis.abilityContext.applicationInfo), + abilityInfo: JSON.stringify(globalThis.abilityContext.abilityInfo) + } + } ,(err) => { + console.log("MainAbility Publish CallBack MainAbility_Start_CommonEvent") + }); + console.log('stub SerivceAbilityServer OnConnect start 2'); + } + } + + onBackground() { + // Ability has back to background + console.log("SecondAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b rename to ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amsdatauriutils/BUILD.gn b/ability/ability_runtime/amsdatauriutils/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/BUILD.gn rename to ability/ability_runtime/amsdatauriutils/BUILD.gn diff --git a/aafwk/aafwk_standard/amsdatauriutils/Test.json b/ability/ability_runtime/amsdatauriutils/Test.json similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/Test.json rename to ability/ability_runtime/amsdatauriutils/Test.json diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/config.json b/ability/ability_runtime/amsdatauriutils/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/config.json rename to ability/ability_runtime/amsdatauriutils/entry/src/main/config.json diff --git a/ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/app.js b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/test/DataUriUtilsJsSt.test.js diff --git a/aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/test/List.test.js b/ability/ability_runtime/amsdatauriutils/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/amsdatauriutils/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/amsdatauriutils/signature/openharmony_sx.p7b b/ability/ability_runtime/amsdatauriutils/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amsdatauriutils/signature/openharmony_sx.p7b rename to ability/ability_runtime/amsdatauriutils/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/BUILD.gn b/ability/ability_runtime/amsdisplayIdtest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/BUILD.gn rename to ability/ability_runtime/amsdisplayIdtest/BUILD.gn diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/app.json b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/app.json new file mode 100644 index 000000000..ef91bf3cc --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.actsspecifytesthap", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/element/string.json b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/BUILD.gn b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/BUILD.gn rename to ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/BUILD.gn diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/Test.json b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..b989a745e --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +var callBackSeq = ""; + +function publishCallBack() { + console.debug("====>Publish CallBack ====>"); +} + +async function startAbilityProcess(abilityContext, options, parameters) { + let bundleName; + let abilityName; + + let idx = parameters.nextStep; + switch (parameters.step[idx]) { + case "testA": + bundleName = "com.example.actsspecifytesthap"; + abilityName = "com.example.actsspecifytesthap.MainAbility"; + break; + default: + break; + } + parameters.nextStep = ++idx; + abilityContext.startAbility({ + bundleName: bundleName, + abilityName: abilityName, + parameters: parameters, + }, options, (error, data) => { + console.log('startAbilityProcess result: ' + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) +} + +async function onShowProcess() { + var abilityWant = globalThis.abilityWant; + var callBackData = "actsspecifytesthap:" + callBackData += callBackSeq; + + var commonEventPublishData = { + data: callBackData, + parameters: { + displayId: globalThis.abilityWant.parameters['ohos.aafwk.param.displayId'], + windowMode: globalThis.abilityWant.parameters['ohos.aafwk.param.windowMode'], +} + }; + + console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify(abilityWant)); + if (abilityWant.parameters.nextStep >= abilityWant.parameters.stepNum) { + commonEvent.publish("MultiInstanceStartFinish", commonEventPublishData, () => { + console.log('============>querytestsecond success==========>>') + callBackSeq = ""; + }); + } else { + commonEvent.publish("MultiInstanceStartNext", commonEventPublishData, () => { + callBackSeq = ""; + console.log('============>querytest success==========>>') + startAbilityProcess(globalThis.abilityContext, globalThis.abilityWant.options, abilityWant.parameters); + }); + } +} + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("actsspecifytesthap onCreate") + callBackSeq += "onCreate"; + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("actsspecifytesthap onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("actsspecifytesthap onWindowStageCreate") + // callBackSeq += "onWindowStageCreate"; + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index", null) + console.log("actsspecifytesthap onWindowStageCreate finish") + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("actsspecifytesthap onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("actsspecifytesthap onForeground") + callBackSeq += "onForeground"; + onShowProcess(); + } + + onBackground() { + // Ability has back to background + console.log("actsspecifytesthap onBackground") + } +}; diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json new file mode 100644 index 000000000..7fc559d06 --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json @@ -0,0 +1,79 @@ +{ + "module": { + "name": "com.example.actsspecifytesthap", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actsspecifytesthap.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.MANAGE_MISSIONS", + "reason": "need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason": "need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name": "ohos.permission.GET_RUNNING_INFO", + "reason": "need use ohos.permission.GET_RUNNING_INFO" + } + ] + } +} diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/signature/openharmony_sx.p7b b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsspecifytesthap/signature/openharmony_sx.p7b rename to ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/app.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/app.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/app.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/element/string.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/BUILD.gn b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/BUILD.gn rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/BUILD.gn diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/Test.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/Test.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/Test.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/Test.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..a31169f2d --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +async function onShowProcess() { + var abilityWant = globalThis.abilityWant; + + var commonEventPublishData = { + parameters: { + displayId: globalThis.abilityWant.parameters['ohos.aafwk.param.displayId'], + windowMode: globalThis.abilityWant.parameters['ohos.aafwk.param.windowMode'], + } + }; + + console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify(abilityWant)); + + commonEvent.publish("ACTS_TerminateSelf_CommonEvent", commonEventPublishData, () => { + console.log('============>querytestsecond success==========>>') + globalThis.abilityContext.terminateSelf(); + }); + +} +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility2 onCreate") + globalThis.abilityWant = want; + console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify( globalThis.abilityWant)); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility2 onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/second/second", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + onShowProcess(); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/app.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/app.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/app.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/app.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/service.ts similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/signature/openharmony_sx.p7b b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilityforresulttest/signature/openharmony_sx.p7b rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/AppScope/app.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/AppScope/app.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/AppScope/app.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/BUILD.gn b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/BUILD.gn rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/BUILD.gn diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/Test.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/Test.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/Test.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/Test.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/BUILD.gn b/ability/ability_runtime/amsgetabilityprocessinfo/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/BUILD.gn rename to ability/ability_runtime/amsgetabilityprocessinfo/BUILD.gn diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/Test.json b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/Test.json similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/Test.json rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/Test.json diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/config.json b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/config.json rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/app.js b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/app.js similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/app.js rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/ActsProcessManageJsTest.test.js b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/ActsProcessManageJsTest.test.js similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/ActsProcessManageJsTest.test.js rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/ActsProcessManageJsTest.test.js diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/List.test.js b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/signature/openharmony_sx.p7b b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/signature/openharmony_sx.p7b rename to ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/context/BUILD.gn b/ability/ability_runtime/context/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/BUILD.gn rename to ability/ability_runtime/context/BUILD.gn diff --git a/aafwk/aafwk_standard/context/actscontexttest/BUILD.gn b/ability/ability_runtime/context/actscontexttest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/BUILD.gn rename to ability/ability_runtime/context/actscontexttest/BUILD.gn diff --git a/aafwk/aafwk_standard/context/actscontexttest/Test.json b/ability/ability_runtime/context/actscontexttest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/Test.json rename to ability/ability_runtime/context/actscontexttest/Test.json diff --git a/ability/ability_runtime/context/actscontexttest/entry/src/main/config.json b/ability/ability_runtime/context/actscontexttest/entry/src/main/config.json new file mode 100644 index 000000000..d59f806e6 --- /dev/null +++ b/ability/ability_runtime/context/actscontexttest/entry/src/main/config.json @@ -0,0 +1,105 @@ +{ + "app": { + "bundleName": "com.example.actscontext", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.actscontext", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "reqPermissions": [ + { + "name": "com.example.permission", + "reason": "$string:permreason_example", + "usedScene": { + "ability": [ + "com.example.Ability", + "com.example.AbilityBackground" + ], + "when": "always" + } + }, + { + "name": "com.example.permission.user", + "reason": "$string:permreason_example", + "usedScene": { + "ability": [ + "com.example.Ability", + "com.example.AbilityBackground" + ], + "when": "always" + } + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": "com.example.actscontext.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/app.js b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/app.js new file mode 100644 index 000000000..8e47afff1 --- /dev/null +++ b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/i18n/en-US.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/i18n/zh-CN.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/pages/index/index.css old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/pages/index/index.hml old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/pages/index/index.js old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/context/actscontexttest/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/context/actscontexttest/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..46b750f3e --- /dev/null +++ b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + }, + { + "name": "permreason_example", + "value": "permreason example" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/context/actscontexttest/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js rename to ability/ability_runtime/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js diff --git a/ability/ability_runtime/context/actscontexttest/entry/src/main/js/test/List.test.js b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/test/List.test.js new file mode 100644 index 000000000..77a9affcb --- /dev/null +++ b/ability/ability_runtime/context/actscontexttest/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +require('./ContextJsunit.test.js') diff --git a/aafwk/aafwk_standard/context/actscontexttest/signature/openharmony_sx.p7b b/ability/ability_runtime/context/actscontexttest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/actscontexttest/signature/openharmony_sx.p7b rename to ability/ability_runtime/context/actscontexttest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/context/scene/defpermission/BUILD.gn b/ability/ability_runtime/context/scene/defpermission/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/BUILD.gn rename to ability/ability_runtime/context/scene/defpermission/BUILD.gn diff --git a/aafwk/aafwk_standard/context/scene/defpermission/Test.json b/ability/ability_runtime/context/scene/defpermission/Test.json similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/Test.json rename to ability/ability_runtime/context/scene/defpermission/Test.json diff --git a/aafwk/aafwk_standard/context/scene/defpermission/signature/openharmony_sx.p7b b/ability/ability_runtime/context/scene/defpermission/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/signature/openharmony_sx.p7b rename to ability/ability_runtime/context/scene/defpermission/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/context/scene/defpermission/src/main/config.json b/ability/ability_runtime/context/scene/defpermission/src/main/config.json new file mode 100644 index 000000000..f44aa58fd --- /dev/null +++ b/ability/ability_runtime/context/scene/defpermission/src/main/config.json @@ -0,0 +1,94 @@ +{ + "app": { + "bundleName": "com.example.defpermission", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.defpermission", + "name": ".MyApplication", + "defPermissions": [ + { + "name": "com.example.permission", + "grantMode": "system_grant", + "availableScope": [] + }, + { + "name": "com.example.permission.user", + "grantMode": "user_grant", + "availableScope": [] + } + ], + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.defpermission.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/context/scene/defpermission/src/main/js/default/app.js b/ability/ability_runtime/context/scene/defpermission/src/main/js/default/app.js new file mode 100644 index 000000000..8e47afff1 --- /dev/null +++ b/ability/ability_runtime/context/scene/defpermission/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/context/scene/defpermission/src/main/js/default/i18n/en-US.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/context/scene/defpermission/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/context/scene/defpermission/src/main/js/default/i18n/zh-CN.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/context/scene/defpermission/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/pages/index/index.css b/ability/ability_runtime/context/scene/defpermission/src/main/js/default/pages/index/index.css old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/context/scene/defpermission/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/context/scene/defpermission/src/main/js/default/pages/index/index.hml old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/context/scene/defpermission/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/pages/index/index.js b/ability/ability_runtime/context/scene/defpermission/src/main/js/default/pages/index/index.js old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/context/scene/defpermission/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/context/scene/defpermission/src/main/js/resources/base/element/string.json b/ability/ability_runtime/context/scene/defpermission/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..2f9470d82 --- /dev/null +++ b/ability/ability_runtime/context/scene/defpermission/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/context/scene/defpermission/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/context/scene/defpermission/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/context/scene/defpermission/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/context/scene/defpermission/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/fa/BUILD.gn b/ability/ability_runtime/fa/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/fa/BUILD.gn rename to ability/ability_runtime/fa/BUILD.gn diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/BUILD.gn b/ability/ability_runtime/fa/faapplicationinfo/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/BUILD.gn rename to ability/ability_runtime/fa/faapplicationinfo/BUILD.gn diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/Test.json b/ability/ability_runtime/fa/faapplicationinfo/Test.json similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/Test.json rename to ability/ability_runtime/fa/faapplicationinfo/Test.json diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/config.json b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/config.json rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/app.js b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/app.js similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/app.js rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/app.js diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/en-US.json b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/en-US.json rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/en-US.json diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/zh-CN.json b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/zh-CN.json rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.css b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.css rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.css diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.hml b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.hml rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.hml diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.js b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.js rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility/pages/index/index.js diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/app.js b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/app.js similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/app.js rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/app.js diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/en-US.json b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/en-US.json rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/en-US.json diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/zh-CN.json b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/zh-CN.json rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.css b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.css rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.css diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.hml b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.hml rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.hml diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.js b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.js rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/MainAbility2/pages/index/index.js diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/ApplicationInfoJsunit.test.js b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/test/ApplicationInfoJsunit.test.js similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/ApplicationInfoJsunit.test.js rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/test/ApplicationInfoJsunit.test.js diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/List.test.js b/ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/fa/faapplicationinfo/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/fa/faapplicationinfo/signature/openharmony_sx.p7b b/ability/ability_runtime/fa/faapplicationinfo/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/fa/faapplicationinfo/signature/openharmony_sx.p7b rename to ability/ability_runtime/fa/faapplicationinfo/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/BUILD.gn b/ability/ability_runtime/fa/faconfigurationconstant/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/BUILD.gn rename to ability/ability_runtime/fa/faconfigurationconstant/BUILD.gn diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/Test.json b/ability/ability_runtime/fa/faconfigurationconstant/Test.json similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/Test.json rename to ability/ability_runtime/fa/faconfigurationconstant/Test.json diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/config.json b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/config.json rename to ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/config.json diff --git a/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/app.js b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/JsConfiguration.test.js b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/test/JsConfiguration.test.js similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/JsConfiguration.test.js rename to ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/test/JsConfiguration.test.js diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/List.test.js b/ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/fa/faconfigurationconstant/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/fa/faconfigurationconstant/signature/openharmony_sx.p7b b/ability/ability_runtime/fa/faconfigurationconstant/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/fa/faconfigurationconstant/signature/openharmony_sx.p7b rename to ability/ability_runtime/fa/faconfigurationconstant/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/fa/facoverapi/BUILD.gn b/ability/ability_runtime/fa/facoverapi/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/BUILD.gn rename to ability/ability_runtime/fa/facoverapi/BUILD.gn diff --git a/aafwk/aafwk_standard/fa/facoverapi/Test.json b/ability/ability_runtime/fa/facoverapi/Test.json similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/Test.json rename to ability/ability_runtime/fa/facoverapi/Test.json diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/config.json b/ability/ability_runtime/fa/facoverapi/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/config.json rename to ability/ability_runtime/fa/facoverapi/entry/src/main/config.json diff --git a/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/app.js b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/i18n/zh-CN.json diff --git a/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 000000000..a6053c61f --- /dev/null +++ b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 000000000..6069a046a --- /dev/null +++ b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,21 @@ + + +
+ + {{ $t('strings.hello') }} {{title}} + + +
diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/fa/facoverapi/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/fa/facoverapi/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..76e501f21 --- /dev/null +++ b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "JsHelloWorld" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/fa/facoverapi/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/JsCoverApi.test.js b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/test/JsCoverApi.test.js similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/JsCoverApi.test.js rename to ability/ability_runtime/fa/facoverapi/entry/src/main/js/test/JsCoverApi.test.js diff --git a/aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/List.test.js b/ability/ability_runtime/fa/facoverapi/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/fa/facoverapi/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/fa/facoverapi/signature/openharmony_sx.p7b b/ability/ability_runtime/fa/facoverapi/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/fa/facoverapi/signature/openharmony_sx.p7b rename to ability/ability_runtime/fa/facoverapi/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/BUILD.gn b/ability/ability_runtime/fa/faequeryabilitybywant/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/BUILD.gn rename to ability/ability_runtime/fa/faequeryabilitybywant/BUILD.gn diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/Test.json b/ability/ability_runtime/fa/faequeryabilitybywant/Test.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/Test.json rename to ability/ability_runtime/fa/faequeryabilitybywant/Test.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/config.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/config.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/app.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/app.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/app.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/app.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/en-US.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/en-US.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/en-US.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/zh-CN.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/zh-CN.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.css b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.css rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.css diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.hml b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.hml rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.hml diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/index/index.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.css b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.css similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.css rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.css diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.hml b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.hml rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.hml diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility/pages/second/second.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/app.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/app.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/app.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/app.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/en-US.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/en-US.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/en-US.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/zh-CN.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/zh-CN.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.css b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.css rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.css diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.hml b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.hml rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.hml diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/index/index.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.css b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.css similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.css rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.css diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.hml b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.hml rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.hml diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility2/pages/second/second.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/app.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/app.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/app.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/app.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/en-US.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/en-US.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/en-US.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/zh-CN.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/zh-CN.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.css b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.css rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.css diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.hml b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.hml rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.hml diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/index/index.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.css b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.css similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.css rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.css diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.hml b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.hml rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.hml diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility3/pages/second/second.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/app.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/app.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/app.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/app.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/en-US.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/en-US.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/en-US.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/zh-CN.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/zh-CN.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.css b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.css rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.css diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.hml b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.hml rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.hml diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/index/index.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.css b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.css similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.css rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.css diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.hml b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.hml similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.hml rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.hml diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/MainAbility4/pages/second/second.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/ServiceAbility/service.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/ServiceAbility/service.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/ServiceAbility/service.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/ServiceAbility/service.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/element/string.json rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/JsAbilityDisable.test.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/test/JsAbilityDisable.test.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/JsAbilityDisable.test.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/test/JsAbilityDisable.test.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/List.test.js b/ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/test/List.test.js similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/entry/src/main/js/test/List.test.js rename to ability/ability_runtime/fa/faequeryabilitybywant/entry/src/main/js/test/List.test.js diff --git a/aafwk/aafwk_standard/fa/faequeryabilitybywant/signature/openharmony_sx.p7b b/ability/ability_runtime/fa/faequeryabilitybywant/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/fa/faequeryabilitybywant/signature/openharmony_sx.p7b rename to ability/ability_runtime/fa/faequeryabilitybywant/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/BUILD.gn b/ability/ability_runtime/featureability/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/BUILD.gn rename to ability/ability_runtime/featureability/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/BUILD.gn b/ability/ability_runtime/featureability/actsfeatureabilitytest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/BUILD.gn rename to ability/ability_runtime/featureability/actsfeatureabilitytest/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/Test.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/Test.json rename to ability/ability_runtime/featureability/actsfeatureabilitytest/Test.json diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json new file mode 100644 index 000000000..41ab7b3ff --- /dev/null +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json @@ -0,0 +1,119 @@ +{ + "app": { + "bundleName": "com.example.actsfeatureabilitytest", + "vendor": "jstest", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": { + "default": { + "process": "processTest" + } + }, + "module": { + "package": "com.example.actsfeatureabilitytest", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home", + "flag.home.intent.from.system" + ], + "actions": [ + "action.system.home" + ] + } + ], + "backgroundModes": [ + "dataTransfer" + ], + "name": "com.example.actsfeatureabilitytest.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "singleton", + "process": "processTestAbility", + "permissions": ["ohos.permission.ACCELEROMETER"], + "deviceCapability": ["ability_base","ability_runtime"], + "uri": "uriTest", + "visible": true + } + ], + "reqCapabilities": ["reqCapabilitiesTest1","reqCapabilitiesTest2"], + "description": "descriptionTest", + "defPermissions": [ + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.CAMERA", + "reason": "$string:permreason_camera", + "usedScene": + { + "ability": ["com.mycamera.Ability", "com.mycamera.AbilityBackground"], + "when": "always" + } + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" + }, + { + "name": "ohos.permission.ACCELEROMETER", + "reason":"need use ohos.permission.ACCELEROMETER" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..41e918029 --- /dev/null +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "app_name", + "value": "actsfeatureabilitytest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + }, + { + "name": "permreason_camera", + "value": "permreason camera" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js new file mode 100644 index 000000000..dcdf3a434 --- /dev/null +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/List.test.js @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +require('./FeatureAbilityJsunit.test.js') +require('./StartAbilityJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js rename to ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/BUILD.gn rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/Test.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/Test.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/Test.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/Test.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/config.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/config.json diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/app.js b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..eff19b0ef --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "finishwithresultemptytest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/Test.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/Test.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/Test.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/Test.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/app.js b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..9070c7f70 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "finishwithresultpromiseparameterstest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/BUILD.gn rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/Test.json b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/Test.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/Test.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/Test.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/config.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/config.json diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/app.js b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..e3c30196a --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "finishwithresulttest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/BUILD.gn rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/Test.json b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/Test.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/Test.json rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/Test.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/config.json rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/config.json diff --git a/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/app.js b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..973b7e0bb --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "getcallingbundletest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/startability/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/BUILD.gn rename to ability/ability_runtime/featureability/sceneproject/startability/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/Test.json b/ability/ability_runtime/featureability/sceneproject/startability/Test.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/Test.json rename to ability/ability_runtime/featureability/sceneproject/startability/Test.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/startability/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/signature/openharmony_sx.p7b rename to ability/ability_runtime/featureability/sceneproject/startability/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/startability/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/config.json rename to ability/ability_runtime/featureability/sceneproject/startability/src/main/config.json diff --git a/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/app.js b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/featureability/sceneproject/startability/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..58a3bc255 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "startability" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/sceneproject/startability/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startability/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/featureability/sceneproject/startability/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/BUILD.gn rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/Test.json b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/Test.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/Test.json rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/Test.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/config.json rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/config.json diff --git a/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/app.js b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..d2748bbf6 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "startabilityforresult" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/BUILD.gn b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/BUILD.gn rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/BUILD.gn diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/Test.json b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/Test.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/Test.json rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/Test.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/config.json rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/config.json diff --git a/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/app.js b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/app.js new file mode 100644 index 000000000..c15844220 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.css b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/element/string.json b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..4af6fce32 --- /dev/null +++ b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "terminateabilitytest" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/BUILD.gn b/ability/ability_runtime/formmanager/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/BUILD.gn rename to ability/ability_runtime/formmanager/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/BUILD.gn b/ability/ability_runtime/formmanager/fa/BUILD.gn new file mode 100644 index 000000000..f8328e9ef --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/BUILD.gn @@ -0,0 +1,70 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +group("formmanager") { + testonly = true + if (is_standard_system) { + deps = [ + "formhostst_ets/formsystemhost:FormSystemHost", + "formhostst_ets/formsystemhostb:FormSystemHostB", + "formhostst_ets/formsystemhostc:FormSystemHostC", + "formhostst_ets/formsystemhostd:FormSystemHostD", + "formhostst_ets/formsystemhoste:FormSystemHostE", + "formhostst_ets/formsystemhostf:FormSystemHostF", + "formhostst_ets/formsystemhostg:FormSystemHostG", + "formhostst_ets/formsystemhosti:FormSystemHostI", + "formhostst_ets/formsystemhostj:FormSystemHostJ", + "formhostst_ets/formsystemhostk:FormSystemHostK", + "formhostst_ets/formsystemhostl:FormSystemHostL", + "formhostst_ets/formsystemhostn:FormSystemHostN", + "formhostst_ets/formsystemhostnoperm:FormSystemHostNoPerm", + "formhostst_ets/formsystemhosto:FormSystemHostO", + "formhostst_ets/formsystemhostp:FormSystemHostP", + "formproviderst_ets/formsupplyapplicationA:FormSupplyAppA", + "formproviderst_ets/formsupplyapplicationB:FormSupplyAppB", + "formproviderst_ets/formsupplyapplicationC:FormSupplyAppC", + "formproviderst_ets/formsupplyapplicationD:FormSupplyAppD", + "formproviderst_ets/formsupplyapplicationE:FormSupplyAppE", + "formproviderst_ets/formsupplyapplicationF:FormSupplyAppF", + "formproviderst_ets/formsupplyapplicationG:FormSupplyAppG", + "formproviderst_ets/formsupplyapplicationH:FormSupplyAppH", + "formproviderst_ets/formsupplyapplicationNotSysApp:FormSupplyAppNS", + "formproviderst_ets/formsystemprovidera:FormSystemProviderA", + "formproviderst_ets/formsystemproviderb:FormSystemProviderB", + "formproviderst_ets/formsystemproviderc:FormSystemProviderC", + "formproviderst_ets/formsystemproviderd:FormSystemProviderD", + "formsystemtest_ets/formacquiretest:ActsFormAcquireTest", + "formsystemtest_ets/formacquiretest2:ActsFormAcquire2Test", + "formsystemtest_ets/formdeletetest:ActsFormDeleteTest", + "formsystemtest_ets/formdynamicrefreshtest:ActsFormDynamicRefreshTest", + "formsystemtest_ets/formfuzztest:ActsFormFuzzTest", + "formsystemtest_ets/formgetformsinfotest/formsoneandonetest:ActsFormsOneAndOneTest", + "formsystemtest_ets/formgetformsinfotest/formsoneandtwotest:ActsFormsOneAndTwoTest", + "formsystemtest_ets/formgetformsinfotest/formsoneandzerotest:ActsFormsOneAndZeroTest", + "formsystemtest_ets/formgetformsinfotest/formswithoutpermtest:ActsFormsWithoutPermTest", + "formsystemtest_ets/formgetformsinfotest/formszerotest:ActsFormsZeroTest", + "formsystemtest_ets/formhostdeathrecipienttest:ActsFormHostDeathRecipientTest", + "formsystemtest_ets/formperformancetest:ActsFormPerformanceTest", + "formsystemtest_ets/formreleasetest:ActsFormReleaseTest", + "formsystemtest_ets/formstatetest_disable:ActsFormStateDisableTest", + "formsystemtest_ets/formstatetest_enable:ActsFormStateEnableTest", + "formsystemtest_ets/formstatetest_notifyinvisible:ActsFormStateNotifyInvisibleTest", + "formsystemtest_ets/formstatetest_notifyinvisible2:ActsFormStateNotifyInvisible2Test", + "formsystemtest_ets/formstatetest_notifyvisible:ActsFormStateNotifyVisibleTest", + "formsystemtest_ets/formstresstest:ActsFormStressTest", + "formsystemtest_ets/formupdatefreshtest:ActsFormUpdateRefreshTest", + ] + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..4cdbaedb3 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,304 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from "@ohos.ability.featureAbility"; +import formHost from '@ohos.application.formHost'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private deleteForm = false; + private deleteId = "-1"; + private temporaryId = "-1"; + private temporary = false; + private castForm = false; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formCastEvent = "FMS_FormCast_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formOnUninstallEvent = "FMS_FormOnUninstall_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private publishOnErrorCallBack() { + this.canCreateForm = false; + console.debug("====>formOnErrorEvent Publish CallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====>formOnAcquiredEvent Publish CallBack ====>"); + } + private publishCastCallBack() { + console.debug("====>formCastEvent Publish CallBack ====>"); + } + + private publishOnUninstallCallBack() { + console.debug("====>formOnUninstallEvent Publish CallBack ====>"); + } + + private deleteCallBack(err, data) { + console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); + if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") { + return; + } + formHost.deleteForm(data.data) + .then((data2) => { + console.info('[FormComponent] deleteForm result:' + data2); + }); + + this.canCreateForm = false; + console.info("!!!====>formsystemhost deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); + }) + + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if (want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if (want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + console.log("formsystemhost dimension1:" + this.dimension); + if (want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + console.log("formsystemhost dimension2:" + this.dimension); + if (want.parameters.castForm) { + this.castForm = want.parameters.castForm; + } + if (want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if (want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if (want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:' + this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end' + JSON.stringify(want)); + + if (!want.parameters.isCreate && this.deleteForm) { + console.log("formsystemhost deleteForm start"); + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('formsystemhost deleteForm result:' + data); + let commonEventPublishData = { + data: (data + "") || "0", + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .catch((error) => { + console.info('[FormComponent] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + console.log("formsystemhost deleteForm end"); + } + if (!want.parameters.isCreate && this.castForm) { + console.log("[FormComponent.host] castTempForm start"); + formHost.castTempForm(this.temporaryId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + setTimeout(() => { + let commonEventPublishData = { + data: (data + "") || "0", + parameters: { + "formId": this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error); + setTimeout(() => { + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }); + console.log("[FormComponent.host] castTempForm end"); + } + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.log(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.log("[FormComponent.host] get form, form id:" + form.id); + this.formId = form.id; + if (this.castForm) { + console.log("[FormComponent.host] castTempForm start"); + formHost.castTempForm(this.temporaryId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + setTimeout(() => { + let commonEventPublishData = { + data: (data + "") || "0", + parameters: { + "formId": this.formId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error); + setTimeout(() => { + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }); + console.log("[FormComponent.host] castTempForm end"); + } else if (this.deleteForm) { + console.log("[FormComponent.host] deleteForm start"); + if (this.deleteId == "self") { + this.deleteId = this.formId.toString(); + } + setTimeout(() => { + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent] deleteForm result:' + data); + let commonEventPublishData = { + data: (data + "") || "0", + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .catch((error) => { + console.info('[FormComponent] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + + console.log("[FormComponent.host] deleteForm end"); + }, 1000); + } else { + let commonEventPublishData = { + data: this.formId.toString(), + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onUninstall((info) => { + console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); + let commonEventPublishData = { + data: this.formId.toString(), + parameters: { + "formId": info.id.toString() + } + }; + commonEvent.publish(this.formOnUninstallEvent, commonEventPublishData, this.publishOnUninstallCallBack); + }) + .onError((error) => { + console.log("[FormComponent.host] error code:" + error.errcode); + console.log("[FormComponent.host] error msg:" + error.msg); + if (this.deleteForm && this.deleteId) { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId": this.formId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } else { + let commonEventPublishData = { + data: error.msg + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhost/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..a53162bb5 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,261 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from "@ohos.ability.featureAbility"; +import formHost from '@ohos.application.formHost'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private deleteForm = false; + private deleteId = "-1"; + private temporaryId="-1"; + private temporary = false; + private castForm = false; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formCastEvent = "FMS_FormCast_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + private subscriberDle; + + private publishOnErrorCallBack() { + this.canCreateForm = false; + console.debug("====>formOnErrorEvent Publish CallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====>formOnAcquiredEvent Publish CallBack ====>"); + } + private publishCastCallBack() { + console.debug("====>formCastEvent Publish CallBack ====>"); + } + private deleteCallBack(err, data) { + console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); + if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostb") { + return; + } + formHost.deleteForm(data.data) + .then((data2) => { + console.info('[FormComponent] deleteForm result:' + data2); + }); + + this.canCreateForm = false; + console.info("!!!====>formsystemhost deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDle = data; + await commonEvent.subscribe(this.subscriberDle, this.deleteCallBack); + }) + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if(want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if(want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if(want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if(!this.dimension) { + this.dimension = FormDimension.Dimension_1_2; + } + if(want.parameters.castForm) { + this.castForm = want.parameters.castForm; + } + if(want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if(want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if(want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end'+ JSON.stringify(want)); + + if(!want.parameters.isCreate && this.deleteForm) { + console.log("formsystemhostb deleteForm start"); + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('formsystemhostb deleteForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .catch((error) => { + console.info('[FormComponent] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + + console.log("formsystemhostb deleteForm end"); + } + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.log(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.log("[FormComponent.host] get form, form id:" + form.id); + this.formId = form.id; + if(this.castForm) { + console.log("[FormComponent.host] castTempForm start"); + formHost.castTempForm(this.temporaryId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + setTimeout(() => { + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error); + setTimeout(() => { + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }); + + console.log("[FormComponent.host] castTempForm end"); + } else if(this.deleteForm) { + console.log("[FormComponent.host] deleteForm start"); + if(this.deleteId == "self") { + this.deleteId = this.formId.toString(); + } + setTimeout(() => { + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent] deleteForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .catch((error) => { + console.info('[FormComponent] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + console.log("[FormComponent.host] deleteForm end"); + }, 1000); + } else { + let commonEventPublishData = { + data: this.formId.toString() + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + // .onUninstall((info) => { + // console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); + // }) + .onError((error) => { + console.log("[FormComponent.host] error code:" + error.errcode); + console.log("[FormComponent.host] error msg:" + error.msg); + if(this.deleteForm && this.deleteId) { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } else { + let commonEventPublishData = { + data: error.msg + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostb/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/BUILD.gn new file mode 100644 index 000000000..9037fff95 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostC") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostC" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json new file mode 100644 index 000000000..f07e7e2fa --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json @@ -0,0 +1,140 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhostc", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhostc", + "name": ".FormStHostAppC", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormCast_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_TimeChange_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent" + }, + { + "name": "FMS_FormCast_commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "name": "FMS_TimeChange_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.REQUIRE_FORM" + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..6233d7ae5 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostC" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostc/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..146fd62ef --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,333 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from "@ohos.ability.featureAbility"; +import formHost from '@ohos.application.formHost'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private releaseForm = false; + private releaseId = "-1"; + private deleteForm = false; + private deleteId = "-1"; + private temporaryId="-1"; + private temporary = false; + private castForm = false; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formCastEvent = "FMS_FormCast_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; + private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private publishOnErrorCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc formOnErrorEventCallBack ====>"); + } + private publishOnDeletedCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc publishOnDeletedCallBack ====>"); + } + private publishOnReleasedCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc publishOnReleasedCallBackk ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>"); + } + private publishCastCallBack() { + console.debug("====>formsystemhostc formCastEventCallBack ====>"); + } + + private deleteCallBack(err, data) { + console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); + if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostd") { + return; + } + formHost.deleteForm(data.data) + .then((data2) => { + console.info('[FormComponent] deleteForm result:' + data2); + }); + + this.canCreateForm = false; + console.info("!!!====>formsystemhost deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); + }) + + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if(want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if(want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if(want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if(!this.dimension) { + this.dimension = FormDimension.Dimension_1_2; + } + if(want.parameters.castForm) { + this.castForm = want.parameters.castForm; + } + if(want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if(want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if(want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + if(want.parameters.releaseForm) { + this.releaseForm = want.parameters.releaseForm; + } + if(want.parameters.releaseId) { + this.releaseId = want.parameters.releaseId; + } + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end'+ JSON.stringify(want)); + + if(!want.parameters.isCreate && this.deleteForm) { + console.log("formsystemhost deleteForm start"); + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('formsystemhost deleteForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }) + .catch((error) => { + console.info('formsystemhost deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }); + + console.log("formsystemhost deleteForm end"); + } + + if(!want.parameters.isCreate && this.releaseForm) { + console.log("formsystemhost releaseForm start"); + formHost.releaseForm(this.releaseId) + .then((data) => { + console.info('formsystemhost releaseForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.releaseId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); + }) + .catch((error) => { + console.info('formsystemhost releaseForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.releaseId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); + }); + + console.log("formsystemhost releaseForm end"); + } + + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.log(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.log("[FormComponent.host] get form, form id:" + form.id); + this.formId = form.id; + if(this.castForm) { + console.log("[FormComponent.host] castTempForm start"); + formHost.castTempForm(this.temporaryId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + setTimeout(() => { + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error); + setTimeout(() => { + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }); + console.log("[FormComponent.host] castTempForm end"); + } else if(this.deleteForm) { + console.log("[FormComponent.host] deleteForm start"); + if(this.deleteId == "self") { + this.deleteId = this.formId.toString(); + } + setTimeout(() => { + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent] deleteForm result:' + data); + var commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }) + .catch((error) => { + console.info('formsystemhost deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }); + + console.log("[FormComponent.host] deleteForm end"); + }, 1000); + } else if(this.releaseForm) { + console.log("[FormComponent.host] releaseForm start"); + if(this.releaseId == "self") { + this.releaseId = this.formId.toString(); + } + setTimeout(() => { + formHost.releaseForm(this.releaseId) + .then((data) => { + console.info('[FormComponent] releaseForm result:' + data); + let retData = "-1"; + if((data + "") == "0") { + retData = data + ""; + } + var commonEventPublishData = { + data: retData, + parameters: { + "formId" : this.releaseId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); + }); + + console.log("[FormComponent.host] releaseForm end"); + }, 1000); + } else { + var commonEventPublishData = { + data: this.formId.toString() + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + // .onUninstall((info) => { + // console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); + // }) + .onError((error) => { + console.log("[FormComponent.host] error code:" + error.errcode); + console.log("[FormComponent.host] error msg:" + error.msg); + if(this.deleteForm && this.deleteId) { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + } else { + let commonEventPublishData = { + data: error.msg + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostd/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..5ff6d96e8 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,416 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from '@ohos.ability.featureAbility'; +import formHost from '@ohos.application.formHost'; +import formProvider from '@ohos.application.formProvider'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private requestForm = false; + private requestId = "-1"; + private refreshForm = false; + private refreshId = "-1"; + private refreshTime = 5; + private notifyVisibleForms = false; + private notifyVisibleId = "-1"; + private deleteForm = false; + private deleteId = "-1"; + private temporaryId = "-1"; + private temporary = false; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; + private formOnDynamicRefreshEvent = "FMS_FormDynamicRefresh_commonEvent"; + private formOnRequestEvent = "FMS_FormOnRequest_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private publishOnErrorCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc formOnErrorEventCallBack ====>"); + } + private publishOnDeletedCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc publishOnDeletedCallBack ====>"); + } + private formOnDynamicRefreshCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc formOnDynamicRefreshEventk ====>"); + } + private formOnRequestCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc formOnRequestCallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>"); + } + + private deleteCallBack(err, data) { + console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); + if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") { + return; + } + formHost.deleteForm(data.data) + .then((data2) => { + console.info('[FormComponent] deleteForm result:' + data2); + }); + + this.canCreateForm = false; + console.info("!!!====>formsystemhost deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); + }) + + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if (want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if (want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if (want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if (!this.dimension) { + this.dimension = FormDimension.Dimension_1_2; + } + if (want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if (want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if (want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + if (want.parameters.refreshForm) { + this.refreshForm = want.parameters.refreshForm; + } + if (want.parameters.refreshId) { + this.refreshId = want.parameters.refreshId; + } + if (want.parameters.refreshTime) { + this.refreshTime = want.parameters.refreshTime; + } + if (want.parameters.requestForm) { + this.requestForm = want.parameters.requestForm; + } + if (want.parameters.requestId) { + this.requestId = want.parameters.requestId; + } + if (want.parameters.notifyVisibleForms) { + this.notifyVisibleForms = want.parameters.notifyVisibleForms; + } + if (want.parameters.notifyVisibleId) { + this.notifyVisibleId = want.parameters.notifyVisibleId; + } + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:' + this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end' + JSON.stringify(want)); + + if (!want.parameters.isCreate && this.deleteForm) { + console.log("formsystemhost deleteForm start"); + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('formsystemhost deleteForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }) + .catch((error) => { + console.info('formsystemhost deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }); + + console.log("formsystemhost deleteForm end"); + } + if (!want.parameters.isCreate && this.refreshForm) { + console.log("formsystemhost refreshForm start"); + formProvider.setFormNextRefreshTime(this.refreshId, this.refreshTime) + .then((data) => { + console.info('formsystemhost refreshForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId": this.refreshId.toString() + } + }; + commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); + }) + .catch((error) => { + console.info('formsystemhost refreshForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.refreshId.toString() + } + }; + commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); + }); + + console.log("formsystemhost deleteForm end"); + } + if (!want.parameters.isCreate && this.requestForm) { + console.log("[FormComponent.host] requestForm start"); + formHost.requestForm(this.requestId) + .then((data) => { + console.info('[FormComponent] requestForm result:' + data); + var commonEventPublishData = { + data: "0", + parameters: { + "formId": this.requestId + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.formOnRequestCallBack); + }) + .catch((error) => { + console.info('[FormComponent] requestForm error:' + error.toString()); + var commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.requestId + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.formOnRequestCallBack); + }); + + console.log("[FormComponent.host] requestForm end"); + } + + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.log(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.log("[FormComponent.host] get form, form id:" + form.id); + this.formId = form.id; + if (this.deleteForm) { + console.log("[FormComponent.host] deleteForm start"); + if (this.deleteId == "self") { + this.deleteId = this.formId.toString(); + } + setTimeout(() => { + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent] deleteForm result:' + data); + var commonEventPublishData = { + data: "0", + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }) + .catch((error) => { + console.info('formsystemhost deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }); + + console.log("[FormComponent.host] deleteForm end"); + }, 1000); + } else if (this.requestForm) { + console.log("[FormComponent.host] requestForm start"); + if (this.requestId == "self") { + this.requestId = this.formId.toString(); + } + setTimeout(() => { + formHost.requestForm(this.requestId) + .then((data) => { + console.info('[FormComponent] requestForm result:' + data); + var delFormId = this.requestId; + if (this.requestId == "0" || this.requestId == "-1") { + delFormId = this.formId.toString(); + } + var commonEventPublishData = { + data: "0", + parameters: { + "formId": delFormId + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.formOnRequestCallBack); + }) + .catch((error) => { + console.info('[FormComponent] requestForm error:' + error); + var delFormId = this.requestId; + if (this.requestId == "0" || this.requestId == "-1") { + delFormId = this.formId.toString(); + } + var commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": delFormId + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.formOnRequestCallBack); + }); + + console.log("[FormComponent.host] requestForm end"); + }, 1000); + } else if (this.refreshForm) { + console.log("formsystemhost refreshForm start"); + if (this.refreshId == "self") { + this.refreshId = this.formId.toString(); + } + setTimeout(() => { + formProvider.setFormNextRefreshTime(this.refreshId, this.refreshTime) + .then((data) => { + console.info('formsystemhost refreshForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId": this.refreshId.toString() + } + }; + commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); + }) + .catch((error) => { + console.info('formsystemhost refreshForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.refreshId.toString() + } + }; + commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); + }); + }, 1000); + } else if (this.notifyVisibleForms) { + console.log("formsystemhost notifyVisibleForms start"); + if (this.notifyVisibleId == "self") { + this.notifyVisibleId = this.formId.toString(); + } + setTimeout(() => { + formHost.notifyVisibleForms([this.notifyVisibleId]) + .then((data) => { + console.info('formsystemhost notifyVisibleForms result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId": this.notifyVisibleId.toString() + } + }; + }) + .catch((error) => { + console.info('formsystemhost notifyVisibleForms error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.notifyVisibleId.toString() + } + }; + }); + }, 1000); + } else { + var commonEventPublishData = { + data: this.formId.toString() + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onUninstall((info) => { + console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); + }) + .onError((error) => { + console.log("[FormComponent.host] error code:" + error.errcode); + console.log("[FormComponent.host] error msg:" + error.msg); + if (this.deleteForm && this.deleteId) { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId": this.formId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + } else { + let commonEventPublishData = { + data: error.msg + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhoste/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/BUILD.gn new file mode 100644 index 000000000..9c7a98142 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostF") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostF" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json new file mode 100644 index 000000000..9665ee652 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json @@ -0,0 +1,132 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhostf", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhostf", + "name": ".FormStHostAppF", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormUpdateRefresh_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "name": "FMS_FormUpdateRefresh_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.REQUIRE_FORM" + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..4581aaedc --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,439 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from '@ohos.ability.featureAbility'; +import formBindingData from '@ohos.application.formBindingData'; +import formManager from '@ohos.application.formHost'; +import formProvider from '@ohos.application.formProvider'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private updateForm = false; + private updateId = "-1"; + private jsonEmpty = false; + private releaseForm = false; + private releaseId = "-1"; + private deleteForm = false; + private deleteId = "-1"; + private temporaryId="-1"; + private temporary = false; + + private isStartOtherApp = false; + private otherAppState = "visible"; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; + private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent"; + private formOnUpdatedEvent = "FMS_FormUpdateRefresh_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private publishOnErrorCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc formOnErrorEventCallBack ====>"); + } + private publishOnDeletedCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc publishOnDeletedCallBack ====>"); + } + private publishOnReleasedCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc publishOnReleasedCallBackk ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>"); + } + private publishOnUpdatedCallBack() { + this.canCreateForm = false; + console.debug("====>formsystemhostc publishOnUpdatedCallBack ====>"); + } + private deleteCallBack(err, data) { + console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); + if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostf") { + return; + } + formManager.deleteForm(data.data) + .then((data2) => { + console.info('[FormComponent] deleteForm result:' + data2); + }); + + this.canCreateForm = false; + console.info("!!!====>formsystemhost deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); + }) + + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if(want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if(want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if(want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if(!this.dimension) { + this.dimension = FormDimension.Dimension_1_2; + } + if(want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if(want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if(want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + if(want.parameters.releaseForm) { + this.releaseForm = want.parameters.releaseForm; + } + if(want.parameters.releaseId) { + this.releaseId = want.parameters.releaseId; + } + if(want.parameters.updateForm) { + this.updateForm = want.parameters.updateForm; + } + if(want.parameters.updateId) { + this.updateId = want.parameters.updateId; + } + if(want.parameters.jsonEmpty) { + this.jsonEmpty = want.parameters.jsonEmpty; + } + if(want.parameters.isStartOtherApp) { + this.isStartOtherApp = true; + if(want.parameters.otherAppState) { + this.otherAppState = want.parameters.otherAppState; + } + } + + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end'+ JSON.stringify(want)); + + if(!want.parameters.isCreate && this.deleteForm) { + console.log("formsystemhost deleteForm start"); + formManager.deleteForm(this.deleteId) + .then((data) => { + console.info('formsystemhost deleteForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }) + .catch((error) => { + console.info('formsystemhost deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }); + + console.log("formsystemhost deleteForm end"); + } + + if(!want.parameters.isCreate && this.releaseForm) { + console.log("formsystemhost releaseForm start"); + formManager.releaseForm(this.releaseId) + .then((data) => { + console.info('formsystemhost releaseForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId" : this.releaseId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); + }) + .catch((error) => { + console.info('formsystemhost releaseForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.releaseId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); + }); + + console.log("formsystemhost releaseForm end"); + } + + if(!want.parameters.isCreate && this.updateForm) { + console.log("formsystemhost updateForm start"); + let formData = { + temperature: "11°", + time: "11:00", + area: "Shenyang", + epidemic: true, + count: 10 + }; + if(this.jsonEmpty) { + formData = { + temperature: "", + time: "", + area: "", + epidemic: true, + count: 1 + }; + } + let bindingData = formBindingData.createFormBindingData(formData); + formProvider.updateForm(this.updateId, bindingData) + .then((data) => { + console.info('formsystemhost updateForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId" : this.updateId + } + }; + commonEvent.publish(this.formOnUpdatedEvent, commonEventPublishData, this.publishOnUpdatedCallBack); + }) + .catch((error) => { + console.info('formsystemhost updateForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.updateId + } + }; + commonEvent.publish(this.formOnUpdatedEvent, commonEventPublishData, this.publishOnUpdatedCallBack); + }); + + console.log("formsystemhost releaseForm end"); + } + + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.log(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.log("[FormComponent.host] get form, form id:" + form.id); + this.formId = form.id; + if(this.deleteForm) { + console.log("[FormComponent.host] deleteForm start"); + if(this.deleteId == "self") { + this.deleteId = this.formId.toString(); + } + setTimeout(() => { + formManager.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent] deleteForm result:' + data); + var commonEventPublishData = { + data: "0", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }) + .catch((error) => { + console.info('formsystemhost deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }); + console.log("[FormComponent.host] deleteForm end"); + }, 500); + } else if(this.releaseForm) { + console.log("[FormComponent.host] releaseForm start"); + if(this.releaseId == "self") { + this.releaseId = this.formId.toString(); + } + setTimeout(() => { + formManager.releaseForm(this.releaseId) + .then((data) => { + console.info('[FormComponent] releaseForm result:' + data); + var commonEventPublishData = { + data: "0", + parameters: { + "formId" : this.releaseId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); + }) + .catch((error) => { + console.info('formsystemhost releaseForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.releaseId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishOnReleasedCallBack); + }); + + console.log("[FormComponent.host] releaseForm end"); + }, 500); + } else if (this.updateForm) { + console.log("formsystemhost updateForm start"); + let formData = { + temperature: "11°", + time: "11:00", + area: "Shenyang", + epidemic: true, + count: 10 + }; + if(this.jsonEmpty) { + formData = { + temperature: "", + time: "", + area: "", + epidemic: true, + count: 1 + }; + } + let bindingData = formBindingData.createFormBindingData(formData); + formProvider.updateForm(this.updateId, bindingData) + .then((data) => { + console.info('formsystemhost updateForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId" : this.updateId + } + }; + commonEvent.publish(this.formOnUpdatedEvent, commonEventPublishData, this.publishOnUpdatedCallBack); + }) + .catch((error) => { + console.info('formsystemhost updateForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.updateId + } + }; + commonEvent.publish(this.formOnUpdatedEvent, commonEventPublishData, this.publishOnUpdatedCallBack); + }); + + console.log("formsystemhost releaseForm end"); + } else if (this.isStartOtherApp) { + console.log("formsystemhost app G start"); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : this.otherAppState, + "stateIds" : [this.formId.toString()], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`formsystemhost featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`formsystemhost featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + } else { + var commonEventPublishData = { + data: this.formId.toString() + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + // .onUninstall((info) => { + // console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); + // }) + .onError((error) => { + console.log("[FormComponent.host] error code:" + error.errcode); + console.log("[FormComponent.host] error msg:" + error.msg); + if(this.deleteForm && this.deleteId) { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + } else { + let commonEventPublishData = { + data: error.msg + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..f7a07615b --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostF" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostf/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/BUILD.gn new file mode 100644 index 000000000..c20baa75e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostG") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostG" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json new file mode 100644 index 000000000..1ef54c5fa --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json @@ -0,0 +1,124 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhostg", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhostg", + "name": ".FormStHostAppG", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnState_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "name": "FMS_FormOnState_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.REQUIRE_FORM" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..e88deae73 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.host] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.host] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..29c50881b --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,502 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from "@ohos.ability.featureAbility"; +import formHost from '@ohos.application.formHost'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private stateForm = "visible"; + private doStateForm = false; + private stateIds = []; + private deleteForm = false; + private deleteId = "-1"; + private temporaryId="-1"; + private temporary = false; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; + private formOnStateEvent = "FMS_FormOnState_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private publishOnErrorCallBack() { + this.canCreateForm = false; + console.debug("====>[FormComponent.host] formOnErrorEventCallBack ====>"); + } + private publishOnDeletedCallBack() { + this.canCreateForm = false; + console.debug("====>[FormComponent.host] publishOnDeletedCallBack ====>"); + } + private publishOnStateCallBack() { + this.canCreateForm = false; + console.debug("====>[FormComponent.host] publishOnStateCallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====>[FormComponent.host] formOnAcquiredEventCallBack ====>"); + } + private deleteCallBack(err, data) { + console.info("!!!====>[FormComponent.host] deleteCallBack start:====>" + JSON.stringify(data)); + if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostg") { + return; + } + formHost.deleteForm(data.data) + .then((data2) => { + console.info('[FormComponent] deleteForm result:' + data2); + }); + + this.canCreateForm = false; + console.info("!!!====>[FormComponent.host] deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>[FormComponent.host] Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); + }) + + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if(want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if(want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if(want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if(!this.dimension) { + this.dimension = FormDimension.Dimension_1_2; + } + if(want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if(want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if(want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + if(want.parameters.stateForm) { + this.stateForm = want.parameters.stateForm; + this.doStateForm = true; + } + if(want.parameters.stateIds) { + this.stateIds = want.parameters.stateIds; + } + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end'+ JSON.stringify(want)); + + if(!want.parameters.isCreate && this.deleteForm) { + console.log("[FormComponent.host] deleteForm start"); + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent.host] deleteForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId" : this.deleteId, + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId, + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }); + + console.log("[FormComponent.host] deleteForm end"); + } + + if(!want.parameters.isCreate && this.stateForm) { + if(this.stateForm == "visible") { + console.log("[FormComponent.host] notifyVisibleForm start"); + formHost.notifyVisibleForms(this.stateIds) + .then((data) => { + console.info('[FormComponent.host] notifyVisibleForm result:' + data); + console.info('[FormComponent.host] notifyVisibleForm formId:' + this.stateIds[0]); + let commonEventPublishData = { + data: "0", + parameters: { + "kind": "visible", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] notifyVisibleForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "kind": "visible", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }); + console.log("[FormComponent.host] notifyVisibleForm end"); + } else if(this.stateForm == "invisible") { + console.log("[FormComponent.host] notifyInvisibleForm start"); + formHost.notifyInvisibleForms(this.stateIds) + .then((data) => { + console.info('[FormComponent.host] notifyInvisibleForm result:' + data); + console.info('[FormComponent.host] notifyInvisibleForm formId:' + this.stateIds[0]); + let commonEventPublishData = { + data: "0", + parameters: { + "kind": "invisible", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] notifyInvisibleForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "kind": "invisible", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }); + console.log("[FormComponent.host] notifyInvisibleForm end"); + } else if(this.stateForm == "enable") { + console.log("[FormComponent.host] enableFormsUpdate start"); + formHost.enableFormsUpdate(this.stateIds) + .then((data) => { + console.info('[FormComponent.host] enableFormsUpdate result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "kind": "enable", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] enableFormsUpdate error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "kind": "enable", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }); + console.log("[FormComponent.host] enableFormsUpdate end"); + } else { + console.log("[FormComponent.host] disableFormsUpdate start"); + formHost.disableFormsUpdate(this.stateIds) + .then((data) => { + console.info('[FormComponent.host] disableFormsUpdate result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "kind": "disable", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] disableFormsUpdate error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "kind": "disable", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }); + console.log("[FormComponent.host] disableFormsUpdate end"); + } + } + + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.log(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.log("[FormComponent.host] get form, form id:" + form.id); + this.formId = form.id; + if(this.deleteForm) { + console.log("[FormComponent.host] deleteForm start"); + if(this.deleteId == "self") { + this.deleteId = this.formId.toString(); + } + setTimeout(() => { + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent] deleteForm result:' + data); + let commonEventPublishData = { + data: "0", + parameters: { + "formId" : this.deleteId, + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + }); + + console.log("[FormComponent.host] deleteForm end"); + }, 500); + } else if(this.doStateForm) { + console.log("[FormComponent.host] state start"); + if((this.stateIds.length != 0) && (this.stateIds[0] == "self")) { + this.stateIds = [this.formId.toString()]; + } + console.info('[FormComponent.host] notifyVisibleForm stateIds:' + this.stateIds); + setTimeout(() => { + if(this.stateForm == "visible") { + console.log("[FormComponent.host] notifyVisibleForm start"); + formHost.notifyVisibleForms(this.stateIds) + .then((data) => { + console.info('[FormComponent.host] notifyVisibleForm result:' + data); + console.info('[FormComponent.host] notifyVisibleForm formId:' + this.stateIds[0]); + if(this.stateIds.length == 0) { + this.stateIds = ["-1"]; + } + let commonEventPublishData = { + data: "0", + parameters: { + "kind": "visible", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] notifyVisibleForm error:' + error); + if(this.stateIds.length == 0) { + this.stateIds = ["-1"]; + } + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "kind": "visible", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }); + console.log("[FormComponent.host] notifyVisibleForm end"); + } else if(this.stateForm == "invisible") { + console.log("[FormComponent.host] notifyInvisibleForm start"); + formHost.notifyInvisibleForms(this.stateIds) + .then((data) => { + console.info('[FormComponent.host] notifyInvisibleForm result:' + data); + if(this.stateIds.length == 0) { + this.stateIds = ["-1"]; + } + console.info('[FormComponent.host] notifyInvisibleForm formId:' + this.stateIds[0]); + let commonEventPublishData = { + data: "0", + parameters: { + "kind": "invisible", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] notifyInvisibleForm error:' + error.code); + if(this.stateIds.length == 0) { + this.stateIds = ["-1"]; + } + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "kind": "invisible", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }); + console.log("[FormComponent.host] notifyInvisibleForm end"); + } else if(this.stateForm == "enable") { + console.log("[FormComponent.host] enableFormsUpdate start"); + formHost.enableFormsUpdate(this.stateIds) + .then((data) => { + console.info('[FormComponent.host] enableFormsUpdate result:' + data); + if(this.stateIds.length == 0) { + this.stateIds = ["-1"]; + } + let commonEventPublishData = { + data: "0", + parameters: { + "kind": "enable", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] enableFormsUpdate error:' + error); + if(this.stateIds.length == 0) { + this.stateIds = ["-1"]; + } + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "kind": "enable", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }); + console.log("[FormComponent.host] enableFormsUpdate end"); + } else { + console.log("[FormComponent.host] disableFormsUpdate start"); + formHost.disableFormsUpdate(this.stateIds) + .then((data) => { + console.info('[FormComponent.host] disableFormsUpdate result:' + data); + if(this.stateIds.length == 0) { + this.stateIds = ["-1"]; + } + let commonEventPublishData = { + data: "0", + parameters: { + "kind": "disable", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }) + .catch((error) => { + console.info('[FormComponent.host] disableFormsUpdate error:' + error); + if(this.stateIds.length == 0) { + this.stateIds = ["-1"]; + } + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "kind": "disable", + "formId" : this.stateIds[0] + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishOnStateCallBack); + }); + console.log("[FormComponent.host] disableFormsUpdate end"); + } + }, 1000); + } else { + let commonEventPublishData = { + data: this.formId.toString(), + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onUninstall((info) => { + console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); + }) + .onError((error) => { + console.log("[FormComponent.host] error code:" + error.errcode); + console.log("[FormComponent.host] error msg:" + error.msg); + if(this.deleteForm && this.deleteId) { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishOnDeletedCallBack); + } else { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId" : "-1" + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..380d13176 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostG" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostg/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..e88deae73 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.host] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.host] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..5c438bcde --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,290 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from "@ohos.ability.featureAbility"; +import formHost from '@ohos.application.formHost'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + + private dimension: FormDimension = FormDimension.Dimension_1_2; + private deleteForm = false; + private deleteId = "-1"; + private temporaryId = "-1"; + private temporary = false; + private castForm = false; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formCastEvent = "FMS_FormCast_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private publishOnErrorCallBack() { + this.canCreateForm = false; + console.info("====>formOnErrorEvent Publish CallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.info("====>formOnAcquiredEvent Publish CallBack ====>"); + } + private publishCastCallBack() { + console.info("====>formCastEvent Publish CallBack ====>"); + } + + private deleteCallBack(err, data) { + console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data)); + if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") { + return; + } + formHost.deleteForm(data.data) + .then((data2) => { + console.info('[FormComponent] deleteForm result:' + data2); + }); + + this.canCreateForm = false; + console.info("!!!====>formsystemhost deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>formsystemhost Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); + }) + + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if (want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if (want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if (want.parameters.castForm) { + this.castForm = want.parameters.castForm; + } + if (want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if (want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if (want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if (want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:' + this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end' + JSON.stringify(want)); + + if (!want.parameters.isCreate && this.deleteForm) { + console.info("formsystemhost deleteForm start"); + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('formsystemhost deleteForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .catch((error) => { + console.info('[FormComponent] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + console.info("formsystemhost deleteForm end"); + } + if (!want.parameters.isCreate && this.castForm) { + console.info("[FormComponent.host] castTempForm start"); + formHost.castTempForm(this.temporaryId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + setTimeout(() => { + let commonEventPublishData = { + data: data + "", + parameters: { + "formId": this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error); + setTimeout(() => { + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }); + console.info("[FormComponent.host] castTempForm end"); + } + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.info(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info("[FormComponent.host] get form, form id:" + form.id); + this.formId = form.id; + if (this.castForm) { + console.info("[FormComponent.host] castTempForm start"); + formHost.castTempForm(this.temporaryId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + setTimeout(() => { + let commonEventPublishData = { + data: data + "", + parameters: { + "formId": this.formId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error); + setTimeout(() => { + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }); + console.info("[FormComponent.host] castTempForm end"); + } else if (this.deleteForm) { + console.info("[FormComponent.host] deleteForm start"); + if (this.deleteId == "self") { + this.deleteId = this.formId.toString(); + } + setTimeout(() => { + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent] deleteForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .catch((error) => { + console.info('[FormComponent] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + + console.info("[FormComponent.host] deleteForm end"); + }, 1000); + } else { + let commonEventPublishData = { + data: this.formId.toString(), + parameters: { + "formId": this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onUninstall((info) => { + console.info("[FormComponent] onUninstall:" + JSON.stringify(info)); + }) + .onError((error) => { + console.info("[FormComponent.host] error code:" + error.errcode); + console.info("[FormComponent.host] error msg:" + error.msg); + if (this.deleteForm && this.deleteId) { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId": this.formId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } else { + let commonEventPublishData = { + data: error.msg + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosti/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..e88deae73 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.host] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.host] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..0c610edc2 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,290 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from "@ohos.ability.featureAbility"; +import formManager from '@ohos.application.formHost'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private deleteForm = false; + private deleteId = "-1"; + private temporaryId="-1"; + private temporary = false; + private castForm = false; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formCastEvent = "FMS_FormCast_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private publishOnErrorCallBack() { + this.canCreateForm = false; + console.debug("====>formOnErrorEvent Publish CallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====>formOnAcquiredEvent Publish CallBack ====>"); + } + private publishCastCallBack() { + console.debug("====>formCastEvent Publish CallBack ====>"); + } + + private deleteCallBack(err, data) { + console.info("!!!====>formsystemhostj deleteCallBack start:====>" + JSON.stringify(data)); + if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostj") { + return; + } + formManager.deleteForm(data.data) + .then((data2) => { + console.info('[FormComponent] deleteForm result:' + data2); + }); + + this.canCreateForm = false; + console.info("!!!====>formsystemhostj deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>formsystemhostj Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + await commonEvent.subscribe(this.subscriberDel, this.deleteCallBack); + }) + + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + this.moduleName = want.parameters.moduleName; + if(want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + console.log("formsystemhostj dimension1:" + this.dimension); + if(want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + console.log("formsystemhostj dimension2:" + this.dimension); + if(want.parameters.castForm) { + this.castForm = want.parameters.castForm; + } + if(want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if(want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if(want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end'+ JSON.stringify(want)); + + if(!want.parameters.isCreate && this.deleteForm) { + console.log("formsystemhostj deleteForm start"); + formManager.deleteForm(this.deleteId) + .then((data) => { + console.info('formsystemhostj deleteForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .catch((error) => { + console.info('[FormComponent] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + console.log("formsystemhostj deleteForm end"); + } + if(!want.parameters.isCreate && this.castForm) { + console.log("[FormComponent.host] castTempForm start"); + formManager.castTempForm(this.temporaryId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + setTimeout(() => { + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error); + setTimeout(() => { + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }); + console.log("[FormComponent.host] castTempForm end"); + } + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.log(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.log("[FormComponent.host] get form, form id:" + form.id); + this.formId = form.id; + if(this.castForm) { + console.log("[FormComponent.host] castTempForm start"); + formManager.castTempForm(this.temporaryId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + setTimeout(() => { + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error); + setTimeout(() => { + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.temporaryId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }, 5); + }); + console.log("[FormComponent.host] castTempForm end"); + } else if(this.deleteForm) { + console.log("[FormComponent.host] deleteForm start"); + if(this.deleteId == "self") { + this.deleteId = this.formId.toString(); + } + setTimeout(() => { + formManager.deleteForm(this.deleteId) + .then((data) => { + console.info('[FormComponent] deleteForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .catch((error) => { + console.info('[FormComponent] deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + + console.log("[FormComponent.host] deleteForm end"); + }, 1000); + } else { + let commonEventPublishData = { + data: this.formId.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + // .onUninstall((info) => { + // console.log("[FormComponent] onUninstall:" + JSON.stringify(info)); + // }) + .onError((error) => { + console.log("[FormComponent.host] error code:" + error.errcode); + console.log("[FormComponent.host] error msg:" + error.msg); + if(this.deleteForm && this.deleteId) { + let commonEventPublishData = { + data: error.msg, + parameters: { + "formId" : this.formId.toString() + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } else { + let commonEventPublishData = { + data: error.msg + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + } + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostj/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/BUILD.gn new file mode 100644 index 000000000..af31e1793 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostK") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostK" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json new file mode 100644 index 000000000..4b25e4f03 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json @@ -0,0 +1,143 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhostk", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhostk", + "name": ".FormStHostAppK", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnCast_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormTerminate_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnRequest_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnReleased_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent" + }, + { + "name": "FMS_FormOnCast_commonEvent" + }, + { + "name": "FMS_FormTerminate_commonEvent" + }, + { + "name": "FMS_FormOnRequest_commonEvent" + }, + { + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.REQUIRE_FORM" + }, + { + "name": "fms.time_speed" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..d8de28109 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.hostk] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.hostk] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..92ebdbbfb --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,610 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import formHost from '@ohos.application.formHost'; +import commonEvent from '@ohos.commonEvent'; +import systemTime from '@ohos.systemTime'; + +// @ts-nocheck +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = `com.form.formsystemtestservicea.hmservice`; + @State ability: string = `com.form.formsystemtestservicea.hmservice.MainAbility`; + @State moduleName: string = `entry`; + @State name: string = `Form_Js001`; + @State canCreateForm: boolean = false; + @State allowUpdate: boolean = true; + @State isShowing: boolean = true; + @State dimension: FormDimension = FormDimension.Dimension_1_2; + @State temporary: boolean = false; + private requestForm = false; + private requestId = `-1`; + private temporaryId = `-1`; + private deleteForm = false; + private deleteId = `-1`; + private castTempForm = false; + private notifyVisibility = false; + private notifyVisibleForms = false; + private notifyInvisibleForms = false; + private releaseForm = false; + private releaseId = "-1"; + private update = false; + private enableUpdate = false; + private disableUpdate = false; + private isVisible = false; + private castForm = false; + private tempFormId = 0; + private createTempAndNormal = false; + private tempParam = {}; + private createSecondForm = false; + private secondParam = {}; + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"] + }; + private subscriberFormTerminateEvent = { + events: ["FMS_FormTerminate_commonEvent"] + }; + private TAG = `[FormComponent.hostk]`; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formOnRequestEvent = "FMS_FormOnRequest_commonEvent"; + private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; + private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent"; + + private onAcquiredCallback() { + console.info(`${this.TAG} onAcquiredCallback`); + } + + private onRequestCallback() { + console.info(`====>${this.TAG} onRequestCallback====>`); + } + + private onDeletedCallback() { + console.info(`${this.TAG} onDeletedCallback`); + } + + private onReleasedCallback() { + console.info(`====>${this.TAG} onReleasedCallback====>`); + } + + private unsubscribeDeleteCallback() { + console.info(`${this.TAG} unSubscribeDeleteCallback`); + } + + private async aboutToAppear() { + const onDeleteEventSubscriber = await commonEvent.createSubscriber(this.subscriberFormDeleteEvent); + const onTerminateEventSubscriber = await commonEvent.createSubscriber(this.subscriberFormTerminateEvent); + commonEvent.subscribe(onDeleteEventSubscriber, async (err, data) => { + const formIds = data.parameters.formIds; + console.info(`${this.TAG} deleteCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${this.TAG} deleteCallback formIds: ${JSON.stringify(formIds)}`); + + commonEvent.unsubscribe(onDeleteEventSubscriber, () => this.unsubscribeDeleteCallback()); + let deletedFormAmount = 0; + if (formIds.length == 0) { + return; + } + formIds.forEach(async (formId, index) => { + try { + const res = await formHost.deleteForm(formId); + ++deletedFormAmount; + console.info(`${this.TAG} deleteForm${index} result: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${this.TAG} deleteForm${index} error: ${JSON.stringify(error)}`); + } + + if (index >= formIds.length - 1) { + const commonEventPublishData = { + parameters: { + deletedFormAmount: deletedFormAmount, + formIds: [].concat(data.parameters.formIds) + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, () => this.onDeletedCallback()); + console.info(`${this.TAG} deleteCallback end, deletedFormAmount ${deletedFormAmount}`); + } + }); + }); + + featureAbility.getWant() + .then(async (want: any) => { + console.info(`${this.TAG} ===> getWant: ${JSON.stringify(want)}`); + this.formId = want.parameters.formId; + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if (want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if (want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if (want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if (want.parameters.castForm) { + this.castForm = want.parameters.castForm; + } + if (want.parameters.temporaryId) { + this.temporaryId = want.parameters.temporaryId; + } + if (want.parameters.requestForm) { + this.requestForm = want.parameters.requestForm; + } + if (want.parameters.requestId) { + this.requestId = want.parameters.requestId; + } + if (want.parameters.createSecondForm) { + this.createSecondForm = want.parameters.createSecondForm; + this.secondParam = want.parameters.secondParam; + console.info(`====onRequestCallback123====>` + JSON.stringify(want.parameters.secondParam)); + } + if (want.parameters.createTempAndNormal) { + this.createTempAndNormal = want.parameters.createTempAndNormal; + this.tempParam = want.parameters.tempParam; + } + if (want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if (want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + if (want.parameters.castTempForm) { + this.castTempForm = want.parameters.castTempForm; + } + if (want.parameters.notifyVisibility) { + this.notifyVisibility = want.parameters.notifyVisibility; + } + if (want.parameters.notifyVisibleForms) { + this.notifyVisibleForms = want.parameters.notifyVisibleForms; + } + if (want.parameters.notifyInvisibleForms) { + this.notifyInvisibleForms = want.parameters.notifyInvisibleForms; + } + if (want.parameters.releaseForm) { + this.releaseForm = want.parameters.releaseForm; + } + if (want.parameters.releaseId) { + this.releaseId = want.parameters.releaseId; + } + if (want.parameters.update) { + this.update = want.parameters.update; + } + if (want.parameters.enableUpdate) { + this.enableUpdate = want.parameters.enableUpdate; + } + if (want.parameters.disableUpdate) { + this.disableUpdate = want.parameters.disableUpdate; + } + if (want.parameters.subscribeTerminate) { + commonEvent.subscribe(onTerminateEventSubscriber, async (err, data) => { + console.info(`${this.TAG} onTerminateCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + commonEvent.unsubscribe(onTerminateEventSubscriber, () => { }); + console.info(`${this.TAG} onTerminateCallback end`); + setTimeout(async () => { + // terminate self + featureAbility.terminateSelf(); + console.info(`${this.TAG} featureAbility.terminateSelf`); + }, 1000); + }); + } + if (want.parameters.isCreate) { + this.canCreateForm = want.parameters.isCreate; + } + + if (!want.parameters.isCreate && this.deleteForm) { + console.log(`${this.TAG} deleteForm start`); + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info(`${this.TAG} deleteForm result: ${JSON.stringify(data)}`); + let commonEventPublishData = { + data: (data + "") || "0", + parameters: { + "formId": this.deleteId + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.onDeletedCallback); + }) + .catch((error) => { + console.info(`${this.TAG} deleteForm error: ${JSON.stringify(error)}`); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.deleteId + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.onDeletedCallback); + }); + } + + if (!want.parameters.isCreate && this.releaseForm) { + console.log(`${this.TAG} releaseForm start`); + formHost.releaseForm(this.releaseId, true) + .then((data) => { + console.info(`${this.TAG} releaseForm result: ${JSON.stringify(data)}`); + let commonEventPublishData = { + data: (data + "") || "0", + parameters: { + "formId": this.releaseId + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.onReleasedCallback); + }) + .catch((error) => { + console.info(`${this.TAG} releaseForm error: ${JSON.stringify(error)}`); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId": this.releaseId + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.onReleasedCallback); + }); + } + + if (!this.canCreateForm && this.requestForm) { + let commonEventPublishData; + formHost.requestForm(this.requestId) + .then((data) => { + console.info(`${this.TAG} requestForm result: ${JSON.stringify(data)}`); + commonEventPublishData = { + data: (data + "") || "0", + parameters: { + "formId": this.requestId + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.onRequestCallback); + }) + .catch((error) => { + console.info(`${this.TAG} requestForm error: ${JSON.stringify(error)}`); + commonEventPublishData = { + parameters: { + "error": error + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.onRequestCallback); + }); + } + }) + .catch((error: any) => { + console.error(`${this.TAG} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Column() { + Text(`form component test begin`) + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpdate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired(async (form) => { + const createdTime = await systemTime.getCurrentTime(); + this.formId = form.id; + console.info(`${this.TAG} get form, form id: ${form.id}`); + if (this.deleteForm) { + try { + const startTime = await systemTime.getCurrentTime(); + let res = await formHost.deleteForm(this.formId.toString()); + const endTime = await systemTime.getCurrentTime(); + console.info(`${this.TAG} deleteForm result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `deleteForm`, + formId: this.formId, + startTime: startTime, + hostTime: endTime - startTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} deleteForm error: ${JSON.stringify(error)}`); + } + } else if (this.castTempForm) { + try { + const startTime = await systemTime.getCurrentTime(); + let res = await formHost.castTempForm(this.formId.toString()); + const endTime = await systemTime.getCurrentTime(); + console.info(`${this.TAG} castTempForm result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `castTempForm`, + formId: this.formId, + startTime: startTime, + hostTime: endTime - startTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} castTempForm error: ${JSON.stringify(error)}`); + } + } else if (this.notifyVisibility) { + try { + let res = await formHost.notifyVisibleForms([this.formId.toString()]); + console.info(`${this.TAG} notifyVisibleForms result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `notifyVisibleForms`, + formId: this.formId, + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} notifyVisibleForms error: ${JSON.stringify(error)}`); + } + try { + let res = await formHost.notifyInvisibleForms([this.formId.toString()]); + console.info(`${this.TAG} notifyInvisibleForms result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `notifyInvisibleForms`, + formId: this.formId, + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} notifyInvisibleForms error: ${JSON.stringify(error)}`); + } + } else if (this.notifyVisibleForms) { + try { + const startTime = await systemTime.getCurrentTime(); + let res = await formHost.notifyVisibleForms([this.formId.toString()]); + const endTime = await systemTime.getCurrentTime(); + console.info(`${this.TAG} notifyVisibleForms result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `notifyVisibleForms`, + formId: this.formId, + startTime: startTime, + hostTime: endTime - startTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} notifyVisibleForms error: ${JSON.stringify(error)}`); + } + } else if (this.notifyInvisibleForms) { + try { + const startTime = await systemTime.getCurrentTime(); + let res = await formHost.notifyInvisibleForms([this.formId.toString()]); + const endTime = await systemTime.getCurrentTime(); + console.info(`${this.TAG} notifyInvisibleForms result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `notifyInvisibleForms`, + formId: this.formId, + startTime: startTime, + hostTime: endTime - startTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} notifyInvisibleForms error: ${JSON.stringify(error)}`); + } + } else if (this.requestForm) { + try { + const startTime = await systemTime.getCurrentTime(); + let res = await formHost.requestForm(this.formId.toString()); + const endTime = await systemTime.getCurrentTime(); + console.info(`${this.TAG} requestForm result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `request`, + formId: this.formId, + startTime: startTime, + hostTime: endTime - startTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} requestForm error: ${JSON.stringify(error)}`); + } + } else if (this.releaseForm) { + try { + const startTime = await systemTime.getCurrentTime(); + let res = await formHost.releaseForm(this.formId.toString()); + const endTime = await systemTime.getCurrentTime(); + console.info(`${this.TAG} releaseForm result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `release`, + formId: this.formId, + hostTime: endTime - startTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} releaseForm error: ${JSON.stringify(error)}`); + } + } else if (this.update) { + try { + let res = await formHost.enableFormsUpdate([this.formId.toString()]); + console.info(`${this.TAG} enableUpdate result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `enableUpdate`, + formId: this.formId, + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} enableUpdate error: ${JSON.stringify(error)}`); + } + try { + let res = await formHost.disableFormsUpdate([this.formId.toString()]); + console.info(`${this.TAG} disableUpdate result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `disableUpdate`, + formId: this.formId, + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} disableUpdate error: ${JSON.stringify(error)}`); + } + } else if (this.enableUpdate) { + try { + const startTime = await systemTime.getCurrentTime(); + let res = await formHost.enableFormsUpdate([this.formId.toString()]); + const endTime = await systemTime.getCurrentTime(); + console.info(`${this.TAG} enableUpdate result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `enableUpdate`, + formId: this.formId, + hostTime: endTime - startTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} enableUpdate error: ${JSON.stringify(error)}`); + } + } else if (this.disableUpdate) { + try { + const startTime = await systemTime.getCurrentTime(); + const res = await formHost.disableFormsUpdate([this.formId.toString()]); + const endTime = await systemTime.getCurrentTime(); + console.info(`${this.TAG} disableUpdate result: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: (res + "") || "0", + parameters: { + kind: `disableUpdate`, + formId: this.formId, + hostTime: endTime - startTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } catch (error) { + console.info(`${this.TAG} disableUpdate error: ${JSON.stringify(error)}`); + } + } else { + const commonEventPublishData = { + data: this.formId.toString(), + parameters: { + formId: this.formId.toString(), + time: createdTime + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + } + }) + .onUninstall((info) => { + console.info(`${this.TAG} onUninstall: ${JSON.stringify(info)}`); + const commonEventPublishData = { + parameters: { + formId: info.id.toString(), + kind: "onUninstall" + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + }) + .onError((error) => { + console.error(`${this.TAG} onError: ${JSON.stringify(error)}`); + }) + } + if (this.createSecondForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpdate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(`${this.TAG} secondForm onAcquired, form id: ${form.id}`); + this.formId = form.id; + const commonEventPublishData = { + data: this.formId.toString(), + parameters: { + "formId": this.formId.toString() + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + }) + .onUninstall((info) => { + console.info(`${this.TAG} onUninstall: ${JSON.stringify(info)}`); + }) + .onError((error) => { + console.error(`${this.TAG} onError: ${JSON.stringify(error)}`); + }); + } + if (this.createTempAndNormal) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpdate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(`${this.TAG} castForm onAcquired, form id: ${form.id}`); + this.formId = form.id; + const commonEventPublishData = { + data: this.formId.toString(), + parameters: { + "formId": this.formId.toString(), + "cast": true, + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, () => this.onAcquiredCallback()); + }) + .onUninstall((info) => { + console.info(`${this.TAG} onUninstall: ${JSON.stringify(info)}`); + }) + .onError((error) => { + console.error(`${this.TAG} onError: ${JSON.stringify(error)}`); + }); + } + } + .backgroundColor(Color.White) + + Text(`form component test end`); + } + .backgroundColor(Color.White) + } +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..48f8c7d1f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostK" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostk/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/BUILD.gn new file mode 100644 index 000000000..4ffe8d9e8 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostL") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostL" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json new file mode 100644 index 000000000..d184b9ec9 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json @@ -0,0 +1,118 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhostl", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhostl", + "name": ".FormStHostAppL", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnRequest_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use FMS_FormDelete_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "FMS_FormOnRequest_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.REQUIRE_FORM" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..450e90173 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.hostl] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.hostl] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..3ffec1f61 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from '@ohos.ability.featureAbility'; +import formHost from '@ohos.application.formHost'; + +// @ts-nocheck +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = `com.form.formsystemtestservicea.hmservice`; + @State ability: string = `com.form.formsystemtestservicea.hmservice.MainAbility`; + @State moduleName: string = `entry`; + @State name: string = `Form_Js001`; + @State canCreateForm: boolean = false; + @State allowUpdate: boolean = true; + @State isShowing: boolean = true; + @State dimension: FormDimension = FormDimension.Dimension_1_2; + @State temporary: boolean = false; + private requestForm = false; + private requestId = `-1`; + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"] + }; + private TAG = `[FormComponent.hostl]`; + private formOnAcquiredEvent = `FMS_FormOnAcquired_commonEvent`; + private formOnRequestEvent = `FMS_FormOnRequest_commonEvent`; + private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; + + private onAcquiredCallback() { + console.info(`====>${this.TAG} onAcquiredCallback====>`); + } + + private onRequestCallback() { + console.info(`====>${this.TAG} onRequestCallback====>`); + } + + private unsubscribeDeleteCallback() { + console.info(`${this.TAG} unSubscribeDeleteCallback====>`); + } + + private async aboutToAppear() { + const onDeleteEventSubscriber = await commonEvent.createSubscriber(this.subscriberFormDeleteEvent); + commonEvent.subscribe(onDeleteEventSubscriber, async (err, data) => { + console.info(`${this.TAG} deleteCallBack start:====> ${JSON.stringify(data)}`); + + data.parameters.formIds.forEach(async (formId) => { + await formHost.deleteForm(formId) + .then((res) => { + console.info(`${this.TAG} deleteForm result: ${JSON.stringify(res)}`); + }); + }); + + commonEvent.unsubscribe(onDeleteEventSubscriber, () => this.unsubscribeDeleteCallback()); + console.info(`${this.TAG} deleteCallBack end ====>`); + }); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.TAG} getWant: ${JSON.stringify(want)}`); + this.formId = want.parameters.formId; + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if (want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if (want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if (want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if (want.parameters.requestForm) { + this.requestForm = want.parameters.requestForm; + } + if (want.parameters.requestId) { + this.requestId = want.parameters.requestId; + } + if (want.parameters.isCreate) { + this.canCreateForm = want.parameters.isCreate; + } + + if (!this.canCreateForm && this.requestForm) { + let commonEventPublishData; + formHost.requestForm(this.requestId) + .then((data) => { + console.info(`${this.TAG} requestForm result: ${JSON.stringify(data)}`); + commonEventPublishData = { + data: data + "", + parameters: { + "formId": this.requestId + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.onRequestCallback); + }) + .catch((error) => { + console.info(`${this.TAG} requestForm error: ${JSON.stringify(error)}`); + commonEventPublishData = { + parameters: { + "error": error + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.onRequestCallback); + }); + } + }) + .catch((error: any) => { + console.error(`${this.TAG} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Column() { + Text(`form component test begin`); + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpdate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(`${this.TAG} onAcquired, form id: ${form.id}`); + this.formId = form.id; + const commonEventPublishData = { + data: this.formId.toString() + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.onAcquiredCallback); + }) + .onUninstall((info) => { + console.info(`${this.TAG} onUninstall: ${JSON.stringify(info)}`); + }) + .onError((error) => { + console.error(`${this.TAG} onError: ${JSON.stringify(error)}`); + }); + } + } + .backgroundColor(Color.White) + + Text(`form component test end`); + } + .backgroundColor(Color.White) + } +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..6b30c6c55 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostL" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostl/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/BUILD.gn new file mode 100644 index 000000000..709984dca --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostN") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostN" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json new file mode 100644 index 000000000..6dca4226c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json @@ -0,0 +1,124 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhostn", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhostn", + "name": ".FormStHostAppN", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormCast_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_SendCastForm_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent" + }, + { + "name": "FMS_FormCast_commonEvent" + }, + { + "name": "FMS_SendCastForm_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.REQUIRE_FORM" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..e88deae73 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.host] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.host] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..3b7da67ab --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,455 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from "@ohos.ability.featureAbility"; +import formHost from '@ohos.application.formHost'; + +@Entry +@Component +struct Index { + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State optType: number = 0; + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private normal = 0; + private temporary = 0; + private normaldel = 0; + private temporarydel = 0; + private normalFormIds = []; + private tempFormIds = []; + + private deleteIds = []; + private delCount = 0; + + private normalFormCounts = []; + private tempFormCounts = []; + + private castFormId = "-1"; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formCastEvent = "FMS_FormCast_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private subscriberSendCastForm; + private subscriberSendCastFormEvent = { + events: ["FMS_SendCastForm_commonEvent"], + }; + + private publishOnErrorCallBack() { + console.debug("====> [FormComponent] formsystemhostn formOnErrorEvent Publish CallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====> [FormComponent] formsystemhostn formOnAcquiredEvent Publish CallBack ====>"); + } + private publishDeleteCallBack() { + console.debug("====> [FormComponent] formsystemhostn publishDeleteCallBack Publish CallBack ====>"); + } + private publishCastCallBack() { + console.debug("====>formCastEvent Publish CallBack ====>"); + } + private startAbility(bundleName, abilityName, sendMsg) { + featureAbility.startAbility({ + want: { + bundleName: bundleName, + abilityName: abilityName, + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName": "entry", + "temporary": false, + "sendCastForm": true, + "sendCastFormMsg": sendMsg, + "isCreate": false + } + } + }).then((res: any) => { + console.info(`[FormComponent] formsystemhostn featureAbility.startAbility res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`[FormComponent] formsystemhostn featureAbility.startAbility error: ${JSON.stringify(err)}`); + }); + } + + private publishOnSendCastForm(err, data) { + console.info("!!!====>[FormComponent] formsystemhostn OnSendCastForm start:====>" + JSON.stringify(data)); + if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhostn") { + return; + } + let formId = data.parameters.castFormId; + setTimeout(function () { + console.info("[FormComponent.host] castTempForm start, formId: " + formId); + formHost.castTempForm(formId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", data); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); + this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", error.code.toString()); + }); + console.info("[FormComponent.host] castTempForm end"); + }, 5000); + console.info("!!!====>[FormComponent] formsystemhostn OnSendCastForm end"); + } + + private deleteCallBack(err, data) { + console.info("!!!====>[FormComponent] formsystemhostn deleteCallBack start:====>" + JSON.stringify(data)); + const delFormIds = data.parameters.formIds; + console.info(`[FormComponent] data size ${delFormIds.length}`); + + console.info(`[FormComponent] data.subscriber ${JSON.stringify(this.subscriberDel)}`); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); + }); + console.info(`[FormComponent] data.bundleName ${JSON.stringify(data.bundleName)}`); + console.info(`[FormComponent] tof ${"com.ohos.st.formsystemhostn" != data.bundleName}`); + if ("com.ohos.st.formsystemhostn" != data.bundleName) { + return; + } + delFormIds.forEach(async (formId, index) => { + console.info(`[FormComponent] formsystemhostn deleteForm ${index}`); + try { + const res = await formHost.deleteForm(formId); + console.info(`[FormComponent] formsystemhostn deleteForm ${index} ${formId} result: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`[FormComponent] formsystemhostn deleteForm ${index} ${formId} error: ${JSON.stringify(error)}`); + } + }); + console.info("!!!====> [FormComponent] formsystemhostn optType deleteCallBack end ====>"); + } + + private unSubscribeDeleteCallback() { + console.debug("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); + } + + private unSubscribeCastFormCallback() { + console.debug("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>[FormComponent] formsystemhostn Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + commonEvent.subscribe(this.subscriberDel, (err, data) => { + if ("com.ohos.st.formsystemhostn" != data.bundleName) { + return; + } else { + console.info("!!!====>[FormComponent.hostn] formsystemhostn deleteCallBack start:====>" + JSON.stringify(data)); + const delFormIds = data.parameters.formIds; + console.info(`[FormComponent] data size ${delFormIds.length}`); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); + }); + let delCounter = 0; + delFormIds.forEach((formId) => { + formHost.deleteForm(formId, (error, data) => { + console.info(`[FormComponent] formsystemhostn deleteForm ${++delCounter} ${formId} data: ${JSON.stringify(data)} err: ${JSON.stringify(error)}`); + }); + }); + } + }); + }); + + commonEvent.createSubscriber(this.subscriberSendCastFormEvent).then(async (data) => { + console.info("====>[FormComponent] formsystemhostn Subscriber SendCastForm data:====>", JSON.stringify(data)); + this.subscriberSendCastForm = data; + await commonEvent.subscribe(this.subscriberSendCastForm, this.publishOnSendCastForm); + }); + + featureAbility.getWant() + .then(async (want: any) => { + console.info(" [FormComponent] formsystemhostn getWant:" + JSON.stringify(want)); + + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if (want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + + if (want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + + if (want.parameters.normal) { + this.normal = want.parameters.normal; + } + + if (want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if (want.parameters.normaldel) { + this.normaldel = want.parameters.normaldel; + } + + if (want.parameters.temporarydel) { + this.temporarydel = want.parameters.temporarydel; + } + + if (want.parameters.deleteIds) { + this.deleteIds = want.parameters.deleteIds; + } + if (want.parameters.castFormId) { + this.castFormId = want.parameters.castFormId; + } + + if (want.parameters.releaseFormId) { + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); + }); + + const formId = want.parameters.releaseFormId; + const isReleaseCache = want.parameters.isReleaseCache; + const res = await formHost.releaseForm(formId, isReleaseCache); + console.info(`[FormComponent] releaseForm res: ${JSON.stringify(res)}`); + const commonEventPublishData = { + data: `releaseForm`, + bundleName: `com.ohos.st.formsystemhostn`, + parameters: { + formIds: [].concat(formId) + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + + this.normal = 1; + } + + this.makeCount(); + + setTimeout(() => { + this.optType = want.parameters.optType; + console.info(' [FormComponent] formsystemhostn getWant optType:' + this.optType); + }, 10); + + if (this.castFormId != "-1" && want.parameters.optType == 3) { + console.info("[FormComponent.host] castTempForm start"); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhostn optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhostn optType unSubscribeCastFormCallback CallBack====>"); + }); + + formHost.castTempForm(this.castFormId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + let commonEventPublishData = { + data: (data + "") || `0`, + bundleName: "com.ohos.st.formsystemhostn", + parameters: { + formId: this.castFormId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + error.code); + let commonEventPublishData = { + data: error.code.toString(), + errMsg: error.msg, + bundleName: "com.ohos.st.formsystemhostn", + parameters: { + formId: this.castFormId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }); + console.info("[FormComponent.host] castTempForm end"); + } + + if (want.parameters.optType == 2 && this.deleteIds.length > 0) { + for (let iIndex = 0; iIndex < this.deleteIds.length; ++iIndex) { + console.info("[FormComponent] formsystemhostn deleteForm start"); + formHost.deleteForm(this.deleteIds[iIndex]) + .then((data) => { + console.info('[FormComponent] formsystemhostn deleteForm result:' + data); + this.delCount++; + + if (this.delCount == this.deleteIds.length) { + let commonEventPublishData = { + data: data + "", + bundleName: "com.ohos.st.formsystemhostn", + parameters: { + "formIds": this.deleteIds + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishDeleteCallBack); + } + }) + .catch((error) => { + console.info(' [FormComponent] formsystemhostn deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + bundleName: "com.ohos.st.formsystemhostn", + parameters: { + "formIds": [this.deleteIds[iIndex]] + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + console.info("[FormComponent] formsystemhostn deleteForm end"); + } + } + }) + .catch((error: any) => { + console.error(' [FormComponent] formsystemhostn Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.info(`[FormComponent.host] aboutToAppear end`); + } + + private makeCount() { + console.info(' [FormComponent] formsystemhostn makeCount start.'); + for (let nNormal = 0; nNormal < this.normal; nNormal++) { + this.normalFormCounts.push(nNormal); + } + console.info(' [FormComponent] formsystemhostn this.normalFormCounts.length:' + this.normalFormCounts.length); + + for (let nTemp = 0; nTemp < this.temporary; nTemp++) { + this.tempFormCounts.push(nTemp); + } + console.info(' [FormComponent] formsystemhostn this.tempFormCounts.length:' + this.tempFormCounts.length); + } + + build() { + Scroll(new Scroller()) { + Column() { + if (this.optType == 1) { + Text(' [FormComponent] formsystemhostn normal form component test begin') + Grid() { + ForEach(this.normalFormCounts, (item) => { + GridItem() { + FormComponent({ + id: 0, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: false + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(" [FormComponent] formsystemhostn get normal form, form id:" + form.id); + + this.normalFormIds.push(form.id.toString()); + if (this.normalFormIds.length == this.normal - this.normaldel) { + let commonEventPublishData = { + data: "normalForm", + bundleName: "com.ohos.st.formsystemhostn", + parameters: { + "formIds": this.normalFormIds + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onError((error) => { + console.info(" [FormComponent] formsystemhostn normal form error code:" + error.errcode); + console.info(" [FormComponent] formsystemhostn normal form error msg:" + error.msg); + let commonEventPublishData = { + data: error.msg, + bundleName: "com.ohos.st.formsystemhostn" + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .size({ width: 40, height: 40 }) + } + }, (item) => JSON.stringify(item)) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') + .columnsGap(2) + .rowsGap(2) + .width('100%') + Text(' [FormComponent] formsystemhostn normal form component test end') + + Text(' [FormComponent] formsystemhostn temp form component test start') + Grid() { + ForEach(this.tempFormCounts, (item) => { + GridItem() { + FormComponent({ + id: 0, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: true + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(" [FormComponent] formsystemhostn get temp form, form id:" + form.id); + this.tempFormIds.push(form.id.toString()); + if (this.tempFormIds.length == this.temporary - this.temporarydel) { + let commonEventPublishData = { + data: "tempForm", + bundleName: "com.ohos.st.formsystemhostn", + parameters: { + "formIds": this.tempFormIds + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onError((error) => { + console.info(" [FormComponent] formsystemhostn temp form error code:" + error.errcode); + console.info(" [FormComponent] formsystemhostn temp form error msg:" + error.msg); + let commonEventPublishData = { + data: error.msg, + bundleName: "com.ohos.st.formsystemhostn" + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .size({ width: 40, height: 40 }) + } + }, (item) => JSON.stringify(item)) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') + .columnsGap(2) + .rowsGap(2) + .width('100%') + + Text(' [FormComponent] formsystemhostn temp form component test end') + } + } + .backgroundColor(Color.White) + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..4bdc0caf6 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostN" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostn/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/BUILD.gn new file mode 100644 index 000000000..723d88850 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostNoPerm") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostNoPerm" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json new file mode 100644 index 000000000..3e8c6d744 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json @@ -0,0 +1,137 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhostnoperm", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhostnoperm", + "name": ".FormStHostAppNoPerm", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnRequest_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnState_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "name": "FMS_FormOnRequest_commonEvent" + }, + { + "name": "FMS_FormOnState_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..e88deae73 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.host] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.host] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..82197c8dc --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,333 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import commonEvent from '@ohos.commonEvent'; +import featureAbility from "@ohos.ability.featureAbility"; +import formHost from '@ohos.application.formHost'; + +@Entry +@Component +struct Index { + @State formId: number = 0; + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State canCreateForm: boolean = false; + + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private stateForm = "visible"; + private stateIds = []; + private requestForm = false; + private requestId = "-1"; + private releaseForm = false; + private releaseId = "-1"; + private deleteForm = false; + private deleteId = "-1"; + private temporary = false; + private castForm = false; + + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent"; + private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent"; + private formOnRequestEvent = "FMS_FormOnRequest_commonEvent"; + private formOnStateEvent = "FMS_FormOnState_commonEvent"; + + private publishCallBack() { + console.debug("====>formOnErrorEvent Publish CallBack ====>"); + } + + private aboutToAppear() { + console.error('[FormComponent] getWant'); + featureAbility.getWant() + .then((want: any) => { + this.formId = parseInt(want.parameters.formId); + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if(want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + if(want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if(want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + if(want.parameters.castForm) { + this.castForm = want.parameters.castForm; + } + if(want.parameters.deleteForm) { + this.deleteForm = want.parameters.deleteForm; + } + if(want.parameters.deleteId) { + this.deleteId = want.parameters.deleteId; + } + if(want.parameters.releaseForm) { + this.releaseForm = want.parameters.releaseForm; + } + if(want.parameters.releaseId) { + this.releaseId = want.parameters.releaseId; + } + if(want.parameters.requestForm) { + this.requestForm = want.parameters.requestForm; + } + if(want.parameters.requestId) { + this.requestId = want.parameters.requestId; + } + if(want.parameters.stateForm) { + this.stateForm = want.parameters.stateForm; + } + if(want.parameters.stateIds) { + this.stateIds = want.parameters.stateIds; + } + + setTimeout(() => { + this.canCreateForm = want.parameters.isCreate ? true : false; + console.error('[FormComponent] getWant canCreateForm:'+ this.canCreateForm); + }, 10); + console.error('[FormComponent] getWant end'+ JSON.stringify(want)); + + if(!want.parameters.isCreate && this.deleteForm) { + console.log("formsystemhostnoperm deleteForm start"); + formHost.deleteForm(this.deleteId) + .then((data) => { + console.info('formsystemhostnoperm deleteForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishCallBack); + }) + .catch((error) => { + console.info('formsystemhostnoperm deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.deleteId.toString() + } + }; + commonEvent.publish(this.formOnDeletedEvent, commonEventPublishData, this.publishCallBack); + }); + + console.log("formsystemhostnoperm deleteForm end"); + } + + if(!want.parameters.isCreate && this.releaseForm) { + console.log("formsystemhost releaseForm start"); + formHost.releaseForm(this.releaseId) + .then((data) => { + console.info('formsystemhost releaseForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.requestId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, () => this.publishCallBack()); + }) + .catch((error) => { + console.info('formsystemhost releaseForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.releaseId.toString() + } + }; + commonEvent.publish(this.formOnReleasedEvent, commonEventPublishData, this.publishCallBack); + }); + + console.log("formsystemhost releaseForm end"); + } + + if(!want.parameters.isCreate && this.requestForm) { + console.log("[FormComponent.host] requestForm start"); + formHost.requestForm(this.requestId) + .then((data) => { + console.info('[FormComponent] requestForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.requestId + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, () => this.publishCallBack()); + }) + .catch((error) => { + console.info('[FormComponent] requestForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.requestId + } + }; + commonEvent.publish(this.formOnRequestEvent, commonEventPublishData, this.publishCallBack); + }); + + console.log("[FormComponent.host] requestForm end"); + } + if(!want.parameters.isCreate && this.stateForm) { + if(this.stateForm == "visible") { + console.log("formsystemhost notifyVisibleForm start"); + formHost.notifyVisibleForms(this.stateIds) + .then((data) => { + console.info('formsystemhost notifyVisibleForm result:' + data); + let retData = "0"; + if((data + "") != "0") { + retData = data + ""; + } + let commonEventPublishData = { + data: retData, + parameters: { + "formId" : this.stateIds.toString() + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); + }) + .catch((error) => { + console.info('formsystemhost notifyVisibleForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.stateIds.toString() + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); + }); + console.log("formsystemhost notifyVisibleForm end"); + } else if(this.stateForm == "invisible") { + console.log("formsystemhost notifyInvisibleForm start"); + formHost.notifyInvisibleForms(this.stateIds) + .then((data) => { + console.info('formsystemhost notifyInvisibleForm result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.stateIds.toString() + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, () => this.publishCallBack()); + }) + .catch((error) => { + console.info('formsystemhost notifyInvisibleForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.stateIds.toString() + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); + }); + console.log("formsystemhost notifyInvisibleForm end"); + } else if(this.stateForm == "enable") { + console.log("formsystemhost enableFormsUpdate start"); + formHost.enableFormsUpdate(this.stateIds) + .then((data) => { + console.info('formsystemhost enableFormsUpdate result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.stateIds.toString() + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, () => this.publishCallBack()); + }) + .catch((error) => { + console.info('formsystemhost enableFormsUpdate error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.stateIds.toString() + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); + }); + console.log("formsystemhost enableFormsUpdate end"); + } else { + console.log("formsystemhost disableFormsUpdate start"); + formHost.disableFormsUpdate(this.stateIds) + .then((data) => { + console.info('formsystemhost disableFormsUpdate result:' + data); + let commonEventPublishData = { + data: data + "", + parameters: { + "formId" : this.stateIds.toString() + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, () => this.publishCallBack()); + }) + .catch((error) => { + console.info('formsystemhost disableFormsUpdate error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + parameters: { + "formId" : this.stateIds.toString() + } + }; + commonEvent.publish(this.formOnStateEvent, commonEventPublishData, this.publishCallBack); + }); + console.log("formsystemhost disableFormsUpdate end"); + } + } + + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + + console.log(`[FormComponent.host] aboutToAppear end`); + } + + build() { + Column() { + Text('form component test begin') + Column() { + if (this.canCreateForm) { + FormComponent({ + id: this.formId, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: this.temporary, + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + this.formId = form.id; + console.log("[FormComponent.host] get form, form id:" + form.id); + }) + .onError((error) => { + console.log("[FormComponent.host] error code:" + error.errcode); + console.log("[FormComponent.host] error msg:" + error.msg); + let commonEventPublishData = { + data: error.msg + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishCallBack); + }) + } + } + .backgroundColor(Color.White) + Text('form component test end') + } + .backgroundColor(Color.White) + } +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..ed4eff045 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostNoPerm" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostnoperm/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/BUILD.gn new file mode 100644 index 000000000..c64ff4a56 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostO") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostO" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json new file mode 100644 index 000000000..6e442bee3 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json @@ -0,0 +1,124 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhosto", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhosto", + "name": ".FormStHostAppO", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormCast_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_SendCastForm_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent" + }, + { + "name": "FMS_FormCast_commonEvent" + }, + { + "name": "FMS_SendCastForm_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.REQUIRE_FORM" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..e88deae73 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.host] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.host] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..760a86f18 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,432 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import formManager from '@ohos.application.formHost'; +import commonEvent from '@ohos.commonEvent'; + +@Entry +@Component +struct Index { + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.FormAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State optType: number = 0; + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private normal = 0; + private temporary = 0; + private normaldel = 0; + private temporarydel = 0; + private normalFormIds = []; + private tempFormIds = []; + + private deleteIds = []; + private delCount = 0; + + private normalFormCounts = []; + private tempFormCounts = []; + + private castFormId = "-1"; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formCastEvent = "FMS_FormCast_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private subscriberSendCastForm; + private subscriberSendCastFormEvent = { + events: ["FMS_SendCastForm_commonEvent"], + }; + + private publishOnErrorCallBack() { + console.debug("====> [FormComponent] formsystemhosto formOnErrorEvent Publish CallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====> [FormComponent] formsystemhosto formOnAcquiredEvent Publish CallBack ====>"); + } + private publishDeleteCallBack() { + console.debug("====> [FormComponent] formsystemhosto publishDeleteCallBack Publish CallBack ====>"); + } + private publishCastCallBack() { + console.debug("====>formCastEvent Publish CallBack ====>"); + } + private startAbility(bundleName, abilityName, sendMsg) { + featureAbility.startAbility({ + want: { + bundleName: bundleName, + abilityName: abilityName, + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "sendCastForm": true, + "sendCastFormMsg": sendMsg, + "isCreate": false + } + } + }).then((res: any) => { + console.info(`[FormComponent] formsystemhosto featureAbility.startAbility res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`[FormComponent] formsystemhosto featureAbility.startAbility error: ${JSON.stringify(err)}`); + }); + } + private publishOnSendCastForm(err, data) { + console.info("!!!====>[FormComponent] formsystemhosto OnSendCastForm start:====>" + JSON.stringify(data)); + if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhosto") { + return; + } + let formId = data.parameters.castFormId; + setTimeout(function () { + console.info("[FormComponent.host] castTempForm start, formId: " + formId); + formManager.castTempForm(formId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", data); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); + this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", error.code.toString()); + }); + console.info("[FormComponent.host] castTempForm end"); + }, 5000); + console.info("!!!====>[FormComponent] formsystemhosto OnSendCastForm end"); + } + + private deleteCallBack(err, data) { + console.info("!!!====>[FormComponent] formsystemhosto deleteCallBack start:====>" + JSON.stringify(data)); + const delFormIds = data.parameters.formIds; + console.info(`[FormComponent] data size ${delFormIds.length}`); + + console.info(`[FormComponent] data.subscriber ${JSON.stringify(this.subscriberDel)}`); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhosto optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhosto optType unSubscribeCastFormCallback CallBack====>"); + }); + console.info(`[FormComponent] data.bundleName ${JSON.stringify(data.bundleName)}`); + console.info(`[FormComponent] tof ${"com.ohos.st.formsystemhosto" != data.bundleName}`); + if ("com.ohos.st.formsystemhosto" != data.bundleName) { + return; + } + delFormIds.forEach(async (formId, index) => { + console.info(`[FormComponent] formsystemhosto deleteForm ${index}`); + try { + const res = await formManager.deleteForm(formId); + console.info(`[FormComponent] formsystemhosto deleteForm ${index} ${formId} result: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`[FormComponent] formsystemhosto deleteForm ${index} ${formId} error: ${JSON.stringify(error)}`); + } + }); + console.info("!!!====> [FormComponent] formsystemhosto optType deleteCallBack end ====>"); + } + + private unSubscribeDeleteCallback() { + console.debug("====> [FormComponent] formsystemhosto optType unSubscribeDeleteCallback CallBack====>"); + } + + private unSubscribeCastFormCallback() { + console.debug("====> [FormComponent] formsystemhosto optType unSubscribeCastFormCallback CallBack====>"); + } + + private aboutToAppear() { + const TAG = "[FormComponent.hosto]"; + + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>[FormComponent] formsystemhosto Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + commonEvent.subscribe(this.subscriberDel, (err, data) => { + if ("com.ohos.st.formsystemhosto" != data.bundleName) { + return; + } else { + console.info("!!!====>[FormComponent.hosto] formsystemhosto deleteCallBack start:====>" + JSON.stringify(data)); + const delFormIds = data.parameters.formIds; + console.info(`[FormComponent] data size ${delFormIds.length}`); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhosto optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhosto optType unSubscribeCastFormCallback CallBack====>"); + }); + let delCounter = 0; + delFormIds.forEach((formId) => { + formManager.deleteForm(formId, (error, data) => { + console.info(`[FormComponent] formsystemhosto deleteForm ${++delCounter} ${formId} data: ${JSON.stringify(data)} err: ${JSON.stringify(error)}`); + }); + }); + } + }); + }); + + commonEvent.createSubscriber(this.subscriberSendCastFormEvent).then(async (data) => { + console.info("====>[FormComponent] formsystemhosto Subscriber SendCastForm data:====>", JSON.stringify(data)); + this.subscriberSendCastForm = data; + await commonEvent.subscribe(this.subscriberSendCastForm, this.publishOnSendCastForm); + }); + + featureAbility.getWant() + .then((want: any) => { + console.info(" [FormComponent] formsystemhosto getWant:" + JSON.stringify(want)); + + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if (want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + + if (want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + + if (want.parameters.normal) { + this.normal = want.parameters.normal; + } + + if (want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if (want.parameters.normaldel) { + this.normaldel = want.parameters.normaldel; + } + + if (want.parameters.temporarydel) { + this.temporarydel = want.parameters.temporarydel; + } + + if (want.parameters.deleteIds) { + this.deleteIds = want.parameters.deleteIds; + } + if (want.parameters.castFormId) { + this.castFormId = want.parameters.castFormId; + } + + this.makeCount(); + + setTimeout(() => { + this.optType = want.parameters.optType; + console.info(' [FormComponent] formsystemhosto getWant optType:' + this.optType); + }, 10); + + if (this.castFormId != "-1" && want.parameters.optType == 3) { + console.info("[FormComponent.host] castTempForm start"); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhosto optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhosto optType unSubscribeCastFormCallback CallBack====>"); + }); + + formManager.castTempForm(this.castFormId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + let commonEventPublishData = { + data: (data + "") || `0`, + bundleName: "com.ohos.st.formsystemhosto", + parameters: { + formId: this.castFormId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); + let commonEventPublishData = { + data: error.code.toString(), + bundleName: "com.ohos.st.formsystemhosto", + parameters: { + errMsg: error.message, + formId: this.castFormId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }); + console.info("[FormComponent.host] castTempForm end"); + } + + if (want.parameters.optType == 2 && this.deleteIds.length > 0) { + for (let iIndex = 0; iIndex < this.deleteIds.length; ++iIndex) { + console.info("[FormComponent] formsystemhosto deleteForm start"); + formManager.deleteForm(this.deleteIds[iIndex]) + .then((data) => { + console.info('[FormComponent] formsystemhosto deleteForm result:' + data); + this.delCount++; + + if (this.delCount == this.deleteIds.length) { + let commonEventPublishData = { + data: data + "", + bundleName: "com.ohos.st.formsystemhosto", + parameters: { + "formIds": this.deleteIds + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishDeleteCallBack); + } + }) + .catch((error) => { + console.info(' [FormComponent] formsystemhosto deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + bundleName: "com.ohos.st.formsystemhosto", + parameters: { + "formIds": [this.deleteIds[iIndex]] + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + console.info("[FormComponent] formsystemhosto deleteForm end"); + } + } + }) + .catch((error: any) => { + console.error(' [FormComponent] formsystemhosto Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.info(`[FormComponent.host] aboutToAppear end`); + } + + private makeCount() { + console.info(' [FormComponent] formsystemhosto makeCount start.'); + for (let nNormal = 0; nNormal < this.normal; nNormal++) { + this.normalFormCounts.push(nNormal); + } + console.info(' [FormComponent] formsystemhosto this.normalFormCounts.length:' + this.normalFormCounts.length); + + for (let nTemp = 0; nTemp < this.temporary; nTemp++) { + this.tempFormCounts.push(nTemp); + } + console.info(' [FormComponent] formsystemhosto this.tempFormCounts.length:' + this.tempFormCounts.length); + } + + build() { + Scroll(new Scroller()) { + Column() { + if (this.optType == 1) { + Text(' [FormComponent] formsystemhosto normal form component test begin') + Grid() { + ForEach(this.normalFormCounts, (item) => { + GridItem() { + FormComponent({ + id: 0, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: false + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(" [FormComponent] formsystemhosto get normal form, form id:" + form.id); + + this.normalFormIds.push(form.id.toString()); + if (this.normalFormIds.length == this.normal - this.normaldel) { + let commonEventPublishData = { + data: "normalForm", + bundleName: "com.ohos.st.formsystemhosto", + parameters: { + "formIds": this.normalFormIds + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onError((error) => { + console.info(" [FormComponent] formsystemhosto normal form error code:" + error.errcode); + console.info(" [FormComponent] formsystemhosto normal form error msg:" + error.msg); + let commonEventPublishData = { + data: error.msg, + bundleName: "com.ohos.st.formsystemhosto" + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .size({ width: 40, height: 40 }) + } + }, (item) => JSON.stringify(item)) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') + .columnsGap(2) + .rowsGap(2) + .width('100%') + Text(' [FormComponent] formsystemhosto normal form component test end') + + Text(' [FormComponent] formsystemhosto temp form component test start') + Grid() { + ForEach(this.tempFormCounts, (item) => { + GridItem() { + FormComponent({ + id: 0, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: true + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(" [FormComponent] formsystemhosto get temp form, form id:" + form.id); + this.tempFormIds.push(form.id.toString()); + if (this.tempFormIds.length == this.temporary - this.temporarydel) { + let commonEventPublishData = { + data: "tempForm", + bundleName: "com.ohos.st.formsystemhosto", + parameters: { + "formIds": this.tempFormIds + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onError((error) => { + console.info(" [FormComponent] formsystemhosto temp form error code:" + error.errcode); + console.info(" [FormComponent] formsystemhosto temp form error msg:" + error.msg); + let commonEventPublishData = { + data: error.msg, + bundleName: "com.ohos.st.formsystemhosto" + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .size({ width: 40, height: 40 }) + } + }, (item) => JSON.stringify(item)) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') + .columnsGap(2) + .rowsGap(2) + .width('100%') + + Text(' [FormComponent] formsystemhosto temp form component test end') + } + } + .backgroundColor(Color.White) + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..7a3cce586 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostO" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhosto/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/BUILD.gn b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/BUILD.gn new file mode 100644 index 000000000..f10757897 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemHostP") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FormSystemHostP" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/Test.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json new file mode 100644 index 000000000..90f1833b1 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json @@ -0,0 +1,124 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemhostp", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemhostp", + "name": ".FormStHostAppP", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormCast_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_SendCastForm_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent" + }, + { + "name": "FMS_FormCast_commonEvent" + }, + { + "name": "FMS_SendCastForm_commonEvent" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.REQUIRE_FORM" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..e88deae73 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent.host] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent.host] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..f9f267f07 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,422 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import formHost from '@ohos.application.formHost'; +import commonEvent from '@ohos.commonEvent'; + +@Entry +@Component +struct Index { + @State bundle: string = "com.form.formsystemtestservicea.hmservice"; + @State ability: string = "com.form.formsystemtestservicea.hmservice.FormAbility"; + @State moduleName: string = "entry"; + @State name: string = "Form_Js001"; + @State allowUpate: boolean = true; + @State isShowing: boolean = true; + @State optType: number = 0; + private dimension: FormDimension = FormDimension.Dimension_1_2; + + private normal = 0; + private temporary = 0; + private normaldel = 0; + private temporarydel = 0; + private normalFormIds = []; + private tempFormIds = []; + + private deleteIds = []; + private delCount = 0; + + private normalFormCounts = []; + private tempFormCounts = []; + + private castFormId = "-1"; + + private formOnAcquiredEvent = "FMS_FormOnAcquired_commonEvent"; + private formOnErrorEvent = "FMS_FormOnError_commonEvent"; + private formCastEvent = "FMS_FormCast_commonEvent"; + + private subscriberDel; + private subscriberFormDeleteEvent = { + events: ["FMS_FormDelete_commonEvent"], + }; + + private subscriberSendCastForm; + private subscriberSendCastFormEvent = { + events: ["FMS_SendCastForm_commonEvent"], + }; + + private publishOnErrorCallBack() { + console.debug("====> [FormComponent] formsystemhostp formOnErrorEvent Publish CallBack ====>"); + } + private publishOnAcquiredCallBack() { + console.debug("====> [FormComponent] formsystemhostp formOnAcquiredEvent Publish CallBack ====>"); + } + private publishDeleteCallBack() { + console.debug("====> [FormComponent] formsystemhostp publishDeleteCallBack Publish CallBack ====>"); + } + private publishCastCallBack() { + console.debug("====>formCastEvent Publish CallBack ====>"); + } + private startAbility(bundleName, abilityName, sendMsg) { + featureAbility.startAbility({ + want: { + bundleName: bundleName, + abilityName: abilityName, + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "sendCastForm": true, + "sendCastFormMsg": sendMsg, + "isCreate": false + } + } + }).then((res: any) => { + console.info(`[FormComponent] formsystemhostp featureAbility.startAbility res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`[FormComponent] formsystemhostp featureAbility.startAbility error: ${JSON.stringify(err)}`); + }); + } + private publishOnSendCastForm(err, data) { + console.info("!!!====>[FormComponent] formsystemhostp OnSendCastForm start:====>" + JSON.stringify(data)); + if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhostp") { + return; + } + let formId = data.parameters.castFormId; + setTimeout(function () { + console.info("[FormComponent.host] castTempForm start, formId: " + formId); + formHost.castTempForm(formId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", data); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); + this.startAbility("com.ohos.st.formsystemhostc", "com.ohos.st.formsystemhostc.MainAbility", error.code.toString()); + }); + console.info("[FormComponent.host] castTempForm end"); + }, 5000); + console.info("!!!====>[FormComponent] formsystemhostp OnSendCastForm end"); + } + + private deleteCallBack(err, data) { + console.info("!!!====>[FormComponent] formsystemhostp deleteCallBack start:====>" + JSON.stringify(data)); + const delFormIds = data.parameters.formIds; + console.info(`[FormComponent] data size ${delFormIds.length}`); + + console.info(`[FormComponent] data.subscriber ${JSON.stringify(this.subscriberDel)}`); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhostp optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhostp optType unSubscribeCastFormCallback CallBack====>"); + }); + console.info(`[FormComponent] data.bundleName ${JSON.stringify(data.bundleName)}`); + console.info(`[FormComponent] tof ${"com.ohos.st.formsystemhostp" != data.bundleName}`); + if ("com.ohos.st.formsystemhostp" != data.bundleName) { + return; + } + delFormIds.forEach(async (formId, index) => { + console.info(`[FormComponent] formsystemhostp deleteForm ${index}`); + try { + const res = await formHost.deleteForm(formId); + console.info(`[FormComponent] formsystemhostp deleteForm ${index} ${formId} result: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`[FormComponent] formsystemhostp deleteForm ${index} ${formId} error: ${JSON.stringify(error)}`); + } + }); + console.info("!!!====> [FormComponent] formsystemhostp optType deleteCallBack end ====>"); + } + + private aboutToAppear() { + commonEvent.createSubscriber(this.subscriberFormDeleteEvent).then(async (data) => { + console.info("====>[FormComponent] formsystemhostp Subscriber FormDelete data:====>", JSON.stringify(data)); + this.subscriberDel = data; + commonEvent.subscribe(this.subscriberDel, (err, data) => { + if ("com.ohos.st.formsystemhostp" != data.bundleName) { + return; + } else { + console.info("!!!====>[FormComponent.hostp] formsystemhostp deleteCallBack start:====>" + JSON.stringify(data)); + const delFormIds = data.parameters.formIds; + console.info(`[FormComponent] data size ${delFormIds.length}`); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhostp optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhostp optType unSubscribeCastFormCallback CallBack====>"); + }); + let delCounter = 0; + delFormIds.forEach((formId) => { + formHost.deleteForm(formId, (error, data) => { + console.info(`[FormComponent] formsystemhostp deleteForm ${++delCounter} ${formId} data: ${JSON.stringify(data)} err: ${JSON.stringify(error)}`); + }); + }); + } + }); + }); + + commonEvent.createSubscriber(this.subscriberSendCastFormEvent).then(async (data) => { + console.info("====>[FormComponent] formsystemhostp Subscriber SendCastForm data:====>", JSON.stringify(data)); + this.subscriberSendCastForm = data; + await commonEvent.subscribe(this.subscriberSendCastForm, this.publishOnSendCastForm); + }); + + featureAbility.getWant() + .then((want: any) => { + console.info(" [FormComponent] formsystemhostp getWant:" + JSON.stringify(want)); + + this.name = want.parameters.name; + this.bundle = want.parameters.bundle; + this.ability = want.parameters.ability; + if (want.parameters.moduleName) { + this.moduleName = want.parameters.moduleName; + } + + if (want.parameters.dimension) { + this.dimension = want.parameters.dimension; + } + + if (want.parameters.normal) { + this.normal = want.parameters.normal; + } + + if (want.parameters.temporary) { + this.temporary = want.parameters.temporary; + } + if (want.parameters.normaldel) { + this.normaldel = want.parameters.normaldel; + } + + if (want.parameters.temporarydel) { + this.temporarydel = want.parameters.temporarydel; + } + + if (want.parameters.deleteIds) { + this.deleteIds = want.parameters.deleteIds; + } + if (want.parameters.castFormId) { + this.castFormId = want.parameters.castFormId; + } + + this.makeCount(); + + setTimeout(() => { + this.optType = want.parameters.optType; + console.info(' [FormComponent] formsystemhostp getWant optType:' + this.optType); + }, 10); + + if (this.castFormId != "-1" && want.parameters.optType == 3) { + console.info("[FormComponent.host] castTempForm start"); + commonEvent.unsubscribe(this.subscriberDel, () => { + console.info("====> [FormComponent] formsystemhostp optType unSubscribeDeleteCallback CallBack====>"); + }); + commonEvent.unsubscribe(this.subscriberSendCastForm, () => { + console.info("====> [FormComponent] formsystemhostp optType unSubscribeCastFormCallback CallBack====>"); + }); + + formHost.castTempForm(this.castFormId) + .then((data) => { + console.info('[FormComponent] castTempForm result:' + data); + let commonEventPublishData = { + data: (data + "") || `0`, + bundleName: "com.ohos.st.formsystemhostp", + parameters: { + formId: this.castFormId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }) + .catch((error) => { + console.info('[FormComponent] castTempForm error:' + JSON.stringify(error)); + let commonEventPublishData = { + data: error.code.toString(), + bundleName: "com.ohos.st.formsystemhostp", + parameters: { + errMsg: error.message, + formId: this.castFormId.toString() + } + }; + commonEvent.publish(this.formCastEvent, commonEventPublishData, this.publishCastCallBack); + }); + console.info("[FormComponent.host] castTempForm end"); + } + + if (want.parameters.optType == 2 && this.deleteIds.length > 0) { + for (let iIndex = 0; iIndex < this.deleteIds.length; ++iIndex) { + console.info("[FormComponent] formsystemhostp deleteForm start"); + formHost.deleteForm(this.deleteIds[iIndex]) + .then((data) => { + console.info('[FormComponent] formsystemhostp deleteForm result:' + data); + this.delCount++; + + if (this.delCount == this.deleteIds.length) { + let commonEventPublishData = { + data: data + "", + bundleName: "com.ohos.st.formsystemhostp", + parameters: { + "formIds": this.deleteIds + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishDeleteCallBack); + } + }) + .catch((error) => { + console.info(' [FormComponent] formsystemhostp deleteForm error:' + error); + let commonEventPublishData = { + data: error.code.toString(), + bundleName: "com.ohos.st.formsystemhostp", + parameters: { + "formIds": [this.deleteIds[iIndex]] + } + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }); + console.info("[FormComponent] formsystemhostp deleteForm end"); + } + } + }) + .catch((error: any) => { + console.error(' [FormComponent] formsystemhostp Operation failed. Cause: ' + JSON.stringify(error)); + }) + console.info(`[FormComponent.host] aboutToAppear end`); + } + + private makeCount() { + console.info(' [FormComponent] formsystemhostp makeCount start.'); + for (let nNormal = 0; nNormal < this.normal; nNormal++) { + this.normalFormCounts.push(nNormal); + } + console.info(' [FormComponent] formsystemhostp this.normalFormCounts.length:' + this.normalFormCounts.length); + + for (let nTemp = 0; nTemp < this.temporary; nTemp++) { + this.tempFormCounts.push(nTemp); + } + console.info(' [FormComponent] formsystemhostp this.tempFormCounts.length:' + this.tempFormCounts.length); + } + + build() { + Scroll(new Scroller()) { + Column() { + if (this.optType == 1) { + Text(' [FormComponent] formsystemhostp normal form component test begin') + Grid() { + ForEach(this.normalFormCounts, (item) => { + GridItem() { + FormComponent({ + id: 0, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: false + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(" [FormComponent] formsystemhostp get normal form, form id:" + form.id); + + this.normalFormIds.push(form.id.toString()); + if (this.normalFormIds.length == this.normal - this.normaldel) { + let commonEventPublishData = { + data: "normalForm", + bundleName: "com.ohos.st.formsystemhostp", + parameters: { + "formIds": this.normalFormIds + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onError((error) => { + console.info(" [FormComponent] formsystemhostp normal form error code:" + error.errcode); + console.info(" [FormComponent] formsystemhostp normal form error msg:" + error.msg); + let commonEventPublishData = { + data: error.msg, + bundleName: "com.ohos.st.formsystemhostp" + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .size({ width: 40, height: 40 }) + } + }, (item) => JSON.stringify(item)) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') + .columnsGap(2) + .rowsGap(2) + .width('100%') + Text(' [FormComponent] formsystemhostp normal form component test end') + + Text(' [FormComponent] formsystemhostp temp form component test start') + Grid() { + ForEach(this.tempFormCounts, (item) => { + GridItem() { + FormComponent({ + id: 0, + name: this.name, + bundle: this.bundle, + ability: this.ability, + module: this.moduleName, + dimension: this.dimension, + temporary: true + }) + .allowUpdate(this.allowUpate) + .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden) + .onAcquired((form) => { + console.info(" [FormComponent] formsystemhostp get temp form, form id:" + form.id); + this.tempFormIds.push(form.id.toString()); + if (this.tempFormIds.length == this.temporary - this.temporarydel) { + let commonEventPublishData = { + data: "tempForm", + bundleName: "com.ohos.st.formsystemhostp", + parameters: { + "formIds": this.tempFormIds + } + }; + commonEvent.publish(this.formOnAcquiredEvent, commonEventPublishData, this.publishOnAcquiredCallBack); + } + }) + .onError((error) => { + console.info(" [FormComponent] formsystemhostp temp form error code:" + error.errcode); + console.info(" [FormComponent] formsystemhostp temp form error msg:" + error.msg); + let commonEventPublishData = { + data: error.msg, + bundleName: "com.ohos.st.formsystemhostp" + }; + commonEvent.publish(this.formOnErrorEvent, commonEventPublishData, this.publishOnErrorCallBack); + }) + .size({ width: 40, height: 40 }) + } + }, (item) => JSON.stringify(item)) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ') + .columnsGap(2) + .rowsGap(2) + .width('100%') + + Text(' [FormComponent] formsystemhostp temp form component test end') + } + } + .backgroundColor(Color.White) + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..82d9a3197 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formhostP" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formhostst_ets/formsystemhostp/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json new file mode 100644 index 000000000..5d19bdb47 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json @@ -0,0 +1,141 @@ +{ + "app": { + "bundleName": "com.form.formsystemtestservicea.hmservice", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 9, + "releaseType": "Release", + "target": 9 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.form.formsystemtestservicea.hmservice", + "name": ".FormSupplyAppA", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "name": ".FormAbility", + "srcPath": "FormAbility", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "formsEnabled": true, + "forms": [ + { + "jsComponentName": "Form_Js001", + "isDefault": true, + "scheduledUpdateTime": "10:30", + "formVisibleNotify": true, + "defaultDimension": "1*2", + "name": "Form_Js001", + "description": "This is a form 001", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "1*2", + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName":"Form_Js002", + "isDefault":false, + "defaultDimension":"2*2", + "formVisibleNotify":true, + "name":"Form_Js002", + "colorMode":"auto", + "description":"This is a form 002", + "supportDimensions":[ + "1*2", + "2*2" + ], + "type":"JS", + "updateEnabled":true, + "updateDuration":1 + } + ], + "srcLanguage": "ets" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "Form_Js001", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "reason": "need use FormSupply commonEvent", + "name": "FMS_FormSupply_commonEvent" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/FormAbility/form.ts new file mode 100644 index 000000000..5a5682da5 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/FormAbility/form.ts @@ -0,0 +1,88 @@ +import formBindingData from '@ohos.application.formBindingData' +import commonEvent from '@ohos.commonEvent' + +let supplyForm_Event = "FMS_FormSupply_commonEvent"; + +function publishCallBack() { + console.info("!!!====>FormAbility publishCallBack====>"); +} + +export default { + onCreate(want) { + console.info('FormAbility onCreate, want:' + JSON.stringify(want)); + let formData = { + temperature: "11°", + time: "11:00", + area: "Shenyang", + epidemic: true, + count: 10 + }; + let bindingData = formBindingData.createFormBindingData(formData); + var commonEventPublishData = { + parameters: { + "kind" : "onCreate", + "parameters" : JSON.stringify(want), + "data" : JSON.stringify(formData) + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + return bindingData; + }, + onUpdate(formId) { + console.info('FormAbility onUpdate, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onUpdate", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onCastToNormal(formId) { + console.info('FormAbility onCastTemp, formId: ' + formId); + + var commonEventPublishData = { + parameters: { + "kind" : "onCastToNormal", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onEvent(formId, message) { + console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); + + var commonEventPublishData = { + parameters: { + "kind" : "onEvent", + "parameters" : formId, + "data" : message + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onVisibilityChange(formEvents) { + console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); + var commonEventPublishData = { + parameters: { + "kind" : "onVisibilityChange", + "parameters" : JSON.stringify(formEvents), + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onDestroy(formId) { + console.info('FormAbility onDestroy, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onDestroy", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.css b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.css new file mode 100644 index 000000000..b52e9bfa9 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.css @@ -0,0 +1,19 @@ +#wrapper { + flex-direction: column; +} + +#div1 { + width: 100%; + height: 100%; + justify-content: center; + align-items: center; + background-color: white; +} + +#text1 { + height: 45px; + width: 150px; + font-size: 16px; + text-align: center; +} + diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.hml b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.hml new file mode 100644 index 000000000..b01936fb1 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.hml @@ -0,0 +1,7 @@ +
+
+
+ {{title}} +
+
+
\ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.json new file mode 100644 index 000000000..1c9e2ce99 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/js/Form_Js001/pages/index/index.json @@ -0,0 +1,6 @@ +{ + "actions": {}, + "data": { + "title": "Hello World" + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..24e9bc091 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "A提供方" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationA/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json new file mode 100644 index 000000000..3ee653543 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json @@ -0,0 +1,139 @@ +{ + "app": { + "bundleName": "com.form.formsystemtestserviceb.hmservice", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 9, + "releaseType": "Release", + "target": 9 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.form.formsystemtestserviceb.hmservice", + "name": ".FormSupplyAppB", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "name": ".FormAbility", + "srcPath": "FormAbility", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "formsEnabled": true, + "forms": [ + { + "jsComponentName": "widget", + "isDefault": true, + "formVisibleNotify": true, + "defaultDimension": "1*2", + "name": "Form_Js001", + "description": "This is a form 001", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "1*2", + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName":"widget", + "isDefault":false, + "defaultDimension":"2*2", + "formVisibleNotify":true, + "name":"Form_Js002", + "colorMode":"auto", + "description":"This is a form 002", + "supportDimensions":[ + "1*2", + "2*2" + ], + "type":"JS", + "updateEnabled":true, + "scheduledUpdateTime": "10:30" + } + ], + "srcLanguage": "ets" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "widget", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/FormAbility/form.ts new file mode 100644 index 000000000..5a5682da5 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/FormAbility/form.ts @@ -0,0 +1,88 @@ +import formBindingData from '@ohos.application.formBindingData' +import commonEvent from '@ohos.commonEvent' + +let supplyForm_Event = "FMS_FormSupply_commonEvent"; + +function publishCallBack() { + console.info("!!!====>FormAbility publishCallBack====>"); +} + +export default { + onCreate(want) { + console.info('FormAbility onCreate, want:' + JSON.stringify(want)); + let formData = { + temperature: "11°", + time: "11:00", + area: "Shenyang", + epidemic: true, + count: 10 + }; + let bindingData = formBindingData.createFormBindingData(formData); + var commonEventPublishData = { + parameters: { + "kind" : "onCreate", + "parameters" : JSON.stringify(want), + "data" : JSON.stringify(formData) + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + return bindingData; + }, + onUpdate(formId) { + console.info('FormAbility onUpdate, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onUpdate", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onCastToNormal(formId) { + console.info('FormAbility onCastTemp, formId: ' + formId); + + var commonEventPublishData = { + parameters: { + "kind" : "onCastToNormal", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onEvent(formId, message) { + console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); + + var commonEventPublishData = { + parameters: { + "kind" : "onEvent", + "parameters" : formId, + "data" : message + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onVisibilityChange(formEvents) { + console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); + var commonEventPublishData = { + parameters: { + "kind" : "onVisibilityChange", + "parameters" : JSON.stringify(formEvents), + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onDestroy(formId) { + console.info('FormAbility onDestroy, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onDestroy", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_2.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_2.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_2.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/image_2.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/close.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/close.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/close.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/close.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_HD1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_HD1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_HD1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_HD1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_box1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image@3x.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image@3x.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image@3x.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_image@3x.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_white.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_white.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_white.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_default_white.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_list.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_list.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_list.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_list.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pad1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_pc1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_public_search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_public_search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_public_search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_public_search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_selfie.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_selfie.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_selfie.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_selfie.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_tv.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_tv.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_tv.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_tv.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_vision.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_vision.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_vision.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/ic_vision.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/superdevice.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/superdevice.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/superdevice.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/superdevice.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/template.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/template.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/template.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/common/img/template.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/manifest.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/manifest.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/manifest.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/manifest.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/pages/index/index.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/pages/index/index.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/js/widget/pages/index/index.json diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..f9b4dc77e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "B提供方" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationB/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/FormAbility/form.ts similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/FormAbility/form.ts rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/FormAbility/form.ts diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_2.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_2.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_2.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/image_2.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/close.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/close.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/close.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/close.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_HD1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_HD1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_HD1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_HD1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_box1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image@3x.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image@3x.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image@3x.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_image@3x.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_white.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_white.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_white.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_default_white.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_list.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_list.svg new file mode 100644 index 000000000..68423fd2e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_list.svg @@ -0,0 +1,22 @@ + + + + ic_list + Created with Sketch. + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pad1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_pc1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_public_search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_public_search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_public_search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_public_search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_selfie.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_selfie.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_selfie.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_selfie.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_tv.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_tv.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_tv.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_tv.svg diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_vision.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_vision.svg new file mode 100644 index 000000000..572f8e6c3 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/ic_vision.svg @@ -0,0 +1,29 @@ + + + ic_vision + + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/superdevice.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/superdevice.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/superdevice.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/superdevice.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/template.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/template.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/template.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/common/img/template.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/manifest.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/manifest.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/manifest.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/manifest.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/pages/index/index.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/pages/index/index.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/js/widget/pages/index/index.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationC/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json new file mode 100644 index 000000000..514dc4b0f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json @@ -0,0 +1,139 @@ +{ + "app": { + "bundleName": "com.form.formsystemtestserviced.hmservice", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 9, + "releaseType": "Release", + "target": 9 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.form.formsystemtestserviced.hmservice", + "name": ".FormSupplyAppD", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "name": ".FormAbility", + "srcPath": "FormAbility", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "formsEnabled": true, + "forms": [ + { + "jsComponentName": "widget", + "isDefault": true, + "formVisibleNotify": false, + "defaultDimension": "1*2", + "name": "Form_Js001", + "description": "This is a form 001", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "1*2", + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName":"widget", + "isDefault":false, + "defaultDimension":"2*2", + "formVisibleNotify":true, + "name":"Form_Js002", + "colorMode":"auto", + "description":"This is a form 002", + "supportDimensions":[ + "1*2", + "2*2" + ], + "type":"JS", + "updateEnabled":true, + "scheduledUpdateTime": "10:30" + } + ], + "srcLanguage": "ets" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "widget", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/FormAbility/form.ts new file mode 100644 index 000000000..ef5e97f06 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/FormAbility/form.ts @@ -0,0 +1,89 @@ +import formBindingData from '@ohos.application.formBindingData' +import formProvider from '@ohos.application.formProvider' +import commonEvent from '@ohos.commonEvent' + +let supplyForm_Event = "FMS_FormSupply_commonEvent"; + +function publishCallBack() { + console.info("!!!====>FormAbility publishCallBack====>"); +} + +export default { + onCreate(want) { + console.info('FormAbility onCreate, want:' + JSON.stringify(want)); + let formData = { + temperature: "11°", + time: "11:00", + area: "Shenyang", + epidemic: true, + count: 10 + }; + let bindingData = formBindingData.createFormBindingData(formData); + let commonEventPublishData = { + parameters: { + "kind" : "onCreate", + "parameters" : JSON.stringify(want), + "data" : JSON.stringify(formData) + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + return bindingData; + }, + onUpdate(formId) { + console.info('FormAbility onUpdate, formId: ' + formId); + let commonEventPublishData = { + parameters: { + "kind" : "onUpdate", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onCastToNormal(formId) { + console.info('FormAbility onCastTemp, formId: ' + formId); + + let commonEventPublishData = { + parameters: { + "kind" : "onCastToNormal", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onEvent(formId, message) { + console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); + + let commonEventPublishData = { + parameters: { + "kind" : "onEvent", + "parameters" : formId, + "data" : message + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onVisibilityChange(formEvents) { + console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); + var commonEventPublishData = { + parameters: { + "kind" : "onVisibilityChange", + "parameters" : JSON.stringify(formEvents), + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onDestroy(formId) { + console.info('FormAbility onDestroy, formId: ' + formId); + let commonEventPublishData = { + parameters: { + "kind" : "onDestroy", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_2.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_2.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_2.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/image_2.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/close.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/close.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/close.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/close.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_HD1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_HD1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_HD1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_HD1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_box1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image@3x.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image@3x.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image@3x.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_image@3x.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_white.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_white.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_white.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_default_white.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_list.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_list.svg new file mode 100644 index 000000000..68423fd2e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_list.svg @@ -0,0 +1,22 @@ + + + + ic_list + Created with Sketch. + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pad1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_pc1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_public_search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_public_search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_public_search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_public_search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_selfie.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_selfie.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_selfie.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_selfie.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_tv.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_tv.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_tv.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_tv.svg diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_vision.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_vision.svg new file mode 100644 index 000000000..572f8e6c3 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/ic_vision.svg @@ -0,0 +1,29 @@ + + + ic_vision + + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/superdevice.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/superdevice.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/superdevice.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/superdevice.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/template.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/template.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/template.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/common/img/template.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/manifest.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/manifest.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/manifest.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/manifest.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/pages/index/index.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/pages/index/index.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/js/widget/pages/index/index.json diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..0d046efdc --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "D提供方" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationD/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json new file mode 100644 index 000000000..650456f8e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json @@ -0,0 +1,141 @@ +{ + "app": { + "bundleName": "com.form.formsystemtestservicee.hmservice", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 9, + "releaseType": "Release", + "target": 9 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.form.formsystemtestservicee.hmservice", + "name": ".FormSupplyAppE", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "name": ".FormAbility", + "srcPath": "FormAbility", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "formsEnabled": true, + "forms": [ + { + "jsComponentName": "widget", + "isDefault": true, + "scheduledUpdateTime": "10:30", + "formVisibleNotify": true, + "defaultDimension": "1*2", + "name": "Form_Js001", + "description": "This is a form 001", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "1*2", + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName":"widget", + "isDefault":false, + "defaultDimension":"2*2", + "formVisibleNotify":true, + "name":"Form_Js002", + "colorMode":"auto", + "description":"This is a form 002", + "supportDimensions":[ + "1*2", + "2*2" + ], + "type":"JS", + "updateEnabled":true, + "updateDuration":1 + } + ], + "srcLanguage": "ets" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "widget", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/FormAbility/form.ts new file mode 100644 index 000000000..3fe951d20 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/FormAbility/form.ts @@ -0,0 +1,99 @@ +import formBindingData from '@ohos.application.formBindingData' +import commonEvent from '@ohos.commonEvent' + +let supplyForm_Event = "FMS_FormSupply_commonEvent"; + +function publishCallBack() { + console.info("!!!====>FormAbility publishCallBack====>"); +} + +export default { + onCreate(want) { + console.info('FormAbility onCreate, want:' + JSON.stringify(want)); + let formData = { + "temperature":"11c", + "time":"11:00", + "test":11, + "test3":true, + "test_over_1k":'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of' + }; + let bindingData = formBindingData.createFormBindingData(formData); + var commonEventPublishData = { + parameters: { + "kind" : "onCreate", + "parameters" : JSON.stringify(want), + "data" : JSON.stringify(formData) + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + return bindingData; + }, + onUpdate(formId) { + console.info('FormAbility onUpdate, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onUpdate", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onCastToNormal(formId) { + console.info('FormAbility onCastTemp, formId: ' + formId); + + var commonEventPublishData = { + parameters: { + "kind" : "onCastToNormal", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onEvent(formId, message) { + console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); + + var commonEventPublishData = { + parameters: { + "kind" : "onEvent", + "parameters" : formId, + "data" : message + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onVisibilityChange(formEvents) { + console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); + var commonEventPublishData = { + parameters: { + "kind" : "onVisibilityChange", + "parameters" : JSON.stringify(formEvents), + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onDestroy(formId) { + console.info('FormAbility onDestroy, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onDestroy", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_2.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_2.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_2.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/image_2.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/close.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/close.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/close.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/close.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_HD1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_HD1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_HD1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_HD1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_box1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image@3x.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image@3x.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image@3x.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_image@3x.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_white.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_white.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_white.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_default_white.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_list.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_list.svg new file mode 100644 index 000000000..68423fd2e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_list.svg @@ -0,0 +1,22 @@ + + + + ic_list + Created with Sketch. + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pad1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_pc1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_public_search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_public_search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_public_search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_public_search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_selfie.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_selfie.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_selfie.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_selfie.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_tv.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_tv.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_tv.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_tv.svg diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_vision.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_vision.svg new file mode 100644 index 000000000..572f8e6c3 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/ic_vision.svg @@ -0,0 +1,29 @@ + + + ic_vision + + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/superdevice.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/superdevice.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/superdevice.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/superdevice.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/template.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/template.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/template.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/common/img/template.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/manifest.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/manifest.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/manifest.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/manifest.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/pages/index/index.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/pages/index/index.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/js/widget/pages/index/index.json diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..24e9bc091 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "A提供方" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationE/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/FormAbility/form.ts new file mode 100644 index 000000000..037dfce28 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/FormAbility/form.ts @@ -0,0 +1,143 @@ +import commonEvent from '@ohos.commonEvent'; +import formBindingData from '@ohos.application.formBindingData'; +import formProvider from '@ohos.application.formProvider'; +import systemTime from '@ohos.systemTime'; + +let supplyForm_Event = "FMS_FormSupply_commonEvent"; + +function publishCallBack() { + console.info("!!!====>FormAbility publishCallBack====>"); +} + +export default { + async onCreate(want) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onCreate, want:' + JSON.stringify(want)); + let formData = { + temperature: "11°", + time: "11:00", + area: "Shenyang", + epidemic: true, + count: 10 + }; + let bindingData = formBindingData.createFormBindingData(formData); + var commonEventPublishData = { + parameters: { + "kind": "onCreate", + "parameters": JSON.stringify(want), + "data": JSON.stringify(formData), + "time": time + } + }; + console.info(`FormAbility data ${JSON.stringify(commonEventPublishData)}`); + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + return bindingData; + }, + async onUpdate(formId) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onUpdate, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind": "onUpdate", + "parameters": formId, + "data": "", + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + async onCastToNormal(formId) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onCastTemp, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind": "onCastToNormal", + "parameters": formId, + "data": "", + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + async onEvent(formId, message) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); + var commonEventPublishData = { + parameters: { + "kind": "onEvent", + "parameters": formId, + "data": message, + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + async onVisibilityChange(formEvents) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); + var commonEventPublishData = { + parameters: { + "kind": "onVisibilityChange", + "parameters": JSON.stringify(formEvents), + "data": "", + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + + for (let key in formEvents) { + const value = formEvents[key]; + key = key.toString(); + console.log('form_extension onVisibilityChange, key:' + key + ", value=" + value); + let dataObj = { + temperature: "22°", + time: "22:00", + test: 22, + }; + let obj = formBindingData.createFormBindingData(dataObj); + + const updateFormStartTime = await systemTime.getCurrentTime(); + let data = await formProvider.updateForm(key, obj); + console.info('FormAbility onUpdateForm, res: ' + data); + const updateFormEndTime = await systemTime.getCurrentTime(); + + commonEventPublishData = { + parameters: { + "kind": "onUpdateForm", + "parameters": key, + "data": "", + "time": updateFormEndTime - updateFormStartTime + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + + const setFormNextRefreshTimeStartTime = await systemTime.getCurrentTime(); + data = await formProvider.setFormNextRefreshTime(key, 5); + console.info('FormAbility setFormNextRefreshTime, res: ' + data); + const setFormNextRefreshTimeEndTime = await systemTime.getCurrentTime(); + + commonEventPublishData = { + parameters: { + "kind": "onSetFormNextRefreshTime", + "parameters": key, + "data": "", + "time": setFormNextRefreshTimeEndTime - setFormNextRefreshTimeStartTime + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } + }, + async onDestroy(formId) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onDestroy, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind": "onDestroy", + "parameters": formId, + "data": "", + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } +}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_2.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_2.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_2.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/image_2.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/close.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/close.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/close.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/close.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_HD1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_HD1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_HD1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_HD1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_box1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_white.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_white.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_white.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_default_white.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_list.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_list.svg new file mode 100644 index 000000000..68423fd2e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_list.svg @@ -0,0 +1,22 @@ + + + + ic_list + Created with Sketch. + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pad1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_pc1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_selfie.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_selfie.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_selfie.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_selfie.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_tv.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_tv.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_tv.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_tv.svg diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_vision.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_vision.svg new file mode 100644 index 000000000..572f8e6c3 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/ic_vision.svg @@ -0,0 +1,29 @@ + + + ic_vision + + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/superdevice.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/superdevice.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/superdevice.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/superdevice.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/template.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/template.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/template.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/common/img/template.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/manifest.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/manifest.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/manifest.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/manifest.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/pages/index/index.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/pages/index/index.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/js/Form_Js001/pages/index/index.json diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..3300831ac --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "提供方F" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationF/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json new file mode 100644 index 000000000..389435140 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json @@ -0,0 +1,124 @@ +{ + "app": { + "bundleName": "com.form.formsystemtestserviceg.hmservice", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 9, + "releaseType": "Release", + "target": 9 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.form.formsystemtestserviceg.hmservice", + "name": ".FormSupplyAppG", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "name": ".FormAbility", + "srcPath": "FormAbility", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "formsEnabled": true, + "forms": [ + { + "jsComponentName": "Form_Js001", + "isDefault": true, + "scheduledUpdateTime": "10:30", + "formVisibleNotify": true, + "defaultDimension": "1*2", + "name": "Form_Js001", + "description": "This is a form widget", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "1*2", "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + } + ], + "srcLanguage": "ets" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "Form_Js001", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "reason": "need use FormSupply commonEvent", + "name": "FMS_FormSupply_commonEvent" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/FormAbility/form.ts new file mode 100644 index 000000000..5b855c11f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/FormAbility/form.ts @@ -0,0 +1,155 @@ +import commonEvent from '@ohos.commonEvent'; +import formBindingData from '@ohos.application.formBindingData'; +import formProvider from '@ohos.application.formProvider'; +import systemTime from '@ohos.systemTime'; + +let supplyForm_Event = "FMS_FormSupply_commonEvent"; + +function publishCallBack() { + console.info("!!!====>FormAbility publishCallBack====>"); +} + +export default { + async onCreate(want) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onCreate, want:' + JSON.stringify(want)); + let formData = { + temperature: "11°", + time: "11:00", + area: "Shenyang", + epidemic: true, + "test_over_1k":'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of', + count: 10 + }; + let bindingData = formBindingData.createFormBindingData(formData); + var commonEventPublishData = { + parameters: { + "kind": "onCreate", + "parameters": JSON.stringify(want), + "data": JSON.stringify(formData), + "time": time + } + }; + console.info(`FormAbility data ${JSON.stringify(commonEventPublishData)}`); + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + return bindingData; + }, + async onUpdate(formId) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onUpdate, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind": "onUpdate", + "parameters": formId, + "data": "", + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + async onCastToNormal(formId) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onCastTemp, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind": "onCastToNormal", + "parameters": formId, + "data": "", + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + async onEvent(formId, message) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); + var commonEventPublishData = { + parameters: { + "kind": "onEvent", + "parameters": formId, + "data": message, + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + async onVisibilityChange(formEvents) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); + var commonEventPublishData = { + parameters: { + "kind": "onVisibilityChange", + "parameters": JSON.stringify(formEvents), + "data": "", + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + + for (let key in formEvents) { + const value = formEvents[key]; + key = key.toString(); + console.log('form_extension onVisibilityChange, key:' + key + ", value=" + value); + let dataObj = { + temperature: "22°", + time: "22:00", + test: 22, + }; + let obj = formBindingData.createFormBindingData(dataObj); + + const updateFormStartTime = await systemTime.getCurrentTime(); + let data = await formProvider.updateForm(key, obj); + console.info('FormAbility onUpdateForm, res: ' + data); + const updateFormEndTime = await systemTime.getCurrentTime(); + + commonEventPublishData = { + parameters: { + "kind": "onUpdateForm", + "parameters": key, + "data": "", + "time": updateFormEndTime - updateFormStartTime + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + + const setFormNextRefreshTimeStartTime = await systemTime.getCurrentTime(); + data = await formProvider.setFormNextRefreshTime(key, 5); + console.info('FormAbility setFormNextRefreshTime, res: ' + data); + const setFormNextRefreshTimeEndTime = await systemTime.getCurrentTime(); + + commonEventPublishData = { + parameters: { + "kind": "onSetFormNextRefreshTime", + "parameters": key, + "data": "", + "time": setFormNextRefreshTimeEndTime - setFormNextRefreshTimeStartTime + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } + }, + async onDestroy(formId) { + const time = await systemTime.getCurrentTime(); + console.info('FormAbility onDestroy, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind": "onDestroy", + "parameters": formId, + "data": "", + "time": time + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } +}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_2.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_2.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_2.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/image_2.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/close.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/close.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/close.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/close.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_HD1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_HD1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_HD1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_HD1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_box1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_image@3x.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_white.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_white.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_white.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_default_white.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_device_earphone_hero_filled1.png diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_list.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_list.svg new file mode 100644 index 000000000..68423fd2e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_list.svg @@ -0,0 +1,22 @@ + + + + ic_list + Created with Sketch. + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pad1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_pc1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_public_search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_selfie.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_selfie.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_selfie.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_selfie.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_tv.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_tv.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_tv.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_tv.svg diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_vision.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_vision.svg new file mode 100644 index 000000000..572f8e6c3 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/ic_vision.svg @@ -0,0 +1,29 @@ + + + ic_vision + + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/superdevice.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/superdevice.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/superdevice.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/superdevice.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/template.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/template.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/template.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/common/img/template.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/manifest.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/manifest.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/manifest.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/manifest.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/pages/index/index.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/pages/index/index.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/js/Form_Js001/pages/index/index.json diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..1c9e50b08 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "提供方G" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationG/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json new file mode 100644 index 000000000..734f57ff8 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json @@ -0,0 +1,141 @@ +{ + "app": { + "bundleName": "com.form.formsystemtestserviceh.hmservice", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 9, + "releaseType": "Release", + "target": 9 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.form.formsystemtestserviceh.hmservice", + "name": ".FormSupplyAppH", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "name": ".FormAbility", + "srcPath": "FormAbility", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "formsEnabled": true, + "forms": [ + { + "jsComponentName": "widget", + "isDefault": true, + "scheduledUpdateTime": "10:30", + "formVisibleNotify": true, + "defaultDimension": "1*2", + "name": "Form_Js001", + "description": "This is a form 001", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "1*2", + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName":"widget", + "isDefault":false, + "defaultDimension":"2*2", + "formVisibleNotify":true, + "name":"Form_Js002", + "colorMode":"auto", + "description":"This is a form 002", + "supportDimensions":[ + "1*2", + "2*2" + ], + "type":"JS", + "updateEnabled":true, + "updateDuration":1 + } + ], + "srcLanguage": "ets" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "widget", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/FormAbility/form.ts new file mode 100644 index 000000000..3fe951d20 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/FormAbility/form.ts @@ -0,0 +1,99 @@ +import formBindingData from '@ohos.application.formBindingData' +import commonEvent from '@ohos.commonEvent' + +let supplyForm_Event = "FMS_FormSupply_commonEvent"; + +function publishCallBack() { + console.info("!!!====>FormAbility publishCallBack====>"); +} + +export default { + onCreate(want) { + console.info('FormAbility onCreate, want:' + JSON.stringify(want)); + let formData = { + "temperature":"11c", + "time":"11:00", + "test":11, + "test3":true, + "test_over_1k":'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of' + }; + let bindingData = formBindingData.createFormBindingData(formData); + var commonEventPublishData = { + parameters: { + "kind" : "onCreate", + "parameters" : JSON.stringify(want), + "data" : JSON.stringify(formData) + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + return bindingData; + }, + onUpdate(formId) { + console.info('FormAbility onUpdate, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onUpdate", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onCastToNormal(formId) { + console.info('FormAbility onCastTemp, formId: ' + formId); + + var commonEventPublishData = { + parameters: { + "kind" : "onCastToNormal", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onEvent(formId, message) { + console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); + + var commonEventPublishData = { + parameters: { + "kind" : "onEvent", + "parameters" : formId, + "data" : message + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onVisibilityChange(formEvents) { + console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); + var commonEventPublishData = { + parameters: { + "kind" : "onVisibilityChange", + "parameters" : JSON.stringify(formEvents), + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onDestroy(formId) { + console.info('FormAbility onDestroy, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onDestroy", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_2.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_2.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_2.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/image_2.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/close.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/close.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/close.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/close.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_HD1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_HD1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_HD1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_HD1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_box1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image@3x.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image@3x.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image@3x.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_image@3x.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_white.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_white.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_white.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_default_white.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_device_earphone_hero_filled1.png diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_list.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_list.svg new file mode 100644 index 000000000..68423fd2e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_list.svg @@ -0,0 +1,22 @@ + + + + ic_list + Created with Sketch. + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pad1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc1.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc1.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc1.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_pc1.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_public_search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_public_search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_public_search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_public_search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_selfie.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_selfie.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_selfie.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_selfie.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_tv.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_tv.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_tv.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_tv.svg diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_vision.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_vision.svg new file mode 100644 index 000000000..572f8e6c3 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/ic_vision.svg @@ -0,0 +1,29 @@ + + + ic_vision + + + + + \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/search.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/search.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/search.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/search.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/superdevice.svg b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/superdevice.svg similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/superdevice.svg rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/superdevice.svg diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/template.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/template.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/template.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/common/img/template.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/manifest.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/manifest.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/manifest.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/manifest.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/pages/index/index.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/pages/index/index.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/js/widget/pages/index/index.json diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..55bfa0276 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "H提供方" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationH/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json new file mode 100644 index 000000000..20d6ca202 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json @@ -0,0 +1,141 @@ +{ + "app": { + "bundleName": "com.form.formsystemtestservicenotsysapp.hmservice", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 9, + "releaseType": "Release", + "target": 9 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.form.formsystemtestservicenotsysapp.hmservice", + "name": ".FormSupplyAppNS", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "name": ".FormAbility", + "srcPath": "FormAbility", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "formsEnabled": true, + "forms": [ + { + "jsComponentName": "Form_Js001", + "isDefault": true, + "scheduledUpdateTime": "10:30", + "formVisibleNotify": true, + "defaultDimension": "1*2", + "name": "Form_Js001", + "description": "This is a form 001", + "colorMode": "auto", + "type": "JS", + "supportDimensions": [ + "1*2", + "2*2" + ], + "updateEnabled": true, + "updateDuration": 1 + }, + { + "jsComponentName":"Form_Js002", + "isDefault":false, + "defaultDimension":"2*2", + "formVisibleNotify":true, + "name":"Form_Js002", + "colorMode":"auto", + "description":"This is a form 002", + "supportDimensions":[ + "1*2", + "2*2" + ], + "type":"JS", + "updateEnabled":true, + "updateDuration":1 + } + ], + "srcLanguage": "ets" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index" + ], + "name": "Form_Js001", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "reason": "need use FormSupply commonEvent", + "name": "FMS_FormSupply_commonEvent" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/FormAbility/form.ts b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/FormAbility/form.ts new file mode 100644 index 000000000..3fe951d20 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/FormAbility/form.ts @@ -0,0 +1,99 @@ +import formBindingData from '@ohos.application.formBindingData' +import commonEvent from '@ohos.commonEvent' + +let supplyForm_Event = "FMS_FormSupply_commonEvent"; + +function publishCallBack() { + console.info("!!!====>FormAbility publishCallBack====>"); +} + +export default { + onCreate(want) { + console.info('FormAbility onCreate, want:' + JSON.stringify(want)); + let formData = { + "temperature":"11c", + "time":"11:00", + "test":11, + "test3":true, + "test_over_1k":'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of data,test over 1k of data,test over 1k of data' + + 'test over 1k of data,test over 1k of' + }; + let bindingData = formBindingData.createFormBindingData(formData); + var commonEventPublishData = { + parameters: { + "kind" : "onCreate", + "parameters" : JSON.stringify(want), + "data" : JSON.stringify(formData) + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + return bindingData; + }, + onUpdate(formId) { + console.info('FormAbility onUpdate, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onUpdate", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onCastToNormal(formId) { + console.info('FormAbility onCastTemp, formId: ' + formId); + + var commonEventPublishData = { + parameters: { + "kind" : "onCastToNormal", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onEvent(formId, message) { + console.info('FormAbility onTriggerEvent, formId: ' + formId + 'message: ' + message); + + var commonEventPublishData = { + parameters: { + "kind" : "onEvent", + "parameters" : formId, + "data" : message + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onVisibilityChange(formEvents) { + console.info('FormAbility onVisibilityChanged, ' + JSON.stringify(formEvents)); + var commonEventPublishData = { + parameters: { + "kind" : "onVisibilityChange", + "parameters" : JSON.stringify(formEvents), + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + }, + onDestroy(formId) { + console.info('FormAbility onDestroy, formId: ' + formId); + var commonEventPublishData = { + parameters: { + "kind" : "onDestroy", + "parameters" : formId, + "data" : "" + } + }; + commonEvent.publish(supplyForm_Event, commonEventPublishData, publishCallBack); + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/second.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/second.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/second.ets rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/ets/MainAbility/pages/second.ets diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.css b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.css new file mode 100644 index 000000000..b52e9bfa9 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.css @@ -0,0 +1,19 @@ +#wrapper { + flex-direction: column; +} + +#div1 { + width: 100%; + height: 100%; + justify-content: center; + align-items: center; + background-color: white; +} + +#text1 { + height: 45px; + width: 150px; + font-size: 16px; + text-align: center; +} + diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.hml b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.hml new file mode 100644 index 000000000..b01936fb1 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.hml @@ -0,0 +1,7 @@ +
+
+
+ {{title}} +
+
+
\ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.json new file mode 100644 index 000000000..1c9e2ce99 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/js/Form_Js001/pages/index/index.json @@ -0,0 +1,6 @@ +{ + "actions": {}, + "data": { + "title": "Hello World" + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..8d1f2ba0b --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "NS提供方" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/BUILD.gn new file mode 100644 index 000000000..272ca9e0c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemProviderA") { + hap_name = "FormSystemProviderA" + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/Test.json new file mode 100644 index 000000000..d9fdcb92f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json new file mode 100644 index 000000000..ad2fd2f88 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json @@ -0,0 +1,173 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemprovidera", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemprovidera", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "form_module_a", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "launchType": "standard", + "formsEnabled": true, + "forms": [ + { + "name": "FormA_Js001", + "description": "form_description_FormA_Js001", + "descriptionId": 0, + "isDefault": true, + "type": "JS", + "colorMode": "dark", + "supportDimensions": [ + "1*2", + "2*4" + ], + "defaultDimension": "1*2", + "updateEnabled": true, + "updateDuration": 1, + "scheduledUpdateTime": "5:30", + "jsComponentName": "card_a01", + "formVisibleNotify": true, + "formConfigAbility": "abilitya01", + "metaData": { + "customizeData": [ + { + "name": "originWidgetNameA01", + "value": "valueA01" + } + ] + } + }, + { + "name": "FormA_Js002", + "description": "form_description_FormA_Js002", + "descriptionId": 10, + "isDefault": false, + "type": "JS", + "colorMode": "light", + "supportDimensions": [ + "1*2", + "2*2", + "2*4", + "4*4" + ], + "defaultDimension": "4*4", + "updateEnabled": false, + "updateDuration": 2, + "scheduledUpdateTime": "20:30", + "jsComponentName": "card_a02", + "formVisibleNotify": false, + "formConfigAbility": "abilitya02", + "metaData": { + "customizeData": [ + { + "name": "originWidgetNameA02", + "value": "valueA02" + } + ] + } + } + ] + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..d63635634 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info(`[FormProviderA] Application onCreate`); + }, + onDestroy() { + console.info(`[FormProviderA] Application onDestroy`); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..11c1d75bd --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; + +@Entry +@Component +struct Index { + private componentName: string = `FormProviderA`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`Fms Main Ability Test`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemprovidera/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/BUILD.gn new file mode 100644 index 000000000..557331b25 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemProviderB") { + hap_name = "FormSystemProviderB" + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/Test.json new file mode 100644 index 000000000..d9fdcb92f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json new file mode 100644 index 000000000..162e5064d --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json @@ -0,0 +1,144 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemproviderb", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemproviderb", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "form_module_b", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "launchType": "standard", + "formsEnabled": true, + "forms": [ + { + "name": "FormB_Js001", + "description": "form_description_FormB_Js001", + "descriptionId": 20, + "isDefault": true, + "type": "JS", + "colorMode": "auto", + "supportDimensions": [ + "1*2", + "2*2" + ], + "defaultDimension": "2*2", + "updateEnabled": true, + "updateDuration": 3, + "scheduledUpdateTime": "10:30", + "jsComponentName": "card_b", + "formVisibleNotify": true, + "formConfigAbility": "abilityb", + "metaData": { + "customizeData": [ + { + "name": "originWidgetNameB", + "value": "valueB" + } + ] + } + } + ] + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..fff23b88f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info(`[FormProviderB] Application onCreate`); + }, + onDestroy() { + console.info(`[FormProviderB] Application onDestroy`); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..a6a445c47 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; + +@Entry +@Component +struct Index { + private componentName: string = `FormProviderB`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`Fms Main Ability Test`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderb/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/BUILD.gn new file mode 100644 index 000000000..3cf17f2b9 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemProviderC") { + hap_name = "FormSystemProviderC" + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/Test.json new file mode 100644 index 000000000..d9fdcb92f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json new file mode 100644 index 000000000..9e0dc9dd6 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json @@ -0,0 +1,144 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemproviderc", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemproviderc", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "form_module_c", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "launchType": "standard", + "formsEnabled": true, + "forms": [ + { + "name": "FormC_Js001", + "description": "form_description_FormC_Js001", + "descriptionId": 30, + "isDefault": true, + "type": "JS", + "colorMode": "light", + "supportDimensions": [ + "2*4", + "4*4" + ], + "defaultDimension": "2*4", + "updateEnabled": true, + "updateDuration": 4, + "scheduledUpdateTime": "15:30", + "jsComponentName": "card_c", + "formVisibleNotify": true, + "formConfigAbility": "abilityc", + "metaData": { + "customizeData": [ + { + "name": "originWidgetNameC", + "value": "valueC" + } + ] + } + } + ] + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..b9abd38b6 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info(`[FormProviderC] Application onCreate`); + }, + onDestroy() { + console.info(`[FormProviderC] Application onDestroy`); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..349acd10f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; + +@Entry +@Component +struct Index { + private componentName: string = `FormProviderC`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`Fms Main Ability Test`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderc/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/BUILD.gn b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/BUILD.gn new file mode 100644 index 000000000..ce843fb51 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FormSystemProviderD") { + hap_name = "FormSystemProviderD" + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/Test.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/Test.json new file mode 100644 index 000000000..d9fdcb92f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json new file mode 100644 index 000000000..d4e410134 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json @@ -0,0 +1,116 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsystemproviderd", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsystemproviderd", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "form_module_d", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "service", + "launchType": "standard", + "formsEnabled": true, + "forms": [] + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..44dbad607 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info(`[FormProviderD] Application onCreate`); + }, + onDestroy() { + console.info(`[FormProviderD] Application onDestroy`); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..04e204075 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; + +@Entry +@Component +struct Index { + private componentName: string = `FormProviderD`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`Fms Main Ability Test`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formproviderst_ets/formsystemproviderd/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/Test.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/Test.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets new file mode 100644 index 000000000..5812a21d7 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets @@ -0,0 +1,1594 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { beforeEach, describe, expect, it } from "deccjsunit/index"; + +var onErrorForm_Event = { + events: ["FMS_FormOnError_commonEvent"], +}; +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; +var subscriberFormCastEvent = { + events: ["FMS_FormCast_commonEvent"], +}; +var onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + +var subscriberOnError; +var subscriberOnAcquired; +var subscriberCast; +var subscriberSupply; + +export default function test() { + describe(`FmsAcquiredFormTest`, () => { + + beforeEach(async () => { + subscriberOnError = await commonEvent.createSubscriber(onErrorForm_Event); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberCast = await commonEvent.createSubscriber(subscriberFormCastEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + await sleep(1000); + }) + + /** + * @tc.number: FMS_acquireForm_0200 + * @tc.name: The form host does not have permission to use the form + * @tc.desc: Failed to create a form when verifying that the form host does not have form permission. + */ + it(`FMS_acquireForm_0200`, 0, async (done) => { + console.info(`FMS_acquireForm_0200 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_0200 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("check permission deny, need to request ohos.permission.REQUIRE_FORM."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0200")); + console.info(`FMS_acquireForm_0200 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_0200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostnoperm", + abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_0200 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_0300 + * @tc.name: Failed to add form when parameter formId is wrong. + * @tc.desc: Failed to create form when verifying that the parameter (formId) of creating form is wrong. + */ + it(`FMS_acquireForm_0300`, 0, async (done) => { + console.info(`FMS_acquireForm_0300 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_0300 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0300")); + console.info(`FMS_acquireForm_0300 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_0300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "-1", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_0300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_0400 + * @tc.name: Failed to add form when parameter bundlename is wrong. + * @tc.desc: Form creation failed when verifying the wrong parameter (bundlename) of form creation. + */ + it(`FMS_acquireForm_0400`, 0, async (done) => { + console.info(`FMS_acquireForm_0400 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_0400 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0400")); + console.info(`FMS_acquireForm_0400 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_0400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "-1", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice123", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_0400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_0500 + * @tc.name: Failed to add form when parameter moduleName is wrong. + * @tc.desc: Form creation failed when verifying the wrong parameter (moduleName) of form creation. + */ + it(`FMS_acquireForm_0500`, 0, async (done) => { + console.info(`FMS_acquireForm_0500 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_0500 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0500")); + console.info(`FMS_acquireForm_0500 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_0500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "-1", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry123", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_0500 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_0600 + * @tc.name: Failed to add form when parameter formName is wrong. + * @tc.desc: Form creation failed when verifying the wrong parameter (formName) of form creation. + */ + it(`FMS_acquireForm_0600`, 0, async (done) => { + console.info(`FMS_acquireForm_0600 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_0600 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0600")); + console.info(`FMS_acquireForm_0600 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_0600 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "-1", + "name": "Form_Js001987", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_0600 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_0700 + * @tc.name: Failed to add form when parameter abilityName is wrong. + * @tc.desc: Form creation failed when verifying the wrong parameter (abilityName) of form creation. + */ + it(`FMS_acquireForm_0700`, 0, async (done) => { + console.info(`FMS_acquireForm_0700 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_0700 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_0700")); + console.info(`FMS_acquireForm_0700 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_0700 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "-1", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility123", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_0700 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_1000 + * @tc.name: Failed to add form when parameter form dimension is wrong. + * @tc.desc: Form creation failed when verifying the wrong parameter (form dimension) of form creation. + */ + it(`FMS_acquireForm_1000`, 0, async (done) => { + console.info(`FMS_acquireForm_1000 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_1000 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_1000")); + console.info(`FMS_acquireForm_1000 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_1000 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "-1", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "dimension": 4, + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_1000 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_acquireForm_1100 + * @tc.name: When the formId is set to 0, a non cached form is added. + * @tc.desc: Verify that the non cache form can be successfully created. + */ + it(`FMS_acquireForm_1100`, 0, async (done) => { + console.info(`FMS_acquireForm_1100 start`); + let formId1; + let formId2; + + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_1100 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1100")); + formId1 = data.data; + + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1100 publish' + JSON.stringify(err)); + }); + } + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onCreate") { + console.info("====>FMS_acquireForm_1100 onSupplyCallBack====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_1100")); + let retData = JSON.parse(data.parameters.parameters); + + let bundleName = retData.bundleName; + expect(bundleName).assertEqual("com.form.formsystemtestservicea.hmservice"); + let abilityName = retData.abilityName; + expect(abilityName).assertEqual("com.form.formsystemtestservicea.hmservice.FormAbility"); + let moduleName = retData.parameters['ohos.extra.param.key.module_name']; + expect(moduleName).assertEqual("entry"); + let formName = retData.parameters['ohos.extra.param.key.form_name']; + expect(formName).assertEqual("Form_Js001"); + let formDimension = retData.parameters['ohos.extra.param.key.form_dimension']; + expect(formDimension).assertEqual(1); + let tempFormFlag = retData.parameters['ohos.extra.param.key.form_temporary']; + expect(tempFormFlag).assertEqual(false); + + formId2 = retData.parameters['ohos.extra.param.key.form_identity']; + + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1100 publish' + JSON.stringify(err)); + }); + } + } + } + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.info(`FMS_acquireForm_1100 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_1100 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_acquireForm_1200 + * @tc.name: When the formId is set to 0, a non cached form is added. + * @tc.desc: Verify that the non cache form can be successfully created. + */ + it(`FMS_acquireForm_1200`, 0, async (done) => { + console.info(`FMS_acquireForm_1200 start`); + let formId1; + let formId2; + + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_1200 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1200")) + formId1 = data.data; + console.info("!!!====>FMS_acquireForm_1200 onAcquiredCallBack formId1:====>" + formId1); + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1200 publish' + JSON.stringify(err)); + }); + } + } + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onCreate") { + console.info("====>FMS_acquireForm_1200 onSupplyCallBack====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_1200")); + let retData = JSON.parse(data.parameters.parameters); + + let bundleName = retData.bundleName; + expect(bundleName).assertEqual("com.form.formsystemtestservicee.hmservice"); + let abilityName = retData.abilityName; + expect(abilityName).assertEqual("com.form.formsystemtestservicee.hmservice.FormAbility"); + let moduleName = retData.parameters['ohos.extra.param.key.module_name']; + expect(moduleName).assertEqual("entry"); + let formName = retData.parameters['ohos.extra.param.key.form_name']; + expect(formName).assertEqual("Form_Js001"); + let formDimension = retData.parameters['ohos.extra.param.key.form_dimension']; + expect(formDimension).assertEqual(1); + let tempFormFlag = retData.parameters['ohos.extra.param.key.form_temporary']; + expect(tempFormFlag).assertEqual(false); + + formId2 = retData.parameters['ohos.extra.param.key.form_identity']; + console.info("!!!====>FMS_acquireForm_1200 onSupplyCallBack formId2:====>" + formId2); + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1200 publish' + JSON.stringify(err)); + }); + } + } + } + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.info(`FMS_acquireForm_1200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostb", + abilityName: "com.ohos.st.formsystemhostb.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicee.hmservice", + "ability": "com.form.formsystemtestservicee.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_1200 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_1400 + * @tc.name: FormId does not match other parameters when adding a cached form. + * @tc.desc: Failed to create a cached form when verifying that FormId does not match other parameters. + */ + it(`FMS_acquireForm_1400`, 0, async (done) => { + console.info(`FMS_acquireForm_1400 start`); + var formId; + + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_1400 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("the requested form id is not existed on fms."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallBackCache("FMS_acquireForm_1400")); + var commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1400 publish' + JSON.stringify(err)); + }); + } + async function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_1400 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1400")) + formId = data.data; + // add cache form + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_1400 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "1", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_1400 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.info(`FMS_acquireForm_1400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_1400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_1500 + * @tc.name: Add a cached form. + * @tc.desc: Verify that the cached form can be successfully created. + */ + it(`FMS_acquireForm_1500`, 0, async (done) => { + console.info(`FMS_acquireForm_1500 start`); + let formId1; + let formId2; + let onCreateCount = 0; + + function onAcquiredCallBackCache(_, data) { + console.info("!!!====>FMS_acquireForm_1500 onAcquiredCallBackCache data:====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallBackCache("FMS_acquireForm_1500")); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + formId2 = data.data; + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1500 publish' + JSON.stringify(err)); + }); + } + } + async function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_1500 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1500")) + formId1 = data.data; + // add cache form + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBackCache); + console.info(`FMS_acquireForm_1500 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostb", + abilityName: "com.ohos.st.formsystemhostb.MainAbility", + parameters: { + "formId": formId1, + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_1500 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onCreate") { + console.info("====>FMS_acquireForm_1500 onSupplyCallBack====>" + JSON.stringify(data)); + onCreateCount++; + if (onCreateCount == 2) { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_1500")) + } + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1500 publish' + JSON.stringify(err)); + }); + } + } + } + + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.info(`FMS_acquireForm_1500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_1500 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_acquireForm_1600 + * @tc.name: A single form host (using a single thread) continuously creates 2 normal and 2 temporary forms. + * @tc.desc: Verify that a single host (using a single thread) can successfully create multiple normal + * and temporary forms continuously. + */ + it(`FMS_acquireForm_1600`, 0, async (done) => { + console.info(`FMS_acquireForm_1600 start`); + + function delPublishCallBack_Normal1() { + console.info("!!!====>FMS_acquireForm_1600 delPublishCallBack_Normal1====>"); + setTimeout(function () { + console.info('FMS_acquireForm_1600 delPublishCallBack_Normal1 end'); + FMS_acquireForm_1600_normal2(); + }, 50); + } + function onAcquiredCallBack_Normal1(_, data) { + console.info("!!!====>FMS_acquireForm_1600 onAcquiredCallBack_Normal1 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal1) + var commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhost", + data: data.data + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Normal1); + } + function unSubscribeOnAcquiredCallBack_Normal1() { + console.info("====>FMS_acquireForm_1600 unSubscribeOnAcquiredCallBack_Normal1 CallBack====>"); + } + + async function FMS_acquireForm_1600_normal1() { + console.info(`FMS_acquireForm_1600_normal1 start`); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal1); + console.info(`FMS_acquireForm_1600_normal1 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1600_normal1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1600_normal1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1600_normal1 featureAbility.startAbility end`); + console.info(`FMS_acquireForm_1600_normal1 end`); + } + + function delPublishCallBack_Normal2() { + console.info("!!!====>FMS_acquireForm_1600 delPublishCallBack_Normal2====>"); + setTimeout(function () { + console.info('FMS_acquireForm_1600 delPublishCallBack_Normal2 end'); + FMS_acquireForm_1600_Temp1(); + }, 50); + } + function onAcquiredCallBack_Normal2(_, data) { + console.info("!!!====>FMS_acquireForm_1600 onAcquiredCallBack_Normal2 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal2) + var commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhost", + data: data.data + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Normal2); + } + function unSubscribeOnAcquiredCallBack_Normal2() { + console.info("====>FMS_acquireForm_1600 unSubscribeOnAcquiredCallBack_Normal2====>"); + } + async function FMS_acquireForm_1600_normal2() { + console.info(`FMS_acquireForm_1600_normal2 start`); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal2); + console.info(`FMS_acquireForm_1600_normal2 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1600_normal2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1600_normal2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1600_normal2 featureAbility.startAbility end`); + console.info(`FMS_acquireForm_1600_normal2 end`); + } + + function delPublishCallBack_Temp1() { + console.info("!!!====>FMS_acquireForm_1600 delPublishCallBack_Temp1====>"); + setTimeout(function () { + console.info('FMS_acquireForm_1600 delPublishCallBack_Temp1 end'); + FMS_acquireForm_1600_Temp2(); + }, 50); + } + function onAcquiredCallBack_Temp1(_, data) { + console.info("!!!====>FMS_acquireForm_1600 onAcquiredCallBack_Temp1 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Temp1) + var commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhost", + data: data.data + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Temp1); + } + function unSubscribeOnAcquiredCallBack_Temp1() { + console.info("====>FMS_acquireForm_1600 unSubscribeOnAcquiredCallBack_Temp1====>"); + } + + async function FMS_acquireForm_1600_Temp1() { + console.info(`FMS_acquireForm_1600_Temp1 start`); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Temp1); + console.info(`FMS_acquireForm_1600_Temp1 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1600_Temp1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1600_Temp1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1600_Temp1 featureAbility.startAbility end`); + console.info(`FMS_acquireForm_1600_Temp1 end`); + } + + function delPublishCallBack_Temp2() { + console.info("!!!====>FMS_acquireForm_1600 delPublishCallBack_Temp2====>"); + setTimeout(function () { + console.info('FMS_acquireForm_1600 delPublishCallBack_Temp2 end'); + console.info(`FMS_acquireForm_1600 end`); + done(); + }, 500); + } + function onAcquiredCallBack_Temp2(_, data) { + console.info("!!!====>FMS_acquireForm_1600 onAcquiredCallBack_Temp2 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Temp2) + var commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhost", + data: data.data + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Temp2); + } + function unSubscribeOnAcquiredCallBack_Temp2() { + console.info("====>FMS_acquireForm_1600 unSubscribeOnAcquiredCallBack_Temp2====>"); + } + + async function FMS_acquireForm_1600_Temp2() { + console.info(`FMS_acquireForm_1600_Temp2 start`); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Temp2); + console.info(`FMS_acquireForm_1600_Temp2 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1600_Temp2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1600_Temp2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1600_Temp2 featureAbility.startAbility end`); + console.info(`FMS_acquireForm_1600_Temp2 end`); + } + + FMS_acquireForm_1600_normal1(); + }); + /** + * @tc.number: FMS_acquireForm_1800 + * @tc.name: Multiple form hosts create one normal form and one temporary form respectively. + * @tc.desc: Verify that multiple hosts can successfully create multiple normal and temporary forms respectively. + */ + it(`FMS_acquireForm_1800`, 0, async (done) => { + console.info(`FMS_acquireForm_1800 start`); + + function delPublishCallBack_Normal1() { + console.info("!!!====>FMS_acquireForm_1800 delPublishCallBack_Normal1====>"); + setTimeout(function () { + console.info('FMS_acquireForm_1800 delPublishCallBack_Normal1 end'); + FMS_acquireForm_1800_normal2(); + }, 50); + } + function onAcquiredCallBack_Normal1(_, data) { + console.info("!!!====>FMS_acquireForm_1800 onAcquiredCallBack_Normal1 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal1) + var commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhost", + data: data.data + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Normal1); + } + function unSubscribeOnAcquiredCallBack_Normal1() { + console.info("====>FMS_acquireForm_1800 unSubscribeOnAcquiredCallBack_Normal1 CallBack====>"); + } + + async function FMS_acquireForm_1800_normal1() { + console.info(`FMS_acquireForm_1800_normal1 start`); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal1); + + console.info(`FMS_acquireForm_1800_normal1 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1800_normal1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1800_normal1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1800_normal1 featureAbility.startAbility end`); + console.info(`FMS_acquireForm_1800_normal1 end`); + } + + function delPublishCallBack_Normal2() { + console.info("!!!====>FMS_acquireForm_1800 delPublishCallBack_Normal2====>"); + setTimeout(function () { + console.info('FMS_acquireForm_1800 delPublishCallBack_Normal2 end'); + FMS_acquireForm_1800_Temp1(); + }, 50); + } + function onAcquiredCallBack_Normal2(_, data) { + console.info("!!!====>FMS_acquireForm_1800 onAcquiredCallBack_Normal2 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal2) + var commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostb", + data: data.data + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Normal2); + } + function unSubscribeOnAcquiredCallBack_Normal2() { + console.info("====>FMS_acquireForm_1800 unSubscribeOnAcquiredCallBack_Normal2====>"); + } + async function FMS_acquireForm_1800_normal2() { + console.info(`FMS_acquireForm_1800_normal2 start`); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal2); + + console.info(`FMS_acquireForm_1800_normal2 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostb", + abilityName: "com.ohos.st.formsystemhostb.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1800_normal2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1800_normal2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1800_normal2 featureAbility.startAbility end`); + console.info(`FMS_acquireForm_1800_normal2 end`); + } + + function delPublishCallBack_Temp1() { + console.info("!!!====>FMS_acquireForm_1800 delPublishCallBack_Temp1====>"); + setTimeout(function () { + console.info('FMS_acquireForm_1800 delPublishCallBack_Temp1 end'); + FMS_acquireForm_1800_Temp2(); + }, 50); + } + function onAcquiredCallBack_Temp1(_, data) { + console.info("!!!====>FMS_acquireForm_1800 onAcquiredCallBack_Temp1 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Temp1) + var commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhost", + data: data.data + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Temp1); + } + function unSubscribeOnAcquiredCallBack_Temp1() { + console.info("====>FMS_acquireForm_1800 unSubscribeOnAcquiredCallBack_Temp1====>"); + } + + async function FMS_acquireForm_1800_Temp1() { + console.info(`FMS_acquireForm_1800_Temp1 start`); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Temp1); + console.info(`FMS_acquireForm_1800_Temp1 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1800_Temp1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1800_Temp1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1800_Temp1 featureAbility.startAbility end`); + console.info(`FMS_acquireForm_1800_Temp1 end`); + } + + function delPublishCallBack_Temp2() { + console.info("!!!====>FMS_acquireForm_1800 delPublishCallBack_Temp2====>"); + setTimeout(function () { + console.info('FMS_acquireForm_1800 delPublishCallBack_Temp2 end'); + console.info(`FMS_acquireForm_1800 end`); + done(); + }, 500); + } + function onAcquiredCallBack_Temp2(_, data) { + console.info("!!!====>FMS_acquireForm_1800 onAcquiredCallBack_Temp2 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Temp2) + var commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostb", + data: data.data + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack_Temp2); + } + function unSubscribeOnAcquiredCallBack_Temp2() { + console.info("====>FMS_acquireForm_1800 unSubscribeOnAcquiredCallBack_Temp2====>"); + } + + async function FMS_acquireForm_1800_Temp2() { + console.info(`FMS_acquireForm_1800_Temp2 start`); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Temp2); + + console.info(`FMS_acquireForm_1800_Temp2 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostb", + abilityName: "com.ohos.st.formsystemhostb.MainAbility", + + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1800_Temp2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1800_Temp2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1800_Temp2 featureAbility.startAbility end`); + console.info(`FMS_acquireForm_1800_Temp2 end`); + } + + FMS_acquireForm_1800_normal1(); + }); + /** + * @tc.number: FMS_acquireForm_1900 + * @tc.name: Add a temporary form when the formId is set to 0. + * @tc.desc: When the verification formId is set to 0, the temporary form is created successfully. + */ + it(`FMS_acquireForm_1900`, 0, async (done) => { + console.info(`FMS_acquireForm_1900 start`); + let formId1; + let formId2; + + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_1900 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_1900")) + formId1 = data.data; + + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1900 publish' + JSON.stringify(err)); + }); + } + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onCreate") { + console.info("====>FMS_acquireForm_1900 onSupplyCallBack====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_1900")); + let retData = JSON.parse(data.parameters.parameters); + + let bundleName = retData.bundleName; + expect(bundleName).assertEqual("com.form.formsystemtestservicea.hmservice"); + let abilityName = retData.abilityName; + expect(abilityName).assertEqual("com.form.formsystemtestservicea.hmservice.FormAbility"); + let moduleName = retData.parameters['ohos.extra.param.key.module_name']; + expect(moduleName).assertEqual("entry"); + let formName = retData.parameters['ohos.extra.param.key.form_name']; + expect(formName).assertEqual("Form_Js001"); + let formDimension = retData.parameters['ohos.extra.param.key.form_dimension']; + expect(formDimension).assertEqual(1); + let tempFormFlag = retData.parameters['ohos.extra.param.key.form_temporary']; + expect(tempFormFlag).assertEqual(true); + formId2 = retData.parameters['ohos.extra.param.key.form_identity']; + console.info("!!!====>FMS_acquireForm_1900 onAcquiredCallBack formId2:====>" + formId2); + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_1900 publish' + JSON.stringify(err)); + }); + } + } + } + + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + + console.info(`FMS_acquireForm_1900 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_1900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_1900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_1900 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_2100 + * @tc.name: When creating a temporary form, the formId is specified as the created normal formId. + * @tc.desc: Failed to create a temporary form when verifying that the formId is set to create a normal formId. + */ + it(`FMS_acquireForm_2100`, 0, async (done) => { + console.info(`FMS_acquireForm_2100 start`); + var formId; + + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2100 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallBackCache("FMS_acquireForm_2100")); + var commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_2100 publish' + JSON.stringify(err)); + }); + } + async function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2100 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_2100")) + formId = data.data; + // add cache form + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_2100 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": data.data, + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2100 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.info(`FMS_acquireForm_2100 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2100 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_2200 + * @tc.name: Cast to normal form when the temporary formId is set to negative. + * @tc.desc: Failed to Cast to normal form when the temporary formId is set to negative + */ + it(`FMS_acquireForm_2200`, 0, async (done) => { + console.info(`FMS_acquireForm_2200 start`); + + function onCastCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2200 onCastCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormCast_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2200")) + var commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_2200 publish' + JSON.stringify(err)); + }); + } + + commonEvent.subscribe(subscriberCast, onCastCallBack); + console.info(`FMS_acquireForm_2200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "temporaryId": "-1", + "castForm": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2200 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_2300 + * @tc.name: Cast to normal form when the temporary formIdis set to 0. + * @tc.desc: Failed to convert to normal form when verifying that the temporary formIdis set to 0 + */ + it(`FMS_acquireForm_2300`, 0, async (done) => { + console.info(`FMS_acquireForm_2300 start`); + + function onCastCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2300 onCastCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormCast_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2300")) + var commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_2300 publish' + JSON.stringify(err)); + }); + } + commonEvent.subscribe(subscriberCast, onCastCallBack); + console.info(`FMS_acquireForm_2300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "temporaryId": "0", + "castForm": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_2400 + * @tc.name: Non affiliated temporary form ID to normal form. + * @tc.desc: Failed to convert non affiliated temporary form ID to normal form. + */ + it(`FMS_acquireForm_2400`, 0, async (done) => { + console.info(`FMS_acquireForm_2400 start`); + + function onCastCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2400 onCastCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormCast_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2400")) + var commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_2400 publish' + JSON.stringify(err)); + }); + } + async function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2400 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_2400")) + commonEvent.subscribe(subscriberCast, onCastCallBack); + console.info(`FMS_acquireForm_2400 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostb", + abilityName: "com.ohos.st.formsystemhostb.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "temporaryId": data.data, + "castForm": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2400 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.info(`FMS_acquireForm_2400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_2500 + * @tc.name: cast non-existent temporary formId to normal form. + * @tc.desc: Failed to verify that the temporary formId that does not exist is casted to normal form. + */ + it(`FMS_acquireForm_2500`, 0, async (done) => { + console.info(`FMS_acquireForm_2500 start`); + + function onCastCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2500 onCastCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormCast_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2500")) + var commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_2500 publish' + JSON.stringify(err)); + }); + } + commonEvent.subscribe(subscriberCast, onCastCallBack); + console.info(`FMS_acquireForm_2500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "temporaryId": "123456789", + "castForm": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2500 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_2600 + * @tc.name: When the normal form does not reach the maximum value created by the form, the temporary form changes to the normal form. + * @tc.desc: Verify that when the normal form does not reach the maximum value created by the form. + * the temporary form can be successfully casted to the normal form. + */ + it(`FMS_acquireForm_2600`, 0, async (done) => { + console.info(`FMS_acquireForm_2600 start`); + let formId1; + let formId2; + + function onCastCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2600 onCastCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormCast_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2600")) + formId1 = data.parameters.formId; + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + } + commonEvent.publish(deleteForm_Event, () => delPublishCallBack("FMS_acquireForm_2600", done)); + } + + async function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_2600 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_2600")) + + console.info(`FMS_acquireForm_2600 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "temporaryId": data.data, + "castForm": true, + "isCreate": false + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2600 featureAbility.startAbility again end`); + } + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onCastToNormal") { + console.info("====>FMS_acquireForm_2600 onSupplyCallBack====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_2600")); + formId2 = data.parameters.parameters; + + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, () => + publishCallback1("FMS_acquireForm_2600")); + } + } + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + commonEvent.subscribe(subscriberCast, onCastCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + + console.info(`FMS_acquireForm_2600 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": true, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_2600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_2600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_2600 featureAbility.startAbility end`); + }); + }); +} + +const sleep = async delay => { + return new Promise((resolve, _) => { + setTimeout(async () => { + resolve(0); + }, delay); + }); +}; + +const delPublishCallBack = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000); +} + +const unsubscribeOnErrorCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnErrorCallback====>`); +} + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`====>${tcNumber} unSubscribeOnAcquiredCallback====>`); +} + +const unsubscribeSupplyCallback = (tcNumber) => { + console.info(`====>${tcNumber} unSubscribeSupplyCallback====>`); +} + +const unsubscribeOnErrorCallBackCache = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnErrorCallBackCache CallBack====>`); +} + +const unsubscribeOnAcquiredCallBackCache = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnAcquiredCallBackCache CallBack====>`); +} + +const unsubscribeOnCastCallback = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnCastCallback====>`); +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/BUILD.gn new file mode 100644 index 000000000..2020ff3bc --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsFormAcquire2Test") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsFormAcquire2Test" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/Test.json new file mode 100644 index 000000000..fe5a5e3bb --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/Test.json @@ -0,0 +1,23 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formacquiretest2", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormAcquire2Test.hap", + "FormSystemHost.hap", + "FormSystemHostI.hap", + "FormSystemHostJ.hap", + "FormSystemHostNoPerm.hap", + "FormSupplyAppA.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json new file mode 100644 index 000000000..8c0153235 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json @@ -0,0 +1,141 @@ +{ + "app": { + "bundleName": "com.ohos.st.formacquiretest2", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formacquiretest2", + "name": ".FormAcquire2STApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormCast_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent", + "reason": "need use OnError commonEvent" + }, + { + "name": "FMS_FormCast_commonEvent", + "reason": "need use castFrom commonEvent" + }, + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..934996e93 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 40000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Main Ability Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets new file mode 100644 index 000000000..fb5be5b98 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets @@ -0,0 +1,501 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { beforeEach, describe, expect, it } from "deccjsunit/index"; + +var onErrorForm_Event = { + events: ["FMS_FormOnError_commonEvent"], +}; +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; +var subscriberFormCastEvent = { + events: ["FMS_FormCast_commonEvent"], +}; +var onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + +var subscriberOnError; +var subscriberOnAcquired; +var subscriberCast; +var subscriberSupply; + +export default function test() { + describe(`FmsAcquiredFormTest2`, () => { + + beforeEach(async () => { + subscriberOnError = await commonEvent.createSubscriber(onErrorForm_Event); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberCast = await commonEvent.createSubscriber(subscriberFormCastEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + }) + + /** + * @tc.number: FMS_acquireForm_3800 + * @tc.name: Failed to add form when parameter ability is wrong. + * @tc.desc: Failed to create form when verifying that the parameter (formId) of creating form is wrong. + */ + it(`FMS_acquireForm_3800`, 0, async (done) => { + console.info(`FMS_acquireForm_3800 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_3800 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_3800")); + console.info(`FMS_acquireForm_3800 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_3800 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_3800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_3800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_3800 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_acquireForm_3900 + * @tc.name: Failed to add form when parameter bundleName is wrong. + * @tc.desc: Failed to create form when verifying that the parameter (bundleName) of creating form is wrong. + */ + it(`FMS_acquireForm_3900`, 0, async (done) => { + console.info(`FMS_acquireForm_3900 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_3900 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_3900")); + console.info(`FMS_acquireForm_3900 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_3900 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_3900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_3900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_3900 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_acquireForm_4000 + * @tc.name: When the form specifications are inconsistent, creating the cached form fails. + * @tc.desc: Return failed. + */ + it(`FMS_acquireForm_4000`, 0, async (done) => { + console.info(`FMS_acquireForm_4000 start`); + var formId; + + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_4000 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_4000")); + expect(data.data).assertEqual("the form id and form config are not matched."); + + console.info(`FMS_acquireForm_4000 end`); + var commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_acquireForm_4000 publish' + JSON.stringify(err)); + }); + } + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_4000 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_4000")) + formId = data.data; + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + + console.info(`FMS_acquireForm_4000 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": data.data, + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "dimension": "2", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_4000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_4000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_4000 featureAbility.startAbility again end`); + } + function unSubscribeOnAcquiredCallback() { + console.info("====>FMS_acquireForm_4000 OnAcquired UnSubscribe CallBack====>"); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.info(`FMS_acquireForm_4000 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "dimension": "1", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_4000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_4000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_4000 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_acquireForm_4100 + * @tc.name: Failed to add form when parameter moduleName is wrong. + * @tc.desc: Failed to create form when verifying that the parameter (moduleName) of creating form is wrong. + */ + it(`FMS_acquireForm_4100`, 0, async (done) => { + console.info(`FMS_acquireForm_4100 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_4100 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + expect(data.data).assertEqual("invalid params received on operating form."); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_4100")); + console.info(`FMS_acquireForm_4100 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_4100 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostj", + abilityName: "com.ohos.st.formsystemhostj.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_4100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_4100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_4100 featureAbility.startAbility end`); + }); + + + /** + * @tc.number: FMS_acquireForm_4200 + * @tc.name: Success to add form when parameter formName is blank. + * @tc.desc: Success to create form when verifying that the parameter (formName) of creating form is success. + */ + it(`FMS_acquireForm_4200`, 0, async (done) => { + console.info(`FMS_acquireForm_4200 start`); + let formId1; + let formId2; + + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_4200 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_4200")) + formId1 = data.data; + + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack('FMS_acquireForm_4200', done)); + } + } + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onCreate") { + console.info("====>FMS_acquireForm_4200 onSupplyCallBack====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_acquireForm_4200")); + let retData = JSON.parse(data.parameters.parameters); + + let formName = retData.parameters['ohos.extra.param.key.form_name']; + expect(formName).assertEqual("Form_Js001"); + formId2 = retData.parameters['ohos.extra.param.key.form_identity']; + console.info("!!!====>FMS_acquireForm_4200 onAcquiredCallBack formId2:====>" + formId2); + if (formId1 && formId2) { + expect(formId1).assertEqual(formId2); + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack('FMS_acquireForm_4200', done)); + } + } + } + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.info(`FMS_acquireForm_4200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_4200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_4200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.info(`FMS_acquireForm_4200 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_acquireForm_4300 + * @tc.name: Success to add form when parameter dimension is passed. + * @tc.desc: Success to create form when verifying that the parameter (dimension) of creating form. + */ + it(`FMS_acquireForm_4300`, 0, async (done) => { + console.info(`FMS_acquireForm_4300 start`); + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_4300 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_4300")); + console.info(`FMS_acquireForm_4300 end`); + done(); + } + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.info(`FMS_acquireForm_4300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhosti", + abilityName: "com.ohos.st.formsystemhosti.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_4300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_4300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_4300 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_acquireForm_4400 + * @tc.name: Failed to add form when parameter dimension is not exist. + * @tc.desc: Failed to create form when verifying that the parameter (dimension) of creating form is wrong. + */ + it(`FMS_acquireForm_4400`, 0, async (done) => { + console.info(`FMS_acquireForm_4400 start`); + function onErrorCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_4400 onErrorCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); + commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_4400")); + expect(data.data).assertEqual("the dimension not exist in the form."); + console.info(`FMS_acquireForm_4400 end`); + done(); + } + commonEvent.subscribe(subscriberOnError, onErrorCallBack); + console.info(`FMS_acquireForm_4400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhosti", + abilityName: "com.ohos.st.formsystemhosti.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "dimension": "6", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_4400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_4400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_4400 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_acquireForm_4900 + * @tc.name: Cast temp form when the formId is created formId. + * @tc.desc: When the verification formId is set to 0, the form is created failed. + */ + it(`FMS_acquireForm_4900`, 0, async (done) => { + console.info(`FMS_acquireForm_4900 start`); + + function onCastCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_4900 onCastCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormCast_commonEvent"); + expect(data.data).assertEqual("9"); + commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_4900")) + var commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData,(err) => { + console.info('FMS_acquireForm_4900 publish' + JSON.stringify(err)); + }); + } + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_acquireForm_4900 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_acquireForm_4900")) + commonEvent.subscribe(subscriberCast, onCastCallBack); + + console.info(`FMS_acquireForm_4900 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "temporaryId": data.data, + "castForm": true, + "isCreate": false + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_4900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_4900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_4900 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.info(`FMS_acquireForm_4900 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhost", + abilityName: "com.ohos.st.formsystemhost.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicea.hmservice", + "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.info(`FMS_acquireForm_4900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`FMS_acquireForm_4900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`FMS_acquireForm_4900 featureAbility.startAbility end`); + }); + + }); +} + + +const delPublishCallBack = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000); +} + +const unsubscribeOnErrorCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnErrorCallback====>`); +} + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`====>${tcNumber} unSubscribeOnAcquiredCallback====>`); +} + +const unsubscribeSupplyCallback = (tcNumber) => { + console.info(`====>${tcNumber} unSubscribeSupplyCallback====>`); +} + +const unsubscribeOnCastCallback = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnCastCallback====>`); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..73f063346 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsAcquireForm2.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..3fd7831c6 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formacquiretest2" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formacquiretest2/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/Test.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/Test.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets new file mode 100644 index 000000000..09f8642cc --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets @@ -0,0 +1,1178 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import commonEvent from '@ohos.commonEvent'; +import systemTime from '@ohos.systemTime'; +import { beforeEach, describe, expect, it } from 'deccjsunit/index'; + +const onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; +const onDeletedFormEvent = { + events: ["FMS_FormOnDeleted_commonEvent"], +}; +const onReleasedFormEvent = { + events: ["FMS_FormOnReleased_commonEvent"], +}; +const onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +const deleteForm_Event = "FMS_FormDelete_commonEvent"; + +let subscriberOnAcquired; +let subscriberOnReleased; +let subscriberOnDeleted; +let subscriberSupply; + +export default function test() { + describe(`FmsDeleteFormTest`, () => { + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberOnReleased = await commonEvent.createSubscriber(onReleasedFormEvent); + subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + await sleep(1000); + }); + + /** + * @tc.number: FMS_deleteForm_0200 + * @tc.name: host does not have permission + * @tc.desc: 1.delete the form that formID is 1 + * 2.Verify the result is false + */ + it(`FMS_deleteForm_0200`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0200`; + let formId; + + const onDeletedCallback = async (_, data) => { + console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); + const commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_deleteForm_0200 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); + + const onAcquiredCallback = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + formId = data.data; + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostnoperm", + abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + deleteForm: true, + deleteId: formId, + isCreate: false + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_0300 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.delete the form + * 2.Verify the result is false + */ + it(`FMS_deleteForm_0300`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0300`; + + const onDeletedCallback = async (_, data) => { + console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); + const commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_deleteForm_0300 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + deleteForm: true, + deleteId: "-1", + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_0400 + * @tc.name: formID id is error(formID = 0) + * @tc.desc: 1.delete the form + * 2.Verify the result is false + */ + it(`FMS_deleteForm_0400`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0400`; + + const onDeletedCallback = async (_, data) => { + console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); + const commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_deleteForm_0400 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + deleteForm: true, + deleteId: "0", + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_0500 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.host A create a formA + * 2.host B delete the formA + * 2.Verify the result is false + */ + it(`FMS_deleteForm_0500`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0500`; + let formId; + + const onDeletedCallback = async (_, data) => { + console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); + const commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_deleteForm_0500 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); + + const onAcquiredCallback = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + formId = data.data; + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostd", + abilityName: "com.ohos.st.formsystemhostd.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + deleteForm: true, + deleteId: formId, + isCreate: false + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_0600 + * @tc.name: Delete a normal form and the form reference is not 0 after deletion + * @tc.desc: 1.host A create a normal formA + * 2.host B create a form with formA's ID + * 3.delete formA, and verify the result is true + */ + it(`FMS_deleteForm_0600`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0600`; + let formId; + let supplyFlag = false; + + async function delPublishCallback() { + console.info(`${tcNumber} delPublishCallback`); + await sleep(1000); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); + if (supplyFlag) { + deleteFormB(); + expect().assertFail(); + } else { + deleteFormB(); + } + console.info(`${tcNumber} delPublishCallback end`); + } + + async function delPublishCallbackB() { + console.info(`${tcNumber} delPublishCallbackB`); + await sleep(500); + console.info(`${tcNumber} delPublishCallbackB end`); + console.info(`${tcNumber} end`); + done(); + } + + function deleteFormB() { + console.info(`${tcNumber} deleteFormB start`); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostd", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); + console.info(`${tcNumber} deleteFormB end`); + } + + const onAcquiredCallbackB = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + expect(data.data).assertEqual(formId); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + }; + + const onAcquiredCallback = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + formId = data.data; + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + await sleep(1000); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostd", + abilityName: "com.ohos.st.formsystemhostd.MainAbility", + parameters: { + formId: formId, + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); + + const onSupplyCallback = async (_, data) => { + if (data.parameters.kind == "onDestroy") { + console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); + supplyFlag = true; + } + }; + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_0700 + * @tc.name: After deleting a normal form, the form reference is 0. + * After deleting a form, there are still created normal forms in FMS. + * @tc.desc: 1.host A an host B create one normal card respectively + * 2.host A delete the form and verify the result is true + */ + it(`FMS_deleteForm_0700`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0700`; + let formId; + let formIdB; + let supplyFlag = false; + + async function delPublishCallback() { + console.info(`${tcNumber} delPublishCallback`); + await sleep(1000); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); + if (supplyFlag) { + deleteFormB(); + } else { + deleteFormB(); + expect().assertFail(); + } + console.info(`${tcNumber} delPublishCallback end`); + } + + async function delPublishCallbackB() { + console.info(`${tcNumber} delPublishCallbackB`); + await sleep(1000); + console.info(`${tcNumber} delPublishCallbackB end`); + console.info(`${tcNumber} end`); + done(); + } + + function deleteFormB() { + console.info(`${tcNumber} deleteFormB start`); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostd", + data: formIdB + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); + console.info(`${tcNumber} deleteFormB end`); + } + + const onAcquiredCallbackB = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + formIdB = data.data; + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + }; + + const onAcquiredCallback = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + formId = data.data; + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + await sleep(1000); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostd", + abilityName: "com.ohos.st.formsystemhostd.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); + + const onSupplyCallback = async (_, data) => { + if (data.parameters.kind == "onDestroy") { + console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); + expect(data.parameters.parameters).assertEqual(formId); + supplyFlag = true; + } + }; + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_0700_1 + * @tc.name: After deleting a normal form, the form reference is 0. + * After deleting a form, there are still created normal forms in FMS. + * @tc.desc: 1.host A an host B create one normal card respectively + * 2.host A delete the form and verify the result is true + */ + it(`FMS_deleteForm_0700_1`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0700_1`; + let formId; + let formIdB; + let supplyFlag = false; + let supplyFlagUpdate = false; + + // timer speed up + commonEvent.publish(`fms.time_speed`, { code: 900 }, () => { + console.info(`${tcNumber} time speed up`); + }); + await changeTime(10, 29, 55); + + async function delPublishCallback() { + console.info(`${tcNumber} delPublishCallback`); + await sleep(5000); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); + if (supplyFlag && supplyFlagUpdate) { + deleteFormB(); + } else { + deleteFormB(); + expect().assertFail(); + } + console.info(`${tcNumber} delPublishCallback end`); + } + + async function delPublishCallbackB() { + console.info(`${tcNumber} delPublishCallbackB`); + await sleep(1000); + console.info(`${tcNumber} delPublishCallbackB end`); + console.info(`${tcNumber} end`); + done(); + } + + async function deleteFormB() { + console.info(`${tcNumber} deleteFormB start`); + // timer speed reset + commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { + console.info(`${tcNumber} time speed up`); + }); + await sleep(1000); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: formIdB + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); + console.info(`${tcNumber} deleteFormB end`); + } + + const onAcquiredCallbackB = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + formIdB = data.data; + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostd", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + }; + + const onAcquiredCallback = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + formId = data.data; + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + await sleep(1000); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); + + const onSupplyCallback = async (_, data) => { + if (data.parameters.kind == "onDestroy") { + console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); + expect(data.parameters.parameters).assertEqual(formId); + supplyFlag = true; + } + if (data.parameters.kind == "onUpdate") { + if (data.parameters.parameters == formId) { + expect().assertFail(); + } else if (data.parameters.parameters == formIdB) { + supplyFlagUpdate = true; + } + } + }; + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostd", + abilityName: "com.ohos.st.formsystemhostd.MainAbility", + parameters: { + formId: "0", + name: "Form_Js002", + bundle: "com.form.formsystemtestserviceb.hmservice", + ability: "com.form.formsystemtestserviceb.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_0700_2 + * @tc.name: After deleting a normal form, the form reference is 0. + * After deleting a form, there are still created normal forms in FMS. + * @tc.desc: 1.host A an host B create one normal card respectively + * 2.host A delete the form and verify the result is true + */ + it(`FMS_deleteForm_0700_2`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0700_2`; + let formId; + let formIdB; + let supplyFlag = false; + let supplyFlagUpdate = false; + + // timer speed up + commonEvent.publish(`fms.time_speed`, { code: 900 }, () => { + console.info(`${tcNumber} time speed up`); + }); + await changeTime(10, 29, 55); + async function delPublishCallback() { + console.info(`${tcNumber} delPublishCallback`); + await sleep(5000); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); + if (supplyFlag && supplyFlagUpdate) { + deleteFormB(); + } else { + deleteFormB(); + expect().assertFail(); + } + console.info(`${tcNumber} delPublishCallback end`); + } + + async function delPublishCallbackB() { + console.info(`${tcNumber} delPublishCallbackB`); + await sleep(1000); + console.info(`${tcNumber} delPublishCallbackB end`); + console.info(`${tcNumber} end`); + done(); + } + + async function deleteFormB() { + console.info(`${tcNumber} deleteFormB start`); + // timer speed reset + commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { + console.info(`${tcNumber} time speed up`); + }); + await sleep(1000); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostd", + data: formIdB + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); + console.info(`${tcNumber} deleteFormB end`); + } + + const onAcquiredCallbackB = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + formIdB = data.data; + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + }; + + const onAcquiredCallback = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + formId = data.data; + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + await sleep(1000); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostd", + abilityName: "com.ohos.st.formsystemhostd.MainAbility", + parameters: { + formId: "0", + name: "Form_Js002", + bundle: "com.form.formsystemtestserviceb.hmservice", + ability: "com.form.formsystemtestserviceb.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); + + const onSupplyCallback = async (_, data) => { + if (data.parameters.kind == "onDestroy") { + console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); + expect(data.parameters.parameters).assertEqual(formId); + supplyFlag = true; + } + if (data.parameters.kind == "onUpdate") { + if (data.parameters.parameters == formId) { + expect().assertFail(); + } else if (data.parameters.parameters == formIdB) { + supplyFlagUpdate = true; + } + } + }; + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_0900 + * @tc.name: Form ID error (FormID does not exist) + * @tc.desc: 1.host create one normal card + * 2.host delete the form + * 3.host delete the form again and verify the result is false + */ + it(`FMS_deleteForm_0900`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_0900`; + let formId; + + function onDeletedCallback2(_, data) { + console.info(`${tcNumber} onDeletedCallback2 data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); + expect(data.data != "0").assertEqual(true); + console.info(`${tcNumber} failed to delete form again.`); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_deleteForm_0900 publish' + JSON.stringify(err)); + }); + } + + const onDeletedCallback = async (_, data) => { + console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); + expect(data.data).assertEqual(`0`); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeOnDeletedCallback(tcNumber)); + formId = data.parameters.formId; + subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); + await sleep(1000); + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback2); + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + deleteForm: true, + deleteId: formId, + isCreate: false + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + deleteForm: true, + deleteId: "self", + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_1000 + * @tc.name: You can delete a card after releasing it + * @tc.desc: 1.host create one normal card + * 2.host release the form + * 3.host delete the form and verify the result is true + */ + it(`FMS_deleteForm_1000`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_1000`; + let formId; + + async function onReleasedCallback(_, data) { + console.info(`${tcNumber} onReleasedCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnReleased_commonEvent`); + expect(data.data).assertEqual(`0`); + commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback(tcNumber)); + formId = data.parameters.formId; + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + deleteForm: true, + deleteId: formId, + isCreate: false + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + } + commonEvent.subscribe(subscriberOnReleased, onReleasedCallback); + + const onSupplyCallback = async (_, data) => { + if (data.parameters.kind == "onDestroy") { + console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); + expect(data.parameters.parameters).assertEqual(formId); + await sleep(1000); + console.info(`${tcNumber}onDeletedCallback end`); + console.info(`${tcNumber} end`); + done(); + } + }; + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: false, + "releaseForm": true, + "releaseId": "self", + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_deleteForm_1100 + * @tc.name: When deleting a temporary form, cache data is deleted. + * @tc.desc: 1.host a and b create one temporary card respectively + * 2.host a delete the form and verify the result is true + */ + it(`FMS_deleteForm_1100`, 0, async (done) => { + const tcNumber = `FMS_deleteForm_1100`; + let formId; + let formIdB; + let supplyFlag = false; + + async function delPublishCallback() { + console.info(`${tcNumber} delPublishCallback`); + await sleep(1000); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); + if (supplyFlag) { + deleteFormB(); + } else { + deleteFormB(); + expect().assertFail(); + } + console.info(`${tcNumber} delPublishCallback end`); + } + + async function delPublishCallbackB() { + console.info(`${tcNumber} delPublishCallbackB`); + await sleep(1000); + console.info(`${tcNumber} delPublishCallbackB end`); + console.info(`${tcNumber} end`); + done(); + } + + function deleteFormB() { + console.info(`${tcNumber} deleteFormB start`); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostd", + data: formIdB + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); + console.info(`${tcNumber} deleteFormB end`); + } + + const onAcquiredCallbackB = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + formIdB = data.data; + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + }; + + const onAcquiredCallback = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + formId = data.data; + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + await sleep(1000); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostd", + abilityName: "com.ohos.st.formsystemhostd.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: true, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); + + const onSupplyCallback = async (_, data) => { + if (data.parameters.kind == "onDestroy") { + console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); + expect(data.parameters.parameters).assertEqual(formId); + supplyFlag = true; + } + }; + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.FormAbility", + moduleName: "entry", + temporary: true, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + }); +} + +/** + * Set time + * + * @param hour hour of 24H clock + * @param min minute + * @param second second + */ +const changeTime = async (hour, min, second) => { + console.info(`FMS_deleteForm changeTime start`); + const datetime = new Date(); + const year = datetime.getFullYear(); + const month = datetime.getMonth() + 1; + const day = datetime.getDate(); + const formatTime = year + '-' + fill(month) + '-' + fill(day) + + 'T' + fill(hour) + ':' + fill(min) + ':' + fill(second); + const s = (new Date(formatTime)).getTime(); + console.info(`FMS_deleteForm changeTime formatTime: ${formatTime}`); + console.info(`FMS_deleteForm changeTime s: ${s}`); + + try { + await systemTiem.setTime(s); + console.info(`FMS_deleteForm set time success: ${formatTime}`); + } catch (error) { + console.info(`FMS_deleteForm set time failure: ${error}`); + } + console.info(`FMS_deleteForm changeTime end`); +}; + +const fill = value => { + return (value > 9 ? "" : "0") + value; +}; + +const sleep = async delay => { + return new Promise((resolve, _) => { + setTimeout(async () => { + resolve(0); + }, delay); + }); +}; + +const delPublishCallback = async (tcNumber, done) => { + await sleep(1000); + console.info(`${tcNumber} delPublishCallback end`); + console.info(`${tcNumber} end`); + done(); +}; + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`${tcNumber} Unsubscribe OnAcquired Callback`); +}; + +const unsubscribeOnDeletedCallback = (tcNumber) => { + console.info(`${tcNumber} Unsubscribe OnDeleted Callback`); +}; + +const unsubscribeSupplyCallback = (tcNumber) => { + console.info(`${tcNumber} Unsubscribe Supply Callback`); +}; + +const unsubscribeOnReleasedCallback = (tcNumber) => { + console.info(`${tcNumber} Unsubscribe OnReleased Callback`); +}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdeletetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/Test.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/Test.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/app.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets new file mode 100644 index 000000000..22aaf1dd8 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets @@ -0,0 +1,448 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import commonEvent from '@ohos.commonEvent'; +import { beforeEach, describe, expect, it } from 'deccjsunit/index'; + +const onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; + +const onDeletedFormEvent = { + events: ["FMS_FormOnDeleted_commonEvent"], +}; + +const onRefreshFormEvent = { + events: ["FMS_FormDynamicRefresh_commonEvent"], +}; + +const onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +const deleteForm_Event = "FMS_FormDelete_commonEvent"; + +let subscriberOnAcquired; +let subscriberOnDeleted; +let subscriberOnRefresh; +let subscriberSupply; + +export default function test() { + describe(`FmsTimeRefreshFormTest`, () => { + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); + subscriberOnRefresh = await commonEvent.createSubscriber(onRefreshFormEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + await sleep(1000); + }); + + /** + * @tc.number: FMS_timedRefresh_0100 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. + * 2.Verify the result of the dynamic timed refresh interface. + */ + it(`FMS_timedRefresh_0100`, 0, async (done) => { + const tcNumber = `FMS_timedRefresh_0100`; + + const onRefreshCallback = async (_, data) => { + console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); + expect(data.data).assertEqual(`7`); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); + const commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_timedRefresh_0100 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.MainAbility", + moduleName: "entry", + temporary: false, + refreshForm: true, + refreshId: "-1", + refreshTime: 5, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_timedRefresh_0200 + * @tc.name: formID id is error(formID == 0) + * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. + * 2.Verify the result of the dynamic timed refresh interface. + */ + it(`FMS_timedRefresh_0200`, 0, async (done) => { + const tcNumber = `FMS_timedRefresh_0200`; + + const onRefreshCallback = async (_, data) => { + console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); + expect(data.data).assertEqual(`7`); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); + const commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_timedRefresh_0200 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.MainAbility", + moduleName: "entry", + temporary: false, + refreshForm: true, + refreshId: "0", + refreshTime: 5, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_timedRefresh_0300 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.The form provider B to invoke the dynamic timed refresh interface. + * 2.Verify the result of the dynamic timed refresh interface. + */ + it(`FMS_timedRefresh_0300`, 0, async (done) => { + const tcNumber = `FMS_timedRefresh_0300`; + let formId; + + const onRefreshCallback = async (_, data) => { + console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); + expect(data.data).assertEqual(`13`); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); + const commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_timedRefresh_0300 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); + + const onAcquiredCallback = async (_, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); + formId = data.data; + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.MainAbility", + moduleName: "entry", + temporary: false, + refreshForm: true, + refreshId: formId, + refreshTime: 5, + isCreate: false + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.MainAbility", + moduleName: "entry", + temporary: false, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_timedRefresh_0400 + * @tc.name: Form ID error (FormID does not exist) + * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. + * 2.Verify the result of the dynamic timed refresh interface. + */ + it(`FMS_timedRefresh_0400`, 0, async (done) => { + const tcNumber = `FMS_timedRefresh_0400`; + let formId; + + const onRefreshCallback = async (_, data) => { + console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); + expect(data.data).assertEqual(`9`); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); + const commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_timedRefresh_0400 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); + + const onDeletedCallback = async (_, data) => { + console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormOnDeleted_commonEvent`); + expect(data.data).assertEqual(`0`); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeDeletedCallback(tcNumber)); + formId = data.parameters.formId; + + console.info(`${tcNumber} featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.MainAbility", + moduleName: "entry", + temporary: false, + refreshForm: true, + refreshId: formId, + refreshTime: 5, + isCreate: false + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility again end`); + }; + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.MainAbility", + moduleName: "entry", + temporary: false, + deleteForm: true, + "deleteId": "self", + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_timedRefresh_0500 + * @tc.name: Incorrect interval for the next refresh (time < 5) + * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. + * 2.Verify the result of the dynamic timed refresh interface. + */ + it(`FMS_timedRefresh_0500`, 0, async (done) => { + const tcNumber = `FMS_timedRefresh_0500`; + + const onRefreshCallback = async (_, data) => { + console.info(`${tcNumber} onRefreshCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormDynamicRefresh_commonEvent`); + expect(data.data).assertEqual(`7`); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback(tcNumber)); + const commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_timedRefresh_0500 publish' + JSON.stringify(err)); + }); + }; + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicea.hmservice", + ability: "com.form.formsystemtestservicea.hmservice.MainAbility", + moduleName: "entry", + temporary: false, + refreshForm: true, + refreshId: "self", + refreshTime: 1, + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_timedRefresh_0600 + * @tc.name: correct interval for the next refresh (time == 5) + * @tc.desc: 1.The form provider A to invoke the dynamic timed refresh interface. + * 2.Verify the result of the dynamic timed refresh interface. + */ + it(`FMS_timedRefresh_0600`, 0, async (done) => { + const tcNumber = `FMS_timedRefresh_0600`; + + const onSupplyCallback = async (_, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}`); + expect(data.event).assertEqual(`FMS_FormSupply_commonEvent`); + if (data.parameters.kind == "onVisibilityChange") { + console.info(`${tcNumber} onSupplyCallback kind: data.parameters.kind`); + console.info(`${tcNumber} onSupplyCallback error: data.parameters.errorData`); + expect(data.parameters.errorData).assertEqual(`0`); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); + const commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_timedRefresh_0600 publish' + JSON.stringify(err)); + }); + } + }; + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + + console.info(`${tcNumber} featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + formId: "0", + name: "Form_Js001", + bundle: "com.form.formsystemtestservicec.hmservice", + ability: "com.form.formsystemtestservicec.hmservice.MainAbility", + moduleName: "entry", + temporary: false, + "notifyVisibleForms": true, + "notifyVisibleId": "self", + isCreate: true + } + } + }).then((res: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.info(`${tcNumber} featureAbility.startAbility end`); + }); + }); +} + +const sleep = async delay => { + return new Promise((resolve, _) => { + setTimeout(async () => { + resolve(0); + }, delay); + }); +}; + +const delPublishCallback = async (tcNumber, done) => { + await sleep(1000); + console.info(`${tcNumber} delPublishCallback end`); + console.info(`${tcNumber} end`); + done(); +}; + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`${tcNumber} Unsubscribe OnAcquired Callback`); +}; + +const unsubscribeDeletedCallback = (tcNumber) => { + console.info(`${tcNumber} Unsubscribe Deleted Callback`); +}; + +const unsubscribeSupplyCallback = (tcNumber) => { + console.info(`${tcNumber} Unsubscribe Supply Callback`); +}; + +const unsubscribeOnRefreshCallback = (tcNumber) => { + console.info(`${tcNumber} Unsubscribe OnRefresh Callback`); +}; diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/Test.json new file mode 100644 index 000000000..328474591 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "600000", + "package": "com.ohos.st.formfuzztest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormFuzzTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..d57112382 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('Application onCreate'); + }, + onDestroy() { + console.info('Application onDestroy'); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..a531fcd34 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + private componentName: string = `FormSystemFuzzTest`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`${this.componentName}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/CastTempFormFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/CastTempFormFuzz.test.ets new file mode 100644 index 000000000..b997fc8dd --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/CastTempFormFuzz.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const castTempFormFuzzTest = (describeName, filterParameter) => { + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_casttempform`; + const promiseName = `FMS_fuzzTest_casttempform`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_casttempform_0100 ~ FMS_fuzzTest_casttempform_0800 + * @tc.desc Check whether the castTempForm interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + try { + formHost.castTempForm(formId, (error, data) => { + console.log(`${callbackName} ${tcNumber} castTempForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_casttempform_0900 ~ FMS_fuzzTest_casttempform_1600 + * @tc.desc Check whether the castTempForm interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); + try { + const data = await formHost.castTempForm(formId); + console.log(`${promiseName} ${tcNumber} castTempForm data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DeleteFormFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DeleteFormFuzz.test.ets new file mode 100644 index 000000000..7fba18a42 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DeleteFormFuzz.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const deleteFormFuzzTest = (describeName, filterParameter) => { + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_deleteform`; + const promiseName = `FMS_fuzzTest_deleteform`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_deleteform_0100 ~ FMS_fuzzTest_deleteform_0800 + * @tc.desc Check whether the deleteForm interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + try { + formHost.deleteForm(formId, (error, data) => { + console.log(`${callbackName} ${tcNumber} deleteForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_deleteform_0900 ~ FMS_fuzzTest_deleteform_1600 + * @tc.desc Check whether the deleteForm interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); + try { + const data = await formHost.deleteForm(formId); + console.log(`${promiseName} ${tcNumber} deleteForm data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DisableFormsUpdateFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DisableFormsUpdateFuzz.test.ets new file mode 100644 index 000000000..ad04207a5 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/DisableFormsUpdateFuzz.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const disableFormsUpdateFuzzTest = (describeName, filterParameter) => { + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_disable`; + const promiseName = `FMS_fuzzTest_disable`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_disable_0100 ~ FMS_fuzzTest_disable_0800 + * @tc.desc Check whether the disableFormsUpdate interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formIds = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`); + try { + formHost.disableFormsUpdate(formIds, (error, data) => { + console.log(`${callbackName} ${tcNumber} disableFormsUpdate data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_disable_0900 ~ FMS_fuzzTest_disable_1600 + * @tc.desc Check whether the disableFormsUpdate interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formIds = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`); + try { + const data = await formHost.disableFormsUpdate(formIds); + console.log(`${promiseName} ${tcNumber} disableFormsUpdate data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/EnableFormsUpdateFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/EnableFormsUpdateFuzz.test.ets new file mode 100644 index 000000000..d70f2d1cf --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/EnableFormsUpdateFuzz.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const enableFormsUpdateFuzzTest = (describeName, filterParameter) => { + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_enable`; + const promiseName = `FMS_fuzzTest_enable`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_enable_0100 ~ FMS_fuzzTest_enable_0800 + * @tc.desc Check whether the enableFormsUpdate interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formIds = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`); + try { + formHost.enableFormsUpdate(formIds, (error, data) => { + console.log(`${callbackName} ${tcNumber} enableFormsUpdate data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_enable_0900 ~ FMS_fuzzTest_enable_1600 + * @tc.desc Check whether the enableFormsUpdate interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formIds = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`); + try { + const data = await formHost.enableFormsUpdate(formIds); + console.log(`${promiseName} ${tcNumber} enableFormsUpdate data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/GetFormsInfoFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/GetFormsInfoFuzz.test.ets new file mode 100644 index 000000000..e6b305b35 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/GetFormsInfoFuzz.test.ets @@ -0,0 +1,233 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const getFormsInfoFuzzTest = (describeName, filterParameter) => { + const ERR_GET_BUNDLE_FAILED_CODE = 5; + const ERR_GET_BUNDLE_FAILED = `failed to obtain the bundle information`; + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_getinfobundle`; + const promiseName = `FMS_fuzzTest_getinfobundle`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_getinfobundle_0100 ~ FMS_fuzzTest_getinfobundle_0800 + * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const bundleName = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`); + try { + formHost.getFormsInfo(bundleName, (error, data) => { + console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + if (`STRING` === dataType) { + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + } else { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_getinfobundle_0900 ~ FMS_fuzzTest_getinfobundle_1600 + * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const bundleName = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`); + try { + const data = await formHost.getFormsInfo(bundleName); + console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + if (`STRING` === dataType) { + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + } else { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } + done(); + } + }); + } + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_getinfomodule`; + const promiseName = `FMS_fuzzTest_getinfomodule`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_getinfomodule_0100 ~ FMS_fuzzTest_getinfomodule_0800 + * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const bundleName = getFuzzData(dataType); + const moduleName = `com.test.module_name_${tcNumber}`; + console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`); + console.log(`${callbackName} ${tcNumber} moduleName typeof: ${typeof moduleName}`); + try { + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + if (`STRING` === dataType) { + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + } else { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_getinfomodule_0900 ~ FMS_fuzzTest_getinfomodule_1600 + * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const bundleName = getFuzzData(dataType); + const moduleName = `com.test.module_name_${tcNumber}`; + console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`); + console.log(`${promiseName} ${tcNumber} ${describeName} moduleName typeof: ${typeof moduleName}`); + try { + const data = await formHost.getFormsInfo(bundleName, moduleName); + console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + if (`STRING` === dataType) { + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + } else { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } + done(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 2) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_getinfomodule_1700 ~ FMS_fuzzTest_getinfomodule_2400 + * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const bundleName = `com.test.bundle_name_${tcNumber}`; + const moduleName = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`); + console.log(`${callbackName} ${tcNumber} moduleName typeof: ${typeof moduleName}`); + try { + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + if (`STRING` === dataType) { + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + } else { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 3) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_getinfomodule_2500 ~ FMS_fuzzTest_getinfomodule_3200 + * @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const bundleName = `com.test.bundle_name_${tcNumber}`; + const moduleName = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`); + console.log(`${promiseName} ${tcNumber} ${describeName} moduleName typeof: ${typeof moduleName}`); + try { + const data = await formHost.getFormsInfo(bundleName, moduleName); + console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + if (`STRING` === dataType) { + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + } else { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } + done(); + } + }); + } + }) +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..fe031251d --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { castTempFormFuzzTest } from './CastTempFormFuzz.test.ets'; +import { deleteFormFuzzTest } from './DeleteFormFuzz.test.ets'; +import { disableFormsUpdateFuzzTest } from './DisableFormsUpdateFuzz.test.ets'; +import { enableFormsUpdateFuzzTest } from './EnableFormsUpdateFuzz.test.ets'; +import { getFormsInfoFuzzTest } from './GetFormsInfoFuzz.test.ets'; +import { notifyInvisibleFormsFuzzTest } from './NotifyInvisibleFormsFuzz.test.ets'; +import { notifyVisibleFormsFuzzTest } from './NotifyVisibleFormsFuzz.test.ets'; +import { releaseFormFuzzTest } from './ReleaseFormFuzz.test.ets'; +import { requestFormFuzzTest } from './RequestFormFuzz.test.ets'; +import { setFormNextRefreshTimeFuzzTest } from './SetFormNextRefreshTimeFuzz.test.ets'; +import { updateFormFuzzTest } from './UpdateFormFuzz.test.ets'; + +export default function testsuite() { + // FMS_fuzzTest_deleteform + deleteFormFuzzTest(`DeleteFormFuzzTest`, 0); + + // FMS_fuzzTest_releaseform + releaseFormFuzzTest(`ReleaseFormFuzzTest`, 0); + + // FMS_fuzzTest_casttempform + castTempFormFuzzTest(`CastTempFormFuzzTest`, 0); + + // FMS_fuzzTest_invisible + notifyVisibleFormsFuzzTest(`NotifyVisibleFormsFuzzTest`, 0); + + // FMS_fuzzTest_visible + notifyInvisibleFormsFuzzTest(`NotifyInvisibleFormsFuzzTest`, 0); + + // FMS_fuzzTest_requestform + requestFormFuzzTest(`RequestFormFuzzTest`, 0); + + // FMS_fuzzTest_updateform + updateFormFuzzTest(`UpdateFormFuzzTest`, 0); + + // FMS_fuzzTest_setnexttime + setFormNextRefreshTimeFuzzTest(`SetFormNextRefreshTimeFuzzTest`, 0); + + // FMS_fuzzTest_enable + enableFormsUpdateFuzzTest(`EnableFormsUpdateFuzzTest`, 0); + + // FMS_fuzzTest_disable + disableFormsUpdateFuzzTest(`DisableFormsUpdateFuzzTest`, 0); + + // FMS_fuzzTest_getinfobundle + // FMS_fuzzTest_getinfomodule + getFormsInfoFuzzTest(`GetFormsInfoFuzzTest`, 0); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyInvisibleFormsFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyInvisibleFormsFuzz.test.ets new file mode 100644 index 000000000..226974fb4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyInvisibleFormsFuzz.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const notifyInvisibleFormsFuzzTest = (describeName, filterParameter) => { + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_invisible`; + const promiseName = `FMS_fuzzTest_invisible`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_invisible_0100 ~ FMS_fuzzTest_invisible_0800 + * @tc.desc Check whether the notifyInvisibleForms interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formIds = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`); + try { + formHost.notifyInvisibleForms(formIds, (error, data) => { + console.log(`${callbackName} ${tcNumber} notifyInvisibleForms data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_invisible_0900 ~ FMS_fuzzTest_invisible_1600 + * @tc.desc Check whether the notifyInvisibleForms interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formIds = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`); + try { + const data = await formHost.notifyInvisibleForms(formIds); + console.log(`${promiseName} ${tcNumber} notifyInvisibleForms data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyVisibleFormsFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyVisibleFormsFuzz.test.ets new file mode 100644 index 000000000..d16eb88f4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/NotifyVisibleFormsFuzz.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const notifyVisibleFormsFuzzTest = (describeName, filterParameter) => { + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_visible`; + const promiseName = `FMS_fuzzTest_visible`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_visible_0100 ~ FMS_fuzzTest_visible_0800 + * @tc.desc Check whether the notifyVisibleForms interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formIds = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`); + try { + formHost.notifyVisibleForms(formIds, (error, data) => { + console.log(`${callbackName} ${tcNumber} notifyVisibleForms data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_visible_0900 ~ FMS_fuzzTest_visible_1600 + * @tc.desc Check whether the notifyVisibleForms interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formIds = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`); + try { + const data = await formHost.notifyVisibleForms(formIds); + console.log(`${promiseName} ${tcNumber} notifyVisibleForms data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/ReleaseFormFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/ReleaseFormFuzz.test.ets new file mode 100644 index 000000000..1b2fc1b20 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/ReleaseFormFuzz.test.ets @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const releaseFormFuzzTest = (describeName, filterParameter) => { + const ERR_COMMON_CODE = 1; + const ERR_COMMON = `internal error`; + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + const ERR_NOT_EXIST_ID_CODE = 9; + const ERR_NOT_EXIST_ID = `the ID of the form to be operated does not exist`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_releaseform`; + const promiseName = `FMS_fuzzTest_releaseform`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_releaseform_0100 ~ FMS_fuzzTest_releaseform_0800 + * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + try { + formHost.releaseForm(formId, (error, data) => { + console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_releaseform_0900 ~ FMS_fuzzTest_releaseform_1600 + * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); + try { + const data = await formHost.releaseForm(formId); + console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + if (`STRING` === dataType) { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } else { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } + done(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 2) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_releaseform_1700 ~ FMS_fuzzTest_releaseform_2400 + * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + const isReleaseCache = true; + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${callbackName} ${tcNumber} isReleaseCache typeof: ${typeof isReleaseCache}`); + try { + formHost.releaseForm(formId, isReleaseCache, (error, data) => { + console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 3) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_releaseform_2500 ~ FMS_fuzzTest_releaseform_3200 + * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + const isReleaseCache = true; + console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); + console.log(`${promiseName} ${tcNumber} ${describeName} isReleaseCache typeof: ${typeof isReleaseCache}`); + try { + const data = await formHost.releaseForm(formId, isReleaseCache); + console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + if (`STRING` === dataType) { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } else { + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } + done(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 4) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_releaseform_3300 ~ FMS_fuzzTest_releaseform_4000 + * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = `${tcNumber}`; + const isReleaseCache = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${callbackName} ${tcNumber} isReleaseCache typeof: ${typeof isReleaseCache}`); + try { + formHost.releaseForm(formId, isReleaseCache, (error, data) => { + console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + if (`BOOLEAN` === dataType) { + expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE); + expect(error.message).assertEqual(ERR_NOT_EXIST_ID); + } else { + expect(error.code).assertEqual(ERR_COMMON_CODE); + expect(error.message).assertEqual(ERR_COMMON); + } + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 5) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_releaseform_4100 ~ FMS_fuzzTest_releaseform_4800 + * @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = `${tcNumber}`; + const isReleaseCache = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); + console.log(`${promiseName} ${tcNumber} ${describeName} isReleaseCache typeof: ${typeof isReleaseCache}`); + try { + const data = await formHost.releaseForm(formId, isReleaseCache); + console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + if (`BOOLEAN` === dataType) { + expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE); + expect(error.message).assertEqual(ERR_NOT_EXIST_ID); + } else { + expect(error.code).assertEqual(ERR_COMMON_CODE); + expect(error.message).assertEqual(ERR_COMMON); + } + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/RequestFormFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/RequestFormFuzz.test.ets new file mode 100644 index 000000000..de9d3457e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/RequestFormFuzz.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const requestFormFuzzTest = (describeName, filterParameter) => { + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_requestform`; + const promiseName = `FMS_fuzzTest_requestform`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_requestform_0100 ~ FMS_fuzzTest_requestform_0800 + * @tc.desc Check whether the requestForm interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + try { + formHost.requestForm(formId, (error, data) => { + console.log(`${callbackName} ${tcNumber} requestForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_requestform_0900 ~ FMS_fuzzTest_requestform_1600 + * @tc.desc Check whether the requestForm interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`); + try { + const data = await formHost.requestForm(formId); + console.log(`${promiseName} ${tcNumber} requestForm data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/SetFormNextRefreshTimeFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/SetFormNextRefreshTimeFuzz.test.ets new file mode 100644 index 000000000..548ec7b57 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/SetFormNextRefreshTimeFuzz.test.ets @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formProvider from '@ohos.application.formProvider'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const setFormNextRefreshTimeFuzzTest = (describeName, filterParameter) => { + const ERR_COMMON_CODE = 1; + const ERR_COMMON = `internal error`; + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + const ERR_NOT_EXIST_ID_CODE = 9; + const ERR_NOT_EXIST_ID = `the ID of the form to be operated does not exist`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_setnexttime`; + const promiseName = `FMS_fuzzTest_setnexttime`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_setnexttime_0100 ~ FMS_fuzzTest_setnexttime_0800 + * @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + const nextTime = 5; + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${callbackName} ${tcNumber} nextTime typeof: ${typeof nextTime}`); + try { + formProvider.setFormNextRefreshTime(formId, nextTime, (error, data) => { + console.log(`${callbackName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_setnexttime_0900 ~ FMS_fuzzTest_setnexttime_1600 + * @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + const nextTime = 5; + console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${promiseName} ${tcNumber} nextTime typeof: ${typeof nextTime}`); + try { + const data = await formProvider.setFormNextRefreshTime(formId, nextTime); + console.log(`${promiseName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 2) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_setnexttime_1700 ~ FMS_fuzzTest_setnexttime_2400 + * @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = `${tcNumber}`; + const nextTime = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${callbackName} ${tcNumber} nextTime typeof: ${typeof nextTime}`); + try { + formProvider.setFormNextRefreshTime(formId, nextTime, (error, data) => { + console.log(`${callbackName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + if (`NUMBER` === dataType) { + if (ERR_NOT_EXIST_ID_CODE === error.code) { + expect(error.message).assertEqual(ERR_NOT_EXIST_ID); + } else if (ERR_ADD_INVALID_PARAM_CODE === error.code) { + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } else { + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + } else { + expect(error.code).assertEqual(ERR_COMMON_CODE); + expect(error.message).assertEqual(ERR_COMMON); + } + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 3) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_setnexttime_2500 ~ FMS_fuzzTest_setnexttime_3200 + * @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = `${tcNumber}`; + const nextTime = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${promiseName} ${tcNumber} nextTime typeof: ${typeof nextTime}`); + try { + const data = await formProvider.setFormNextRefreshTime(formId, nextTime); + console.log(`${promiseName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + if (`NUMBER` === dataType) { + if (ERR_NOT_EXIST_ID_CODE === error.code) { + expect(error.message).assertEqual(ERR_NOT_EXIST_ID); + } else if (ERR_ADD_INVALID_PARAM_CODE === error.code) { + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + } else { + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + } else { + expect(error.code).assertEqual(ERR_COMMON_CODE); + expect(error.message).assertEqual(ERR_COMMON); + } + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/UpdateFormFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/UpdateFormFuzz.test.ets new file mode 100644 index 000000000..33faff563 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/UpdateFormFuzz.test.ets @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formProvider from '@ohos.application.formProvider'; +import { describe, expect, it } from 'deccjsunit/index'; +import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets'; + +export const updateFormFuzzTest = (describeName, filterParameter) => { + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_fuzzTest_updateform`; + const promiseName = `FMS_fuzzTest_updateform`; + const length = DATA_TYPE_LIST.length; + + for (let i = 0; i < length; ++i) { + const tcNumber = `0${(i + 1) * 100}`; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_updateform_0100 ~ FMS_fuzzTest_updateform_0800 + * @tc.desc Check whether the updateForm interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + let formBindingData = null; + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${callbackName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`); + try { + formProvider.updateForm(formId, formBindingData, (error, data) => { + console.log(`${callbackName} ${tcNumber} updateForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + let tcNumber: any = (i + 1 + length) * 100; + tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_updateform_0900 ~ FMS_fuzzTest_updateform_1600 + * @tc.desc Check whether the updateForm interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = getFuzzData(dataType); + let formBindingData = null; + console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${promiseName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`); + try { + const data = await formProvider.updateForm(formId, formBindingData); + console.log(`${promiseName} ${tcNumber} updateForm data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 2) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_updateform_1700 ~ FMS_fuzzTest_updateform_2400 + * @tc.desc Check whether the updateForm interface can pass the fuzzy test (by AsyncCallback) + */ + it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = `${tcNumber}`; + const formBindingData = getFuzzData(dataType); + console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${callbackName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`); + try { + formProvider.updateForm(formId, formBindingData, (error, data) => { + console.log(`${callbackName} ${tcNumber} updateForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(data).assertUndefined(); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + }); + } catch (error) { + console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + console.log(`${callbackName} ${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + } + + for (let i = 0; i < length; ++i) { + const tcNumber: any = (i + 1 + length * 3) * 100; + /** + * @tc.name fuzzTest + * @tc.number FMS_fuzzTest_updateform_2500 ~ FMS_fuzzTest_updateform_3200 + * @tc.desc Check whether the updateForm interface can pass the fuzzy test (by Promise) + */ + it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => { + const dataType = DATA_TYPE_LIST[i]; + const formId = `${tcNumber}`; + const formBindingData = getFuzzData(dataType); + console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`); + console.log(`${promiseName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`); + try { + const data = await formProvider.updateForm(formId, formBindingData); + console.log(`${promiseName} ${tcNumber} updateForm data: ${JSON.stringify(data)}`); + console.log(`${promiseName} ${tcNumber} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + } + }); + } + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/getParam.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/getParam.ets new file mode 100644 index 000000000..29c726720 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/MainAbility/test/getParam.ets @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const REPEAT_COUNT = 2; + +export const DATA_TYPE_LIST = ['ARRAY', 'NUMBER', 'BOOLEAN', 'FUNCTION', 'STRING', 'OBJECT', 'NULL', 'UNDEFINED']; + +var RANDOM_BEGIN_POSITION = 0; +var RANDOM_BEGIN_POSITION_A = 2; +var STRING_RANDOM_LENGTH = 2064; +var BOOLEAN_RANDOM_LENGTH = 2; +var ARRAY_RANDOM_LENGTH = 10; +var ARRAY_RANDOM_TYPE_LENGTH = 3; +var OBJECT_RANDOM_LENGTH = 2; +var FUNCTION_RANDOM_LENGTH = 2; + +//string ascii +var STRING_RANDOM_LENGTH_A = 48; +var STRING_RANDOM_LENGTH_B = 58; +var STRING_RANDOM_LENGTH_C = 65; +var STRING_RANDOM_LENGTH_D = 91; +var STRING_RANDOM_LENGTH_E = 97; +var STRING_RANDOM_LENGTH_F = 122; + +// Return integer random, the range is: [iStart, iEnd) +function getIntegerRandom(iStart, iEnd) { + var decimal = iStart + (iEnd - iStart) * Math.random(); + return Math.floor(decimal); +} + +// return string random, the string length is: [0, 2064) +const stringTest = function () { + // string + var res = ''; + + // string length + var iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, STRING_RANDOM_LENGTH); + for (var iAsciiToChar = RANDOM_BEGIN_POSITION; iAsciiToChar < iNumber; iAsciiToChar++) { + var iNumberString = getIntegerRandom(RANDOM_BEGIN_POSITION, RANDOM_BEGIN_POSITION_A); + + switch (iNumberString) { + case 0: + // get ascii [0-9] + iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_A, STRING_RANDOM_LENGTH_B); + break; + case 1: + // get ascii [A-Z] + iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_C, STRING_RANDOM_LENGTH_D); + break; + case 2: + default: + // get ascii [a-z] + iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_E, STRING_RANDOM_LENGTH_F); + break; + } + // from ascii to char + var asciiToChar = String.fromCharCode(iNumber); + res += asciiToChar; + } + console.log('The stringTest of this fuzzTest random:' + res); + return res; +}; + +// return number random, the number length is: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER] +const numberTest = function () { + const res = getIntegerRandom(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER + 1); + console.log('The numberTest of this fuzzTest random:' + res); + return res; +}; + +// return boolean random, the boolean value is: 0->(false), 1->(true) +const booleanTest = function () { + console.log('The booleanTest of this fuzzTest random'); + return Boolean(getIntegerRandom(RANDOM_BEGIN_POSITION, BOOLEAN_RANDOM_LENGTH)); +}; + +// null +const nullTest = function () { + console.log('The nullTest of this fuzzTest random'); + return null; +}; + +// undefined +const undefinedTest = function () { + console.log('The undefinedTest of this fuzzTest random'); + return undefined; +}; + +// return array random, the array value is: string,number,bool +const arrayTest = function () { + var arrValue = []; + + // array length + var iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, ARRAY_RANDOM_LENGTH); + for (var iArrNumber = 0; iArrNumber < iNumber; iArrNumber++) { + // string,number,bool + iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, ARRAY_RANDOM_TYPE_LENGTH); + switch (iNumber) { + case 0: + arrValue[iArrNumber] = stringTest(); + break; + case 1: + arrValue[iArrNumber] = numberTest(); + break; + case 2: + arrValue[iArrNumber] = booleanTest(); + break; + default: + arrValue[iArrNumber] = ''; + } + } + console.log('The arrayTest of this fuzzTest random:' + arrValue); + return arrValue; +}; + +// return objectTest random, the objectTest value is: null, not null +const objectTest = function () { + var objectA = {}; + var objectb = { id: 'objectTest' }; + var objectB = Object.create(objectb); + + console.log('The objectTest of this fuzzTest random'); + return getIntegerRandom(RANDOM_BEGIN_POSITION, OBJECT_RANDOM_LENGTH) ? objectA : objectB; +}; + +// return functionTest random, the functionTest value is: null, not null +const functionTest = function () { + var functionA = {}; + var functionB = { id: 'functionTest' }; + + console.log('The functionTest of this fuzzTest random'); + return getIntegerRandom(RANDOM_BEGIN_POSITION, FUNCTION_RANDOM_LENGTH) ? functionA : functionB; +}; + +// return fuzz data +const getFuzzData = (datatype: string) => { + switch (datatype) { + case 'ARRAY': + return arrayTest(); + case 'BOOLEAN': + return booleanTest(); + case 'FUNCTION': + return functionTest(); + case 'NULL': + return nullTest(); + case 'NUMBER': + return numberTest(); + case 'OBJECT': + return objectTest(); + case 'STRING': + return stringTest(); + case 'UNDEFINED': + return undefinedTest(); + default: + return stringTest(); + } +}; + +export { getFuzzData, stringTest, numberTest, booleanTest, nullTest, undefinedTest, objectTest, arrayTest, functionTest }; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formfuzztest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/Test.json new file mode 100644 index 000000000..d3a25ebfc --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/Test.json @@ -0,0 +1,20 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formsoneandonetest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormsOneAndOneTest.hap", + "FormSystemProviderB.hap", + "FormSystemProviderC.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json new file mode 100644 index 000000000..ffdbd0ae1 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json @@ -0,0 +1,114 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsoneandonetest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsoneandonetest", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..d57112382 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('Application onCreate'); + }, + onDestroy() { + console.info('Application onDestroy'); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..a39d5ea04 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; +import testsuite from '../test/List.test.ets'; + +@Entry +@Component +struct Index { + private componentName: string = `FormsOneAndOneTest`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`${this.componentName}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets new file mode 100644 index 000000000..07139019e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; + +export const getAllFormsInfoTest = (describeName, filterParameter) => { + const ERR_OK_CODE = 0; + const ERR_OK = `success`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_0500 callback`; + const promiseName = `FMS_getFormsInfo_0500 promise`; + + const expectDataB = { + bundleName: 'com.ohos.st.formsystemproviderb', + moduleName: 'form_module_b', + abilityName: 'com.ohos.st.formsystemproviderb.MainAbility', + name: 'FormB_Js001', + description: 'form_description_FormB_Js001', + descriptionId: 20, + type: 1, + jsComponentName: 'card_b', + colorMode: -1, + isDefault: 1, + updateEnabled: 1, + formVisibleNotify: 1, + formConfigAbility: 'abilityb', + updateDuration: 3, + scheduledUpdateTime: '10:30', + defaultDimension: 2, + supportDimensions: [1, 2], + metaData: { customizeData: [{ name: 'originWidgetNameB', value: 'valueB' }] }, + }; + + const expectDataC = { + bundleName: 'com.ohos.st.formsystemproviderc', + moduleName: 'form_module_c', + abilityName: 'com.ohos.st.formsystemproviderc.MainAbility', + name: 'FormC_Js001', + description: 'form_description_FormC_Js001', + descriptionId: 30, + type: 1, + jsComponentName: 'card_c', + colorMode: 1, + isDefault: 1, + updateEnabled: 1, + formVisibleNotify: 1, + formConfigAbility: 'abilityc', + updateDuration: 4, + scheduledUpdateTime: '15:30', + defaultDimension: 3, + supportDimensions: [3, 4], + metaData: { customizeData: [{ name: 'originWidgetNameC', value: 'valueC' }] }, + }; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_0500 + * @tc.desc: Query all form configuration information (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getAllFormsInfo((error, data) => { + console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + console.log(`${callbackName} forms amount: ${data.length}`); + + const dataB = data.filter((form) => { + return `com.ohos.st.formsystemproviderb` === form.bundleName; + }); + console.log(`${callbackName} form dataB: ${JSON.stringify(dataB)}`); + console.log(`${callbackName} formB amount: ${dataB.length}`); + const dataC = data.filter((form) => { + return `com.ohos.st.formsystemproviderc` === form.bundleName; + }); + console.log(`${callbackName} form dataC: ${JSON.stringify(dataC)}`); + console.log(`${callbackName} formC amount: ${dataC.length}`); + + expect(dataB.length).assertEqual(1); + expect(dataC.length).assertEqual(1); + expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); + expect(JSON.stringify(dataC[0])).assertEqual(JSON.stringify(expectDataC)); + expect(error.code).assertEqual(ERR_OK_CODE); + expect(error.message).assertEqual(ERR_OK); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_0500 + * @tc.desc: Query all form configuration information (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getAllFormsInfo(); + console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} forms amount: ${data.length}`); + + const dataB = data.filter((form) => { + return `com.ohos.st.formsystemproviderb` === form.bundleName; + }); + console.log(`${promiseName} form dataB: ${JSON.stringify(dataB)}`); + console.log(`${promiseName} formB amount: ${dataB.length}`); + const dataC = data.filter((form) => { + return `com.ohos.st.formsystemproviderc` === form.bundleName; + }); + console.log(`${promiseName} form dataC: ${JSON.stringify(dataC)}`); + console.log(`${promiseName} formC amount: ${dataC.length}`); + + expect(dataB.length).assertEqual(1); + expect(dataC.length).assertEqual(1); + expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); + expect(JSON.stringify(dataC[0])).assertEqual(JSON.stringify(expectDataC)); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } + }); + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets new file mode 100644 index 000000000..f44d4bc06 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets @@ -0,0 +1,521 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; + +export const getFormsInfoTest = (describeName, filterParameter) => { + const ERR_OK_CODE = 0; + const ERR_OK = `success`; + const ERR_GET_BUNDLE_FAILED_CODE = 5; + const ERR_GET_BUNDLE_FAILED = `failed to obtain the bundle information`; + const ERR_ADD_INVALID_PARAM_CODE = 7; + const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_0900 callback`; + const promiseName = `FMS_getFormsInfo_0900 promise`; + const bundleName = ``; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_0900 + * @tc.desc: Query specific form configuration information by empty bundle name (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_0900 + * @tc.desc: Query specific form configuration information by empty bundle name (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } + }); + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_1000 callback`; + const promiseName = `FMS_getFormsInfo_1000 promise`; + const bundleName = `wrong.bundle.name`; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_1000 + * @tc.desc: Query specific form configuration information by wrong bundle name (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_1000 + * @tc.desc: Query specific form configuration information by wrong bundle name (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } + }); + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_1100 callback`; + const promiseName = `FMS_getFormsInfo_1100 promise`; + const bundleName = `com.ohos.st.formsystemproviderb`; + + const expectDataB = { + bundleName: 'com.ohos.st.formsystemproviderb', + moduleName: 'form_module_b', + abilityName: 'com.ohos.st.formsystemproviderb.MainAbility', + name: 'FormB_Js001', + description: 'form_description_FormB_Js001', + descriptionId: 20, + type: 1, + jsComponentName: 'card_b', + colorMode: -1, + isDefault: 1, + updateEnabled: 1, + formVisibleNotify: 1, + formConfigAbility: 'abilityb', + updateDuration: 3, + scheduledUpdateTime: '10:30', + defaultDimension: 2, + supportDimensions: [1, 2], + metaData: { customizeData: [{ name: 'originWidgetNameB', value: 'valueB' }] }, + }; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_1100 + * @tc.desc: Query specific form configuration information by correct bundle name (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + console.log(`${callbackName} forms amount: ${data.length}`); + + const dataB = data.filter((form) => { + return `com.ohos.st.formsystemproviderb` === form.bundleName; + }); + console.log(`${callbackName} form dataB: ${JSON.stringify(dataB)}`); + console.log(`${callbackName} formB amount: ${dataB.length}`); + + expect(data.length).assertEqual(1); + expect(dataB.length).assertEqual(1); + expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); + expect(error.code).assertEqual(ERR_OK_CODE); + expect(error.message).assertEqual(ERR_OK); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_1100 + * @tc.desc: Query specific form configuration information by correct bundle name (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} forms amount: ${data.length}`); + + const dataB = data.filter((form) => { + return `com.ohos.st.formsystemproviderb` === form.bundleName; + }); + console.log(`${promiseName} form dataB: ${JSON.stringify(dataB)}`); + console.log(`${promiseName} formB amount: ${dataB.length}`); + + expect(data.length).assertEqual(1); + expect(dataB.length).assertEqual(1); + expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } + }); + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_1400 callback`; + const promiseName = `FMS_getFormsInfo_1400 promise`; + const bundleName = ``; + const moduleName = `form_module_c`; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_1400 + * @tc.desc: Query specific form configuration information by empty bundle name and correct module name (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_1400 + * @tc.desc: Query specific form configuration information by empty bundle name and correct module name (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName, moduleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } + }); + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_1500 callback`; + const promiseName = `FMS_getFormsInfo_1500 promise`; + const bundleName = `wrong.bundle.name`; + const moduleName = `form_module_c`; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_1500 + * @tc.desc: Query specific form configuration information by wrong bundle name and correct module name (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_1500 + * @tc.desc: Query specific form configuration information by wrong bundle name and correct module name (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName, moduleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); + expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } + }); + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_1600 callback`; + const promiseName = `FMS_getFormsInfo_1600 promise`; + const bundleName = `com.ohos.st.formsystemproviderc`; + const moduleName = ``; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_1600 + * @tc.desc: Query specific form configuration information by correct bundle name and empty module name (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_1600 + * @tc.desc: Query specific form configuration information by correct bundle name and empty module name (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName, moduleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); + expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } + }); + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_1700 callback`; + const promiseName = `FMS_getFormsInfo_1700 promise`; + const bundleName = `com.ohos.st.formsystemproviderc`; + const moduleName = `wrong.module.name`; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_1700 + * @tc.desc: Query specific form configuration information by correct bundle name and wrong module name (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(JSON.stringify(data)).assertEqual(`[]`); + expect(error.code).assertEqual(ERR_OK_CODE); + expect(error.message).assertEqual(ERR_OK); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_1700 + * @tc.desc: Query specific form configuration information by correct bundle name and wrong module name (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName, moduleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + expect(JSON.stringify(data)).assertEqual(`[]`); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } + }); + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_1800 callback`; + const promiseName = `FMS_getFormsInfo_1800 promise`; + const bundleName = `com.ohos.st.formsystemproviderc`; + const moduleName = `form_module_c`; + + const expectDataC = { + bundleName: 'com.ohos.st.formsystemproviderc', + moduleName: 'form_module_c', + abilityName: 'com.ohos.st.formsystemproviderc.MainAbility', + name: 'FormC_Js001', + description: 'form_description_FormC_Js001', + descriptionId: 30, + type: 1, + jsComponentName: 'card_c', + colorMode: 1, + isDefault: 1, + updateEnabled: 1, + formVisibleNotify: 1, + formConfigAbility: 'abilityc', + updateDuration: 4, + scheduledUpdateTime: '15:30', + defaultDimension: 3, + supportDimensions: [3, 4], + metaData: { customizeData: [{ name: 'originWidgetNameC', value: 'valueC' }] }, + }; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_1800 + * @tc.desc: Query specific form configuration information by correct bundle name and correct module name (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + console.log(`${callbackName} forms amount: ${data.length}`); + + const dataC = data.filter((form) => { + return `com.ohos.st.formsystemproviderc` === form.bundleName; + }); + console.log(`${callbackName} form dataC: ${JSON.stringify(dataC)}`); + console.log(`${callbackName} formC amount: ${dataC.length}`); + + expect(data.length).assertEqual(1); + expect(dataC.length).assertEqual(1); + expect(JSON.stringify(dataC[0])).assertEqual(JSON.stringify(expectDataC)); + expect(error.code).assertEqual(ERR_OK_CODE); + expect(error.message).assertEqual(ERR_OK); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_1800 + * @tc.desc: Query specific form configuration information by correct bundle name and correct module name (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName, moduleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} forms amount: ${data.length}`); + + const dataC = data.filter((form) => { + return `com.ohos.st.formsystemproviderc` === form.bundleName; + }); + console.log(`${promiseName} form dataC: ${JSON.stringify(dataC)}`); + console.log(`${promiseName} formC amount: ${dataC.length}`); + + expect(data.length).assertEqual(1); + expect(dataC.length).assertEqual(1); + expect(JSON.stringify(dataC[0])).assertEqual(JSON.stringify(expectDataC)); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } + }); + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..60eb76685 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; +import { getFormsInfoTest } from './GetFormsInfo.test.ets'; + +export default function testsuite() { + // FMS_getFormsInfo_0500 + getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); + // FMS_getFormsInfo_0900 + // FMS_getFormsInfo_1000 + // FMS_getFormsInfo_1100 + // FMS_getFormsInfo_1400 + // FMS_getFormsInfo_1500 + // FMS_getFormsInfo_1600 + // FMS_getFormsInfo_1700 fail + // FMS_getFormsInfo_1800 + getFormsInfoTest(`GetFormsInfoTest`, 0); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/Test.json new file mode 100644 index 000000000..ca9ca39be --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/Test.json @@ -0,0 +1,20 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formsoneandtwotest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormsOneAndTwoTest.hap", + "FormSystemProviderA.hap", + "FormSystemProviderB.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json new file mode 100644 index 000000000..c554bf7f0 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json @@ -0,0 +1,114 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsoneandtwotest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsoneandtwotest", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..d57112382 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('Application onCreate'); + }, + onDestroy() { + console.info('Application onDestroy'); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..fcbc42d15 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; +import testsuite from '../test/List.test.ets'; + +@Entry +@Component +struct Index { + private componentName: string = `FormsOneAndTwoTest`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`${this.componentName}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets new file mode 100644 index 000000000..f43e9af5e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; + +export const getAllFormsInfoTest = (describeName, filterParameter) => { + const ERR_OK_CODE = 0; + const ERR_OK = `success`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_0600 callback`; + const promiseName = `FMS_getFormsInfo_0600 promise`; + + const expectDataA01 = { + bundleName: 'com.ohos.st.formsystemprovidera', + moduleName: 'form_module_a', + abilityName: 'com.ohos.st.formsystemprovidera.MainAbility', + name: 'FormA_Js001', + description: 'form_description_FormA_Js001', + descriptionId: 0, + type: 1, + jsComponentName: 'card_a01', + colorMode: 0, + isDefault: 1, + updateEnabled: 1, + formVisibleNotify: 1, + formConfigAbility: 'abilitya01', + updateDuration: 1, + scheduledUpdateTime: '5:30', + defaultDimension: 1, + supportDimensions: [1, 3], + metaData: { customizeData: [{ name: 'originWidgetNameA01', value: 'valueA01' }] }, + }; + + const expectDataA02 = { + bundleName: 'com.ohos.st.formsystemprovidera', + moduleName: 'form_module_a', + abilityName: 'com.ohos.st.formsystemprovidera.MainAbility', + name: 'FormA_Js002', + description: 'form_description_FormA_Js002', + descriptionId: 10, + type: 1, + jsComponentName: 'card_a02', + colorMode: 1, + isDefault: 0, + updateEnabled: 0, + formVisibleNotify: 0, + formConfigAbility: 'abilitya02', + updateDuration: 2, + scheduledUpdateTime: '20:30', + defaultDimension: 4, + supportDimensions: [1, 2, 3, 4], + metaData: { customizeData: [{ name: 'originWidgetNameA02', value: 'valueA02' }] }, + }; + + const expectDataB = { + bundleName: 'com.ohos.st.formsystemproviderb', + moduleName: 'form_module_b', + abilityName: 'com.ohos.st.formsystemproviderb.MainAbility', + name: 'FormB_Js001', + description: 'form_description_FormB_Js001', + descriptionId: 20, + type: 1, + jsComponentName: 'card_b', + colorMode: -1, + isDefault: 1, + updateEnabled: 1, + formVisibleNotify: 1, + formConfigAbility: 'abilityb', + updateDuration: 3, + scheduledUpdateTime: '10:30', + defaultDimension: 2, + supportDimensions: [1, 2], + metaData: { customizeData: [{ name: 'originWidgetNameB', value: 'valueB' }] }, + }; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_0600 + * @tc.desc: Query all form configuration information (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getAllFormsInfo((error, data) => { + console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + console.log(`${callbackName} forms amount: ${data.length}`); + + const dataA = data.filter((form) => { + return `com.ohos.st.formsystemprovidera` === form.bundleName; + }); + console.log(`${callbackName} form dataA: ${JSON.stringify(dataA)}`); + console.log(`${callbackName} formA amount: ${dataA.length}`); + const dataB = data.filter((form) => { + return `com.ohos.st.formsystemproviderb` === form.bundleName; + }); + console.log(`${callbackName} form dataB: ${JSON.stringify(dataB)}`); + console.log(`${callbackName} formB amount: ${dataB.length}`); + + expect(dataA.length).assertEqual(2); + expect(dataB.length).assertEqual(1); + expect(JSON.stringify(dataA[0])).assertEqual(JSON.stringify(expectDataA01)); + expect(JSON.stringify(dataA[1])).assertEqual(JSON.stringify(expectDataA02)); + expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); + expect(error.code).assertEqual(ERR_OK_CODE); + expect(error.message).assertEqual(ERR_OK); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_0600 + * @tc.desc: Query all form configuration information (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getAllFormsInfo(); + console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} forms amount: ${data.length}`); + + const dataA = data.filter((form) => { + return `com.ohos.st.formsystemprovidera` === form.bundleName; + }); + console.log(`${promiseName} form dataA: ${JSON.stringify(dataA)}`); + console.log(`${promiseName} formA amount: ${dataA.length}`); + const dataB = data.filter((form) => { + return `com.ohos.st.formsystemproviderb` === form.bundleName; + }); + console.log(`${promiseName} form dataB: ${JSON.stringify(dataB)}`); + console.log(`${promiseName} formB amount: ${dataB.length}`); + + expect(dataA.length).assertEqual(2); + expect(dataB.length).assertEqual(1); + expect(JSON.stringify(dataA[0])).assertEqual(JSON.stringify(expectDataA01)); + expect(JSON.stringify(dataA[1])).assertEqual(JSON.stringify(expectDataA02)); + expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } + }); + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..93f75c7f1 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; + +export default function testsuite() { + // FMS_getFormsInfo_0600 + getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/Test.json new file mode 100644 index 000000000..79d26f01e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/Test.json @@ -0,0 +1,20 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formsoneandzerotest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormsOneAndZeroTest.hap", + "FormSystemProviderB.hap", + "FormSystemProviderD.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json new file mode 100644 index 000000000..e7891fe81 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json @@ -0,0 +1,114 @@ +{ + "app": { + "bundleName": "com.ohos.st.formsoneandzerotest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formsoneandzerotest", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..d57112382 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('Application onCreate'); + }, + onDestroy() { + console.info('Application onDestroy'); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..7a89132a4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; +import testsuite from '../test/List.test.ets'; + +@Entry +@Component +struct Index { + private componentName: string = `FormsOneAndZeroTest`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`${this.componentName}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets new file mode 100644 index 000000000..8f8e8d377 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; + +export const getAllFormsInfoTest = (describeName, filterParameter) => { + const ERR_OK_CODE = 0; + const ERR_OK = `success`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_0400 callback`; + const promiseName = `FMS_getFormsInfo_0400 promise`; + + const expectDataB = { + bundleName: 'com.ohos.st.formsystemproviderb', + moduleName: 'form_module_b', + abilityName: 'com.ohos.st.formsystemproviderb.MainAbility', + name: 'FormB_Js001', + description: 'form_description_FormB_Js001', + descriptionId: 20, + type: 1, + jsComponentName: 'card_b', + colorMode: -1, + isDefault: 1, + updateEnabled: 1, + formVisibleNotify: 1, + formConfigAbility: 'abilityb', + updateDuration: 3, + scheduledUpdateTime: '10:30', + defaultDimension: 2, + supportDimensions: [1, 2], + metaData: { customizeData: [{ name: 'originWidgetNameB', value: 'valueB' }] }, + }; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_0400 + * @tc.desc: Query all form configuration information (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getAllFormsInfo((error, data) => { + console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + console.log(`${callbackName} forms amount: ${data.length}`); + + const dataB = data.filter((form) => { + return `com.ohos.st.formsystemproviderb` === form.bundleName; + }); + console.log(`${callbackName} form dataB: ${JSON.stringify(dataB)}`); + console.log(`${callbackName} formB amount: ${dataB.length}`); + const dataD = data.filter((form) => { + return `com.ohos.st.formsystemproviderd` === form.bundleName; + }); + console.log(`${callbackName} form dataD: ${JSON.stringify(dataD)}`); + console.log(`${callbackName} formD amount: ${dataD.length}`); + + expect(dataB.length).assertEqual(1); + expect(dataD.length).assertEqual(0); + expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); + expect(JSON.stringify(dataD)).assertEqual(`[]`); + expect(error.code).assertEqual(ERR_OK_CODE); + expect(error.message).assertEqual(ERR_OK); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_0400 + * @tc.desc: Query all form configuration information (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getAllFormsInfo(); + console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} forms amount: ${data.length}`); + + const dataB = data.filter((form) => { + return `com.ohos.st.formsystemproviderb` === form.bundleName; + }); + console.log(`${promiseName} form dataB: ${JSON.stringify(dataB)}`); + console.log(`${promiseName} formB amount: ${dataB.length}`); + const dataD = data.filter((form) => { + return `com.ohos.st.formsystemproviderd` === form.bundleName; + }); + console.log(`${promiseName} form dataD: ${JSON.stringify(dataD)}`); + console.log(`${promiseName} formD amount: ${dataD.length}`); + + expect(dataB.length).assertEqual(1); + expect(dataD.length).assertEqual(0); + expect(JSON.stringify(dataB[0])).assertEqual(JSON.stringify(expectDataB)); + expect(JSON.stringify(dataD)).assertEqual(`[]`); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } + }); + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..eba498a1e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; + +export default function testsuite() { + // FMS_getFormsInfo_0400 + getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/Test.json new file mode 100644 index 000000000..608989c1e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formswithoutpermtest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormsWithoutPermTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json new file mode 100644 index 000000000..0783c577f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json @@ -0,0 +1,110 @@ +{ + "app": { + "bundleName": "com.ohos.st.formswithoutpermtest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formswithoutpermtest", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..d57112382 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('Application onCreate'); + }, + onDestroy() { + console.info('Application onDestroy'); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..dcdf0676d --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; +import testsuite from '../test/List.test.ets'; + +@Entry +@Component +struct Index { + private componentName: string = `FormsWithoutPermTest`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`${this.componentName}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets new file mode 100644 index 000000000..665295b6e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; + +export const getAllFormsInfoTest = (describeName, filterParameter) => { + const ERR_OK_CODE = 0; + const ERR_OK = `success`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_0200 callback`; + const promiseName = `FMS_getFormsInfo_0200 promise`; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_0200 + * @tc.desc: Query all form configuration information without permission (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getAllFormsInfo((error, data) => { + console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(JSON.stringify(data)).assertEqual(`[]`); + expect(error.code).assertEqual(ERR_OK_CODE); + expect(error.message).assertEqual(ERR_OK); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_0200 + * @tc.desc: Query all form configuration information without permission (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getAllFormsInfo(); + console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); + expect(JSON.stringify(data)).assertEqual(`[]`); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } + }); + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets new file mode 100644 index 000000000..9430b2008 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; + +export const getFormsInfoTest = (describeName, filterParameter) => { + const ERR_PERMISSION_DENY_CODE = 2; + const ERR_PERMISSION_DENY = `does not have permission to use forms`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_0800 callback`; + const promiseName = `FMS_getFormsInfo_0800 promise`; + const bundleName = `1`; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_0800 + * @tc.desc: Query specific form configuration information by bundle name without permission (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_PERMISSION_DENY_CODE); + expect(error.message).assertEqual(ERR_PERMISSION_DENY); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_0800 + * @tc.desc: Query specific form configuration information by bundle name without permission (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + expect(error.code).assertEqual(ERR_PERMISSION_DENY_CODE); + expect(error.message).assertEqual(ERR_PERMISSION_DENY); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } + }); + }); + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_1300 callback`; + const promiseName = `FMS_getFormsInfo_1300 promise`; + const bundleName = `2`; + const moduleName = `a`; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_1300 + * @tc.desc: Query specific form configuration information by bundle name and module name without permission (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + console.log(`${callbackName} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERR_PERMISSION_DENY_CODE); + expect(error.message).assertEqual(ERR_PERMISSION_DENY); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_1300 + * @tc.desc: Query specific form configuration information by bundle name and module name without permission (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getFormsInfo(bundleName, moduleName); + console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + expect(error.code).assertEqual(ERR_PERMISSION_DENY_CODE); + expect(error.message).assertEqual(ERR_PERMISSION_DENY); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } + }); + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..fb9b98dc7 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; +import { getFormsInfoTest } from './GetFormsInfo.test.ets'; + +export default function testsuite() { + // FMS_getFormsInfo_0200 + getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); + // FMS_getFormsInfo_0800 + // FMS_getFormsInfo_1300 + getFormsInfoTest(`GetFormsInfoTest`, 0); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/Test.json new file mode 100644 index 000000000..1e84c156f --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/Test.json @@ -0,0 +1,19 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formszerotest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormsZeroTest.hap", + "FormSystemProviderD.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json new file mode 100644 index 000000000..041bbb337 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json @@ -0,0 +1,114 @@ +{ + "app": { + "bundleName": "com.ohos.st.formszerotest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formszerotest", + "name": ".FormSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..d57112382 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('Application onCreate'); + }, + onDestroy() { + console.info('Application onDestroy'); + }, +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..ca551d272 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index'; +import testsuite from '../test/List.test.ets'; + +@Entry +@Component +struct Index { + private componentName: string = `FormsZeroTest`; + + aboutToAppear() { + console.info(`${this.componentName} start run testcase!!!!`); + + featureAbility.getWant() + .then((want: any) => { + console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text(`${this.componentName}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets new file mode 100644 index 000000000..bb3abde74 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formHost from '@ohos.application.formHost'; +import { describe, expect, it } from 'deccjsunit/index'; + +export const getAllFormsInfoTest = (describeName, filterParameter) => { + const ERR_OK_CODE = 0; + const ERR_OK = `success`; + + describe(`${describeName}`, () => { + const callbackName = `FMS_getFormsInfo_0300 callback`; + const promiseName = `FMS_getFormsInfo_0300 promise`; + + /** + * @tc.name: getFormsInfo + * @tc.number: FMS_getFormsInfo_0300 + * @tc.desc: Query all form configuration information without permission (by AsyncCallback) + */ + it(`${callbackName}`, filterParameter, async (done) => { + console.log(`==========${callbackName} ${describeName} start==========`); + + try { + formHost.getAllFormsInfo((error, data) => { + console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); + + const dataD = data.filter((form) => { + return `com.ohos.st.formsystemproviderd` === form.bundleName; + }); + console.log(`${callbackName} form dataD: ${JSON.stringify(dataD)}`); + console.log(`${callbackName} formD amount: ${dataD.length}`); + expect(dataD.length).assertEqual(0); + expect(JSON.stringify(dataD)).assertEqual(`[]`); + expect(error.code).assertEqual(ERR_OK_CODE); + expect(error.message).assertEqual(ERR_OK); + done(); + console.log(`==========${callbackName} ${describeName} end==========`); + }); + } catch (error) { + console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); + console.log(`${callbackName} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.name getFormsInfo + * @tc.number FMS_getFormsInfo_0300 + * @tc.desc: Query all form configuration information without permission (by Promise) + */ + it(`${promiseName}`, filterParameter, async (done) => { + console.log(`==========${promiseName} ${describeName} start==========`); + + try { + const data = await formHost.getAllFormsInfo(); + const dataD = data.filter((form) => { + return `com.ohos.st.formsystemproviderd` === form.bundleName; + }); + console.log(`${callbackName} form dataD: ${JSON.stringify(dataD)}`); + console.log(`${callbackName} formD amount: ${dataD.length}`); + expect(dataD.length).assertEqual(0); + expect(JSON.stringify(dataD)).assertEqual(`[]`); + done(); + console.log(`==========${promiseName} ${describeName} end==========`); + } catch (error) { + console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); + console.log(`${promiseName} should not reach here`); + expect().assertFail(); + } + }); + }); +}; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..2a870ab79 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { getAllFormsInfoTest } from './GetAllFormsInfo.test.ets'; + +export default function testsuite() { + // FMS_getFormsInfo_0300 + getAllFormsInfoTest(`GetAllFormsInfoTest`, 0); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/Test.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/Test.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/app.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/app.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/app.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..d90a8cc56 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 60000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Host Death Recipient Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/FmsHostDeathRecipient.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/FmsHostDeathRecipient.test.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/FmsHostDeathRecipient.test.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/FmsHostDeathRecipient.test.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..941491045 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsHostDeathRecipient.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json new file mode 100644 index 000000000..5e0ae08e4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json @@ -0,0 +1,20 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formperformancetest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormPerformanceTest.hap", + "FormSystemHostK.hap", + "FormSupplyAppG.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..cb7e7d915 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..f235c8023 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 20000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Performance Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets new file mode 100644 index 000000000..1c740db61 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets @@ -0,0 +1,940 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the `License`); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an `AS IS` BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import formHost from '@ohos.application.formHost'; +import commonEvent from '@ohos.commonEvent'; +import systemTime from '@ohos.systemTime'; +import { beforeEach, describe, expect, it } from 'deccjsunit/index'; + +const onAcquiredEvent = { + events: [`FMS_FormOnAcquired_commonEvent`], +}; +const onSupplyEvent = { + events: [`FMS_FormSupply_commonEvent`], +}; +const formOnDeleteEvent = `FMS_FormDelete_commonEvent`; + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`${tcNumber} unsubscribeOnAcquired callback`); +} +const unsubscribeOnSupplyCallback = (tcNumber) => { + console.info(`${tcNumber} unsubscribeOnSupply callback`); +} +const publishOnDeleteCallback = (tcNumber, done) => { + console.info(`${tcNumber} publishOnDelete callback`); + done(); +} + +let onAcquiredEventSubscriber; +let onSupplyEventSubscriber; + +export default function test() { + describe(`FmsPerformanceTest`, () => { + + beforeEach(async () => { + onAcquiredEventSubscriber = await commonEvent.createSubscriber(onAcquiredEvent); + onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent); + }); + + /** + * @tc.number: FMS_performanceTest_0100 + * @tc.name: Performance test. + * @tc.desc: Create form. + */ + it(`FMS_performanceTest_0100`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0100`; + const timeout = 1000; + let endflag = 0; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + const hostEndTime = data.parameters.time; + const hostTime = hostEndTime - startTime + console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onCreate` == kind) { + const providerEndTime = data.parameters.time; + const providerTime = providerEndTime - startTime; + console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); + expect(providerTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + console.info(`${tcNumber} onSupplyCallback_onCreate end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [supplyFormId] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + } + }); + + const startTime = await systemTime.getCurrentTime(); + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_0200 + * @tc.name: Performance test. + * @tc.desc: Delete form. + */ + it(`FMS_performanceTest_0200`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0200`; + const timeout = 1000; + let startTime = -1; + let endflag = 0; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + if (`deleteForm` == data.parameters.kind) { + startTime = data.parameters.startTime; + const hostTime = data.parameters.hostTime; + console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback_deleteForm end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + } + }); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onDestroy` == kind) { + setTimeout(() => { + const providerEndTime = data.parameters.time; + const providerTime = providerEndTime - startTime; + console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); + expect(providerTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + console.info(`${tcNumber} onSupplyCallback_onDestroy end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [supplyFormId] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }, 2000); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + deleteForm: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_0300 + * @tc.name: Performance test. + * @tc.desc: Release form. + */ + it(`FMS_performanceTest_0300`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0300`; + const timeout = 1000; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + if (`release` == data.parameters.kind) { + const hostTime = data.parameters.hostTime; + console.info(`${tcNumber} hostTime: ${hostTime}`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback_release end`); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + releaseForm: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_0400 + * @tc.name: Performance test. + * @tc.desc: Cast temp form. + */ + it(`FMS_performanceTest_0400`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0400`; + const timeout = 500; + let startTime = -1; + let endflag = 0; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + if (`castTempForm` == data.parameters.kind) { + startTime = data.parameters.startTime; + const hostTime = data.parameters.hostTime; + console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); + console.info(`${tcNumber} onAcquiredCallback_castTempForm end`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + } + }); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onCastToNormal` == kind) { + setTimeout(() => { + const providerEndTime = data.parameters.time; + const providerTime = providerEndTime - startTime; + console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); + expect(providerTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + console.info(`${tcNumber} onSupplyCallback_onCastToNormal end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [supplyFormId] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }, 2000); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + castTempForm: true, + temporary: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_0500 + * @tc.name: Performance test. + * @tc.desc: Notify visible forms. + */ + it(`FMS_performanceTest_0500`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0500`; + const timeout = 500; + let startTime = -1; + let endflag = 0; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + if (`notifyVisibleForms` == data.parameters.kind) { + startTime = data.parameters.startTime; + const hostTime = data.parameters.hostTime; + console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback_notifyVisibleForms end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + } + }); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : `onVisibilityChange` == kind + ? Object.keys(JSON.parse(data.parameters.parameters))[0] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onVisibilityChange` == kind) { + setTimeout(() => { + const providerEndTime = data.parameters.time; + const providerTime = providerEndTime - startTime; + console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); + expect(providerTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + console.info(`${tcNumber} onSupplyCallback_onVisibilityChange end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [supplyFormId] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }, 2000); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + notifyVisibleForms: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_0600 + * @tc.name: Performance test. + * @tc.desc: Notify invisible forms. + */ + it(`FMS_performanceTest_0600`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0600`; + const timeout = 500; + let startTime = -1; + let endflag = 0; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + if (`notifyInvisibleForms` == data.parameters.kind) { + startTime = data.parameters.startTime; + const hostTime = data.parameters.hostTime; + console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback_notifyInvisibleForms end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + } + }); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : `onVisibilityChange` == kind + ? Object.keys(JSON.parse(data.parameters.parameters))[0] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onVisibilityChange` == kind) { + setTimeout(() => { + const providerEndTime = data.parameters.time; + const providerTime = providerEndTime - startTime; + console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); + expect(providerTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + console.info(`${tcNumber} onSupplyCallback_onVisibilityChange end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [supplyFormId] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }, 2000); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + notifyInvisibleForms: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_0700 + * @tc.name: Performance test. + * @tc.desc: Request forms. + */ + it(`FMS_performanceTest_0700`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0700`; + const timeout = 100; + let startTime = -1; + let endflag = 0; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + if (`request` == data.parameters.kind) { + startTime = data.parameters.startTime; + const hostTime = data.parameters.hostTime; + console.info(`${tcNumber} hostTime: ${JSON.stringify(hostTime)}`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + } + }); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onUpdate` == kind) { + setTimeout(() => { + const providerEndTime = data.parameters.time; + console.info(`${tcNumber} providerTime: ${JSON.stringify(providerEndTime - startTime)}`); + expect(providerEndTime - startTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + console.info(`${tcNumber} onSupplyCallback_onUpdate end`); + + if (++endflag == 2) { + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [supplyFormId] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }, 2000); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + requestForm: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_0800 + * @tc.name: Performance test. + * @tc.desc: Update form. + */ + it(`FMS_performanceTest_0800`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0800`; + const timeout = 100; + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : `onVisibilityChange` == kind + ? Object.keys(JSON.parse(data.parameters.parameters))[0] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onUpdateForm` == kind) { + const providerTime = data.parameters.time; + console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); + expect(providerTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + console.info(`${tcNumber} onSupplyCallback_onUpdateForm end`); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [supplyFormId] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + notifyVisibleForms: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_0900 + * @tc.name: Performance test. + * @tc.desc: Set next refresh time. + */ + it(`FMS_performanceTest_0900`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_0900`; + const timeout = 100; + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : `onVisibilityChange` == kind + ? Object.keys(JSON.parse(data.parameters.parameters))[0] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onSetFormNextRefreshTime` == kind) { + const providerTime = data.parameters.time; + console.info(`${tcNumber} providerTime: ${JSON.stringify(providerTime)}`); + expect(providerTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + console.info(`${tcNumber} onSupplyCallback_onSetFormNextRefreshTime end`); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [supplyFormId] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }); + + setTimeout(async () => { + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + notifyVisibleForms: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }, 2000); + }); + + /** + * @tc.number: FMS_performanceTest_1000 + * @tc.name: Performance test. + * @tc.desc: Enable update forms. + */ + it(`FMS_performanceTest_1000`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_1000`; + const timeout = 100; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + if (`enableUpdate` == data.parameters.kind) { + const hostTime = data.parameters.hostTime; + console.info(`${tcNumber} hostTime: ${hostTime}`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback_enableUpdate end`); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + enableUpdate: true, + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_1100 + * @tc.name: Performance test. + * @tc.desc: Disable update forms. + */ + it(`FMS_performanceTest_1100`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_1100`; + const timeout = 100; + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${data.data}`); + + if (`disableUpdate` == data.parameters.kind) { + const hostTime = data.parameters.hostTime; + console.info(`${tcNumber} hostTime: ${hostTime}`); + expect(hostTime < timeout).assertEqual(true); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback_disableUpdate end`); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [data.data] + } + }, () => publishOnDeleteCallback(tcNumber, done)); + }, 500); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true, + disableUpdate: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_performanceTest_1300 + * @tc.name: Performance test. + * @tc.desc: Get forms info. + */ + it(`FMS_performanceTest_1300`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_1300`; + const timeout = 10; + + const startTime = await systemTime.getCurrentTime(); + const data = await formHost.getAllFormsInfo(); + console.info(`${tcNumber} getAllFormsInfo result: ${JSON.stringify(data)}`); + const endTime = await systemTime.getCurrentTime(); + + console.info(`${tcNumber} hostTime: ${JSON.stringify(endTime - startTime)}`); + expect(endTime - startTime < timeout); + done(); + }); + + /** + * @tc.number: FMS_performanceTest_1400 + * @tc.name: Performance test. + * @tc.desc: Get forms info by bundle. + */ + it(`FMS_performanceTest_1400`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_1400`; + const timeout = 10; + + const startTime = await systemTime.getCurrentTime(); + const data = await formHost.getFormsInfo(`com.form.formsystemtestserviceg.hmservice`); + console.info(`${tcNumber} getFormsInfoByBundle result: ${JSON.stringify(data)}`); + const endTime = await systemTime.getCurrentTime(); + + console.info(`${tcNumber} hostTime: ${JSON.stringify(endTime - startTime)}`); + expect(endTime - startTime < timeout); + done(); + }); + + /** + * @tc.number: FMS_performanceTest_1500 + * @tc.name: Performance test. + * @tc.desc: Get forms info by module. + */ + it(`FMS_performanceTest_1500`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_1500`; + const timeout = 10; + + const startTime = await systemTime.getCurrentTime(); + const data = await formHost.getFormsInfo(`com.form.formsystemtestserviceg.hmservice`, `entry`); + console.info(`${tcNumber} getFormsInfoByModule result: ${JSON.stringify(data)}`); + const endTime = await systemTime.getCurrentTime(); + + console.info(`${tcNumber} hostTime: ${JSON.stringify(endTime - startTime)}`); + expect(endTime - startTime < timeout); + done(); + }); + + /** + * @tc.number: FMS_performanceTest_1600 + * @tc.name: Performance test. + * @tc.desc: Form System Ready. + */ + it(`FMS_performanceTest_1600`, 0, async (done) => { + const tcNumber = `FMS_performanceTest_1600`; + const timeout = 10; + + const startTime = await systemTime.getCurrentTime(); + const data = await formHost.isSystemReady(); + console.info(`${tcNumber} isSystemReady result: ${JSON.stringify(data)}`); + const endTime = await systemTime.getCurrentTime(); + + console.info(`${tcNumber} hostTime: ${JSON.stringify(endTime - startTime)}`); + expect(endTime - startTime < timeout); + done(); + }); + }); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..4110aef6b --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsPerformanceTest.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formperformancetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/Test.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/Test.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..11c5d70c4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets new file mode 100644 index 000000000..09d832912 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets @@ -0,0 +1,580 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; + +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; +var onDeletedFormEvent = { + events: ["FMS_FormOnDeleted_commonEvent"], +}; +var onReleasedFormEvent = { + events: ["FMS_FormOnReleased_commonEvent"], +}; +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + +var subscriberOnAcquired; +var subscriberOnDeleted; +var subscriberOnReleased; + +export default function test() { + describe(`FmsReleaseFormTest`, () => { + + beforeAll(async (done) => { + done(); + }) + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); + subscriberOnReleased = await commonEvent.createSubscriber(onReleasedFormEvent); + }) + + /** + * @tc.number: FMS_releaseForm_0200 + * @tc.name: host does not have permission + * @tc.desc: 1.release the form that formID is 1 + * 2.Verify the result is false + */ + it(`FMS_releaseForm_0200`, 0, async (done) => { + console.log(`FMS_releaseForm_0200 start`); + let formId; + + function onReleasedCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_0200 onReleasedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0200")); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_releaseForm_0200 publish' + JSON.stringify(err)); + }); + } + + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_0200 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_releaseForm_0200")) + formId = data.data; + commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); + + console.log(`FMS_releaseForm_0200 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostnoperm", + abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "releaseForm" : true, + "releaseId" : formId, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_0200 featureAbility.startAbility again end`); + } + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + + console.log(`FMS_releaseForm_0200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_0200 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_releaseForm_0300 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.release the form + * 2.Verify the result is false + */ + it(`FMS_releaseForm_0300`, 0, async (done) => { + console.log(`FMS_releaseForm_0300 start`); + + function onReleasedCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_0300 onReleasedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0300")); + setTimeout(function () { + console.info('FMS_releaseForm_0300 onReleasedCallBack end'); + console.log(`FMS_releaseForm_0300 end`); + done(); + }, 100); + } + commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); + + console.log(`FMS_releaseForm_0300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "releaseForm" : true, + "releaseId" : "-1", + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_0300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_releaseForm_0400 + * @tc.name: formID id is error(formID = 0) + * @tc.desc: 1.release the form + * 2.Verify the result is false + */ + it(`FMS_releaseForm_0400`, 0, async (done) => { + console.log(`FMS_releaseForm_0400 start`); + + function onReleaseCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_0400 onReleaseCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0400")); + setTimeout(function () { + console.info('FMS_releaseForm_0400 onReleaseCallBack end'); + console.log(`FMS_releaseForm_0400 end`); + done(); + }, 100); + } + commonEvent.subscribe(subscriberOnReleased, onReleaseCallBack); + console.log(`FMS_releaseForm_0400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "releaseForm" : true, + "releaseId" : "0", + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_0400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_releaseForm_0500 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.host A create a formA + * 2.host B release the formA + * 2.Verify the result is false + */ + it(`FMS_releaseForm_0500`, 0, async (done) => { + console.log(`FMS_releaseForm_0500 start`); + let formId; + + function onReleasedCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_0500 onReleasedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0500")); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_releaseForm_0500 publish' + JSON.stringify(err)); + }); + } + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_0500 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_releaseForm_0500")); + formId = data.data; + commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); + console.log(`FMS_releaseForm_0500 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostd", + abilityName: "com.ohos.st.formsystemhostd.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "releaseForm" : true, + "releaseId" : formId, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_0500 featureAbility.startAbility again end`); + } + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.log(`FMS_releaseForm_0500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_0500 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_releaseForm_0600 + * @tc.name: Form ID error (FormID does not exist) + * @tc.desc: 1.host create one normal card + * 2.host delete the form + * 3.host release the form and verify the result is false + */ + it(`FMS_releaseForm_0600`, 0, async (done) => { + console.log(`FMS_releaseForm_0600 start`); + let formId; + + function onReleasedCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_0600 onReleasedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_0600")); + let commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_releaseForm_0600 publish' + JSON.stringify(err)); + }); + } + function onDeletedCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_0600 onDeletedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnDeleted_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnDeleted, unsubscribeDeletedCallback) + formId = data.parameters.formId; + commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); + + console.log(`FMS_releaseForm_0600 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "releaseForm" : true, + "releaseId" : formId, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_0600 featureAbility.startAbility again end`); + } + function unsubscribeDeletedCallback() { + console.debug("====>FMS_releaseForm_0600 unsubscribeDeletedCallback====>"); + } + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallBack); + console.log(`FMS_releaseForm_0600 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "deleteForm" : true, + "deleteId" : "self", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_0600 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_releaseForm_1300 + * @tc.name: single host continuously release forms + * @tc.desc: 1.There are 2 forms created by the single host + * 2.single host release 2 forms successfully + */ + it(`FMS_releaseForm_1300`, 0, async (done) => { + console.log(`FMS_releaseForm_1300 start`); + let formIdList = []; + let releasedIdList = []; + let formCount = 2; + let delCount = 0; + + function delPublishCallBack() { + console.info("!!!====>FMS_releaseForm_1300 delPublishCallBack====>"); + delCount++; + if(delCount == formCount) { + setTimeout(function () { + console.info('FMS_releaseForm_1300 delPublishCallBack end'); + console.log(`FMS_releaseForm_1300 end`); + done(); + }, 1000); + } + } + + function onReleasedCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_1300 onReleasedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); + expect(data.data).assertEqual("0"); + let formId = data.parameters.formId; + formIdList.forEach(function(item, index, arr) { + if(item === formId) { + releasedIdList.push(formId); + } + }); + if(releasedIdList.length == formCount) { + commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeOnReleasedCallback("FMS_releaseForm_1300")); + for(var iIndex = 0; iIndex < releasedIdList.length; iIndex++) { + let commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: releasedIdList[iIndex] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); + } + } + } + function releaseForms() { + console.debug("====>FMS_releaseForm_1300 releaseForms====>"); + commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); + for(var iIndex = 0; iIndex < formIdList.length; iIndex++) { + console.log(`FMS_releaseForm_1300 featureAbility.startAbility start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "releaseForm" : true, + "releaseId" : formIdList[iIndex], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_1300 featureAbility.startAbility end`); + } + } + function onAcquiredCallBack1(_, data) { + console.info("!!!====>FMS_releaseForm_1300 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_releaseForm_1300")); + formIdList.push(data.data); + + releaseForms(); + } + + async function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_1300 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_releaseForm_1300")); + formIdList.push(data.data); + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack1); + + console.log(`FMS_releaseForm_1300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_1300 featureAbility.startAbility end`); + } + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + + console.log(`FMS_releaseForm_1300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_1300 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_releaseForm_1400 + * @tc.name: release temp form + * @tc.desc: 1.host create one temp form + * 2.release the form and judge the result is true + */ + it(`FMS_releaseForm_1400`, 0, async (done) => { + console.log(`FMS_releaseForm_1400 start`); + + function onReleasedCallBack(_, data) { + console.info("!!!====>FMS_releaseForm_1400 onReleasedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnReleased_commonEvent"); + expect(data.data).assertEqual("0"); + let commonEventPublishData = { + bundleName: "com.ohos.st.formsystemhostc", + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_releaseForm_1400 publish' + JSON.stringify(err)); + }); + } + commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); + + console.log(`FMS_releaseForm_1400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostc", + abilityName: "com.ohos.st.formsystemhostc.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : true, + "releaseForm" : true, + "releaseId" : "self", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_releaseForm_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_releaseForm_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_releaseForm_1400 featureAbility.startAbility end`); + }); + }); +} + +const delPublishCallBack = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000); +} + +const unsubscribeOnReleasedCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnReleasedCallback====>`); +} + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formreleasetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/Test.json new file mode 100644 index 000000000..f692d0dff --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/Test.json @@ -0,0 +1,25 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formstatedisabletest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormStateDisableTest.hap", + "FormSystemHostF.hap", + "FormSystemHostG.hap", + "FormSupplyAppA.hap", + "FormSupplyAppF.hap", + "FormSupplyAppG.hap", + "FormSystemHostNoPerm.hap", + "FormSupplyAppH.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json new file mode 100644 index 000000000..e94c22a60 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json @@ -0,0 +1,150 @@ +{ + "app": { + "bundleName": "com.ohos.st.formstatedisabletest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formstatedisabletest", + "name": ".FormStateSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnState_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent", + "reason": "need use OnError commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent", + "reason": "need use OnDeleted commonEvent" + }, + { + "name": "FMS_FormOnState_commonEvent", + "reason": "need use OnState commonEvent" + }, + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..11c5d70c4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..2178a7f80 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 30000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Main Ability Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets new file mode 100644 index 000000000..49efafefa --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets @@ -0,0 +1,793 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; + +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; + +var onDeletedFormEvent = { + events: ["FMS_FormOnDeleted_commonEvent"], +}; + +var onStateFormEvent = { + events: ["FMS_FormOnState_commonEvent"], +}; + +var onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + +var subscriberOnAcquired; +var subscriberDel; +var subscriberOnState; +var subscriberSupply; + +export default function test() { + describe(`FmsStateFormTest`, () => { + + beforeAll(async (done) => { + done(); + }) + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent); + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + await sleep(1000); + }) + + /** + * @tc.number: FMS_disableFormsUpdate_0200 + * @tc.name: The form user does not have permission. + * @tc.desc: 1.The form user calls the disable update interface. + * 2.Verify the result of the disable update interface. + */ + it(`FMS_disableFormsUpdate_0200`, 0, async (done) => { + console.log(`FMS_disableFormsUpdate_0200 start`); + function onStateCallBack(_, data) { + console.info("!!!====>FMS_disableFormsUpdate_0200 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("2"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0200")); + setTimeout(function () { + console.info('FMS_disableFormsUpdate_0200 onStateCallBack end'); + console.log(`FMS_disableFormsUpdate_0200 end`); + done(); + }, 1000) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_disableFormsUpdate_0200 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostnoperm", + abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : ["1"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_0200 featureAbility.startAbility again end`); + }); + /** + * @tc.number: FMS_disableFormsUpdate_0300 + * @tc.name: The length of the formId list is 0 (no formId) + * @tc.desc: 1.The form user calls the disable update interface. + * 2.Verify the result of the disable update interface. + */ + it(`FMS_disableFormsUpdate_0300`, 0, async (done) => { + console.log(`FMS_disableFormsUpdate_0300 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_disableFormsUpdate_0300 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("7"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0300")) + + setTimeout(function () { + console.info('FMS_disableFormsUpdate_0300 delPublishCallBack end'); + console.log(`FMS_disableFormsUpdate_0300 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_disableFormsUpdate_0300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : [], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate _0300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_disableFormsUpdate_0400 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.The form user calls the disable update interface. + * 2.Verify the result of the disable update interface. + */ + it(`FMS_disableFormsUpdate_0400`, 0, async (done) => { + console.log(`FMS_disableFormsUpdate_0400 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_disableFormsUpdate_0400 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("13"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0400")) + + setTimeout(function () { + console.info('FMS_disableFormsUpdate_0400 delPublishCallBack end'); + console.log(`FMS_disableFormsUpdate_0400 end`); + done(); + }, 100) + } + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_disableFormsUpdate_0400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : ["-1"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate _0400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_disableFormsUpdate_0500 + * @tc.name: formID id is error(formID == 0) + * @tc.desc: 1.The form user calls the disable update interface. + * 2.Verify the result of the disable update interface. + */ + it(`FMS_disableFormsUpdate_0500`, 0, async (done) => { + console.log(`FMS_disableFormsUpdate_0500 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_disableFormsUpdate_0500 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("13"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0500")) + + setTimeout(function () { + console.info('FMS_disableFormsUpdate_0500 delPublishCallBack end'); + console.log(`FMS_disableFormsUpdate_0500 end`); + done(); + }, 100) + } + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_disableFormsUpdate_0500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : ["0"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_0500 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_disableFormsUpdate_0600 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.The form user calls the disable update interface. + * 2.Verify the result of the disable update interface. + */ + it(`FMS_disableFormsUpdate_0600`, 0, async (done) => { + console.info(`FMS_disableFormsUpdate_0600 start`); + let hostFormId; + + const onDisableCallback = (_, data) => { + if (data.parameters.kind != "disable") { + return; + } + console.debug("====>FMS_disableFormsUpdate_0600 onDisableCallback data:====>" + JSON.stringify(data)); + + expect(data.data).assertEqual("13"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnDisableCallback("FMS_disableFormsUpdate_0600")); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_disableFormsUpdate_0600")); + const commonEventPublishData = { + data: hostFormId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_disableFormsUpdate_0600 publish' + JSON.stringify(err)); + }); + } + + const onAcquiredCallBack = async (_, data) => { + console.debug("====>FMS_disableFormsUpdate_0600 onAcquiredCallback data:====>" + JSON.stringify(data)); + hostFormId = data.data; + + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": hostFormId, + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "stateForm": "disable", + "stateIds": [hostFormId], + "isCreate": false + } + } + }).then((res: any) => { + console.debug(`FMS_disableFormsUpdate_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_disableFormsUpdate_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_disableFormsUpdate_0600")); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + commonEvent.subscribe(subscriberOnState, onDisableCallback); + console.info(`FMS_disableFormsUpdate_0600 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.debug(`FMS_disableFormsUpdate_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_disableFormsUpdate_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + }); + /** + * @tc.number: FMS_disableFormsUpdate_0700 + * @tc.name: formID id is error because formId is not exist + * @tc.desc: 1.The form user calls the disable update interface. + * 2.Verify the result of the disable update interface. + */ + it(`FMS_disableFormsUpdate_0700`, 0, async (done) => { + console.info(`FMS_disableFormsUpdate_0700 start`); + let hostFormId; + + const onDisableCallback = (_, data) => { + if (data.parameters.kind != "disable") { + return; + } + console.debug("====>FMS_disableFormsUpdate_0700 onDisableCallback data:====>" + JSON.stringify(data)); + + expect(data.data).assertEqual("13"); + commonEvent.unsubscribe(subscriberOnState, () => { + console.info("====>FMS_disableFormsUpdate_0700 unSubscribeOnDisableCallback====>"); + }); + done(); + } + + const onDeleteCallback = async (_, data) => { + console.debug("====>FMS_disableFormsUpdate_0700 onDeleteCallback data:====>" + JSON.stringify(data)); + hostFormId = data.parameters.formId; + + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "stateForm": "disable", + "stateIds": [hostFormId], + "isCreate": false + } + } + }).then((res: any) => { + console.debug(`FMS_disableFormsUpdate_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_disableFormsUpdate_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + commonEvent.unsubscribe(subscriberDel, () => { + console.info("====>FMS_disableFormsUpdate_0700 unSubscribeDelCallback====>"); + }); + } + + commonEvent.subscribe(subscriberDel, onDeleteCallback); + commonEvent.subscribe(subscriberOnState, onDisableCallback); + console.info(`FMS_disableFormsUpdate_0700 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "deleteForm": true, + "deleteId": "self", + "isCreate": true + } + } + }).then((res: any) => { + console.debug(`FMS_disableFormsUpdate_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_disableFormsUpdate_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + }); + /** + * @tc.number: FMS_disableFormsUpdate_0800 + * @tc.name: The form user has form permission. + * @tc.desc: 1.The form user calls the disable update interface. + * 2.Verify the result of the disable update interface. + */ + it(`FMS_disableFormsUpdate_0800`, 0, async (done) => { + console.log(`FMS_disableFormsUpdate_0800 start`); + let formId; + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_disableFormsUpdate_0800 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + formId = data.parameters.formId; + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_disableFormsUpdate_0800")); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_disableFormsUpdate_0800 publish' + JSON.stringify(err)); + }); + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_disableFormsUpdate_0800 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_0800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_0800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_0800 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_disableFormsUpdate_0900 + * @tc.name: There are correct and wrong formId in the form ID parameter list. + * @tc.desc: 1.The form user calls the disable update interface. + * 2.Verify the result of the disable update interface. + */ + it(`FMS_disableFormsUpdate_0900`, 0, async (done) => { + console.log(`FMS_disableFormsUpdate_0900 start`); + let formId; + + function OnDisableCallBack(_, data) { + console.info("!!!====>FMS_disableFormsUpdate_0900 OnDisableCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnDisableCallback("FMS_disableFormsUpdate_0900")); + + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_disableFormsUpdate_0900 publish' + JSON.stringify(err)); + }); + } + async function OnEnableCallBack(_, data) { + console.info("!!!====>FMS_disableFormsUpdate_0900 OnEnableCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnEnableCallback("FMS_disableFormsUpdate_0900")); + formId = data.parameters.formId; + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, OnDisableCallBack); + console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : [formId, "0"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbility end`); + } + + commonEvent.subscribe(subscriberOnState, OnEnableCallBack); + console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "enable", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_0900 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_disableFormsUpdate_1000 + * @tc.name: Set next refresh time is invalid when disable form. (cache data < 1k) + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Call the disableFormsUpdate interface. + * 3.Call the setFormNextRefreshTime interface and verify the form can not refresh. + */ + it(`FMS_disableFormsUpdate_1000`, 0, async (done) => { + console.log(`FMS_disableFormsUpdate_1000 start`); + let formId; + + // timer speed up + commonEvent.publish(`fms.time_speed`, { code: 100 }, () => { + console.log(`FMS_disableFormsUpdate_1000 time speed up`); + }); + + function onSupplyEventCallBack(_, data) { + console.debug("====>FMS_disableFormsUpdate_1000 onSupplyEventCallBack====>" + JSON.stringify(data)); + if ("onUpdate" == data.parameters.kind) { + console.debug("FMS_disableFormsUpdate_1000 error, onUpdate called."); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000")); + expect().assertFail(); + } + } + + function onFormDisableCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + console.debug("====>FMS_disableFormsUpdate_1000 onFormDisableCallBack====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000")); + expect(data.parameters.kind).assertEqual("disable"); + expect(data.data).assertEqual("0"); + + commonEvent.subscribe(subscriberSupply, onSupplyEventCallBack); + + setTimeout(() => { + // timer reset + commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { + console.log(`FMS_disableFormsUpdate_1000 time reset`); + }); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000")); + }, 9000); + + setTimeout(() => { + console.log(`FMS_disableFormsUpdate_1000 onFormDisableCallBack end`); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_disableFormsUpdate_1000 publish' + JSON.stringify(err)); + }); + }, 10000); + } + + async function onAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1000")); + console.debug("====>FMS_disableFormsUpdate_1000 onAcquiredCallBack====>" + JSON.stringify(data)); + expect(data.parameters.kind).assertEqual("visible"); + expect(data.data).assertEqual("0"); + formId = data.parameters.formId; + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); + console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility notify disable start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : [formId], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility notify disable end`); + } + + commonEvent.subscribe(subscriberOnState, onAcquiredCallBack); + console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicef.hmservice", + "ability" : "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true, + "stateIds" : ["self"], + "stateForm" : "visible" + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_1000 featureAbility.startAbility servicea end`); + }); + + /** + * @tc.number: FMS_disableFormsUpdate_1100 + * @tc.name: Set next refresh time is invalid when disable form. (cache data > 1k) + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Call the disableFormsUpdate interface. + * 3.Call the setFormNextRefreshTime interface and verify the form can not refresh. + */ + it(`FMS_disableFormsUpdate_1100`, 0, async (done) => { + console.log(`FMS_disableFormsUpdate_1100 start`); + let formId; + + // timer speed up + commonEvent.publish(`fms.time_speed`, { code: 100 }, () => { + console.log(`FMS_disableFormsUpdate_1100 time speed up`); + }); + + function onSupplyEventCallBack(_, data) { + console.debug("====>FMS_disableFormsUpdate_1100 onSupplyEventCallBack====>" + JSON.stringify(data)); + if ("onUpdate" == data.parameters.kind) { + console.debug("FMS_disableFormsUpdate_1100 error, onUpdate called."); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100")); + expect().assertFail(); + } + } + + function onFormDisableCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + console.debug("====>FMS_disableFormsUpdate_1100 onFormDisableCallBack====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100")); + expect(data.parameters.kind).assertEqual("disable"); + expect(data.data).assertEqual("0"); + + commonEvent.subscribe(subscriberSupply, onSupplyEventCallBack); + + setTimeout(() => { + // timer reset + commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { + console.log(`FMS_disableFormsUpdate_1100 time reset`); + }); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100")); + }, 9000); + + setTimeout(() => { + console.log(`FMS_disableFormsUpdate_1100 onFormDisableCallBack end`); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_disableFormsUpdate_1100 publish' + JSON.stringify(err)); + }); + }, 10000); + } + + async function onAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_disableFormsUpdate_1100")); + console.debug("====>FMS_disableFormsUpdate_1100 onAcquiredCallBack====>" + JSON.stringify(data)); + expect(data.parameters.kind).assertEqual("visible"); + expect(data.data).assertEqual("0"); + formId = data.parameters.formId; + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); + console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility notify disable start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : [formId], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility notify disable end`); + } + + commonEvent.subscribe(subscriberOnState, onAcquiredCallBack); + console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviceg.hmservice", + "ability" : "com.form.formsystemtestserviceg.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true, + "stateIds" : ["self"], + "stateForm" : "visible" + } + } + }).then((res: any) => { + console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_disableFormsUpdate_1100 featureAbility.startAbility servicea end`); + }); + }); +} + +const sleep = async delay => { + return new Promise((resolve, _) => { + setTimeout(async () => { + resolve(0); + }, delay); + }); +}; + +const delPublishCallback = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000); +} + +const unsubscribeOnStateCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); +} + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); +} + +const unsubscribeOnDisableCallback = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnDisableCallback====>`); +} + +const unsubscribeOnEnableCallback = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnEnableCallback====>`); +} + +const unsubscribeSupplyCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..d9c46ec7a --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsFormStateDisable.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..39fe2a50c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formdisablestatetest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_disable/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json new file mode 100644 index 000000000..6de3637f2 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json @@ -0,0 +1,25 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formstateenabletest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormStateEnableTest.hap", + "FormSystemHostF.hap", + "FormSystemHostG.hap", + "FormSystemHostNoPerm.hap", + "FormSupplyAppA.hap", + "FormSupplyAppE.hap", + "FormSupplyAppF.hap", + "FormSupplyAppH.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json new file mode 100644 index 000000000..5f7229632 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json @@ -0,0 +1,150 @@ +{ + "app": { + "bundleName": "com.ohos.st.formstateenabletest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formstateenabletest", + "name": ".FormStateSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnState_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent", + "reason": "need use OnError commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent", + "reason": "need use OnDeleted commonEvent" + }, + { + "name": "FMS_FormOnState_commonEvent", + "reason": "need use OnState commonEvent" + }, + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..11c5d70c4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..2178a7f80 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 30000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Main Ability Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets new file mode 100644 index 000000000..26a756d3c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets @@ -0,0 +1,904 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; + +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; + +var onDeletedFormEvent = { + events: ["FMS_FormOnDeleted_commonEvent"], +}; + +var onStateFormEvent = { + events: ["FMS_FormOnState_commonEvent"], +}; + +var onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + +var subscriberOnAcquired; +var subscriberDel; +var subscriberOnState; +var subscriberSupply; + +export default function test() { + describe(`FmsStateFormTest`, () => { + + beforeAll(async (done) => { + done(); + }) + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent); + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + await sleep(1000); + }) + + /** + * @tc.number: FMS_enableFormsUpdate_0200 + * @tc.name: The form user does not have permission. + * @tc.desc: 1.The form user calls the enable update interface. + * 2.Verify the result of the enable update interface. + */ + it(`FMS_enableFormsUpdate_0200`, 0, async (done) => { + console.log(`FMS_enableFormsUpdate_0200 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_enableFormsUpdate_0200 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("2"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0200")); + setTimeout(function () { + console.info('FMS_enableFormsUpdate_0200 onStateCallBack end'); + console.log(`FMS_enableFormsUpdate_0200 end`); + done(); + }, 1000); + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_enableFormsUpdate_0200 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostnoperm", + abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "enable", + "stateIds" : ["1"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_0200 featureAbility.startAbility again end`); + }); + /** + * @tc.number: FMS_enableFormsUpdate_0300 + * @tc.name: The length of the formId list is 0 (no formId) + * @tc.desc: 1.The form user calls the enable update interface. + * 2.Verify the result of the enable update interface. + */ + it(`FMS_enableFormsUpdate_0300`, 0, async (done) => { + console.log(`FMS_enableFormsUpdate_0300 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_enableFormsUpdate_0300 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("7"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0300")) + + setTimeout(function () { + console.info('FMS_enableFormsUpdate_0300 delPublishCallBack end'); + console.log(`FMS_enableFormsUpdate_0300 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_enableFormsUpdate_0300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "enable", + "stateIds" : [], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_0300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_enableFormsUpdate_0400 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.The form user calls the enable update interface. + * 2.Verify the result of the enable update interface. + */ + it(`FMS_enableFormsUpdate_0400`, 0, async (done) => { + console.log(`FMS_enableFormsUpdate_0400 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_enableFormsUpdate_0400 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("13"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0400")) + + setTimeout(function () { + console.info('FMS_enableFormsUpdate_0400 delPublishCallBack end'); + console.log(`FMS_enableFormsUpdate_0400 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_enableFormsUpdate_0400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "enable", + "stateIds" : ["-1"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_0400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_enableFormsUpdate_0500 + * @tc.name: formID id is error(formID == 0) + * @tc.desc: 1.The form user calls the enable update interface. + * 2.Verify the result of the enable update interface. + */ + it(`FMS_enableFormsUpdate_0500`, 0, async (done) => { + console.log(`FMS_enableFormsUpdate_0500 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_enableFormsUpdate_0500 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("13"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0500")) + + setTimeout(function () { + console.info('FMS_enableFormsUpdate_0500 delPublishCallBack end'); + console.log(`FMS_enableFormsUpdate_0500 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_enableFormsUpdate_0500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "enable", + "stateIds" : ["0"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_0500 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_enableFormsUpdate_0600 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.The form user calls the enable update interface. + * 2.Verify the result of the enable update interface. + */ + it(`FMS_enableFormsUpdate_0600`, 0, async (done) => { + console.info(`FMS_enableFormsUpdate_0600 start`); + let hostFormId; + + const onEnableCallback = (_, data) => { + if (data.parameters.kind != "enable") { + return; + } + console.debug("====>FMS_enableFormsUpdate_0600 onEnableCallback data:====>" + JSON.stringify(data)); + + expect(data.data).assertEqual("13"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_enableFormsUpdate_0600")); + const commonEventPublishData = { + data: hostFormId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_enableFormsUpdate_0600 publish' + JSON.stringify(err)); + }); + } + + const onAcquiredCallBack = async (_, data) => { + console.debug("====>FMS_enableFormsUpdate_0600 onAcquiredCallback data:====>" + JSON.stringify(data)); + hostFormId = data.data; + + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": hostFormId, + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "stateForm": "enable", + "stateIds": [hostFormId], + "isCreate": false + } + } + }).then((res: any) => { + console.debug(`FMS_enableFormsUpdate_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_enableFormsUpdate_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_enableFormsUpdate_0600")); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + commonEvent.subscribe(subscriberOnState, onEnableCallback); + console.info(`FMS_enableFormsUpdate_0600 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "isCreate": true + } + } + }).then((res: any) => { + console.debug(`FMS_enableFormsUpdate_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_enableFormsUpdate_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + }); + /** + * @tc.number: FMS_enableFormsUpdate_0700 + * @tc.name: formID id is error because formId is not exist + * @tc.desc: 1.The form user calls the enable update interface. + * 2.Verify the result of the enable update interface. + */ + it(`FMS_enableFormsUpdate_0700`, 0, async (done) => { + console.info(`FMS_enableFormsUpdate_0700 start`); + let hostFormId; + + const onEnableCallback = (_, data) => { + if (data.parameters.kind != "enable") { + return; + } + console.debug("====>FMS_enableFormsUpdate_0700 onEnableCallback data:====>" + JSON.stringify(data)); + + expect(data.data).assertEqual("13"); + commonEvent.unsubscribe(subscriberOnState, () => { + console.info("====>FMS_enableFormsUpdate_0700 unSubscribeOnEnableCallback====>"); + }); + done(); + } + + const onDeleteCallback = async (_, data) => { + console.debug("====>FMS_enableFormsUpdate_0700 onDeleteCallback data:====>" + JSON.stringify(data)); + hostFormId = data.parameters.formId; + + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "stateForm": "enable", + "stateIds": [hostFormId], + "isCreate": false + } + } + }).then((res: any) => { + console.debug(`FMS_enableFormsUpdate_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_enableFormsUpdate_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + commonEvent.unsubscribe(subscriberDel, () => { + console.info("====>FMS_enableFormsUpdate_0700 unSubscribeDelCallback====>"); + }); + } + + commonEvent.subscribe(subscriberDel, onDeleteCallback); + commonEvent.subscribe(subscriberOnState, onEnableCallback); + console.info(`FMS_enableFormsUpdate_0700 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "deleteForm": true, + "deleteId": "self", + "isCreate": true + } + } + }).then((res: any) => { + console.debug(`FMS_enableFormsUpdate_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_enableFormsUpdate_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + }); + + /** + * @tc.number: FMS_enableFormsUpdate_0900 + * @tc.name: Use -1 form Id and created 2 form card Id notify the form to be invisible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_enableFormsUpdate_0900`, 0, async (done) => { + console.log(`FMS_enableFormsUpdate_0900 start`); + let formIds = []; + + // timer speed up + commonEvent.publish(`fms.time_speed`, { code: 300 }, () => { + console.log(`FMS_enableFormsUpdate_0900 time speed up`); + }); + + function onUpdateCallBack(_, data) { + if (data.parameters.kind == "onUpdate") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_0900 onUpdateCallBack====>" + JSON.stringify(data)); + expect(data.parameters.parameters).assertEqual(formIds[0]); + + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); + + commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { + console.log(`FMS_enableFormsUpdate_0900 time reset`); + }); + + setTimeout(() => { + let commonEventPublishData = { + data: formIds[0] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_enableFormsUpdate_0900 publish' + JSON.stringify(err)); + }); + }, 2000); + } + } + + function onFormEnableCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_0900 onFormEnableCallBack====>" + JSON.stringify(data)); + expect(data.parameters.formId).assertEqual(formIds[0]); + expect(data.parameters.kind).assertEqual("enable"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); + } + + async function onFormDisableCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_0900 onFormDisableCallBack====>" + JSON.stringify(data)); + expect(data.parameters.formId).assertEqual(formIds[0]); + expect(data.parameters.kind).assertEqual("disable"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, onFormEnableCallBack); + commonEvent.subscribe(subscriberSupply, onUpdateCallBack); + + setTimeout(async () => { + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notifyVisible start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "enable", + "stateIds" : formIds, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notifyVisible end`); + }, 10000); + } + + async function onAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); + console.debug("====>FMS_enableFormsUpdate_0900 onAcquiredCallBack====>" + JSON.stringify(data)); + formIds.push(data.data); + + commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notify disable start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : formIds, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notify disable end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicee.hmservice", + "ability" : "com.form.formsystemtestservicee.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility servicea end`); + }); + + /** + * @tc.number: FMS_enableFormsUpdate_1000 + * @tc.name: Use -1 form Id and created 2 form card Id notify the form to be invisible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_enableFormsUpdate_1000`, 0, async (done) => { + console.log(`FMS_enableFormsUpdate_1000 start`); + let formIds = []; + + // timer speed up + commonEvent.publish(`fms.time_speed`, { code: 300 }, () => { + console.log(`FMS_enableFormsUpdate_1000 time speed up`); + }); + + function onUpdateCallBack(_, data) { + if (data.parameters.kind == "onUpdate") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_1000 onUpdateCallBack====>" + JSON.stringify(data)); + expect(data.parameters.parameters).assertEqual(formIds[0]); + + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1000")); + + commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { + console.log(`FMS_enableFormsUpdate_1000 time reset`); + }); + + setTimeout(() => { + let commonEventPublishData = { + data: formIds[0] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_enableFormsUpdate_1000 publish' + JSON.stringify(err)); + }); + }, 2000); + } + } + + function onFormEnableCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_1000 onFormEnableCallBack====>" + JSON.stringify(data)); + expect(data.parameters.formId).assertEqual(formIds[0]); + expect(data.parameters.kind).assertEqual("enable"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1000")); + } + + async function onFormDisableCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_1000 onFormDisableCallBack====>" + JSON.stringify(data)); + expect(data.parameters.formId).assertEqual(formIds[0]); + expect(data.parameters.kind).assertEqual("disable"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1000")); + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, onFormEnableCallBack); + commonEvent.subscribe(subscriberSupply, onUpdateCallBack); + + setTimeout(async () => { + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility notifyVisible start`); + formIds.push("0"); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "enable", + "stateIds" : formIds, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility notifyVisible end`); + }, 10000); + } + + function onAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1000")); + console.debug("====>FMS_enableFormsUpdate_1000 onAcquiredCallBack====>" + JSON.stringify(data)); + formIds.push(data.data); + commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility notify disable start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : formIds, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility notify disable end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicee.hmservice", + "ability" : "com.form.formsystemtestservicee.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility servicea end`); + }); + + /** + * @tc.number: FMS_enableFormsUpdate_1200 + * @tc.name: Use -1 form Id and created 2 form card Id notify the form to be visible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_enableFormsUpdate_1200`, 0, async (done) => { + console.log(`FMS_enableFormsUpdate_1200 start`); + let formIds = new Array(); + let count = 0; + + // timer speed up + commonEvent.publish(`fms.time_speed`, { code: 300 }, () => { + console.log(`FMS_enableFormsUpdate_1200 time speed up`); + }); + + function delPublishCallBack1(_, data) { + console.info("!!!====>FMS_enableFormsUpdate_1200 delPublishCallBack1====>" + JSON.stringify(data)); + setTimeout(function () { + console.info('FMS_enableFormsUpdate_1200 delPublishCallBack1 end'); + console.log(`FMS_enableFormsUpdate_1200 end`); + }, 1000); + } + function delPublishCallBack2(_, data) { + console.info("!!!====>FMS_enableFormsUpdate_1200 delPublishCallBack2====>" + JSON.stringify(data)); + setTimeout(function () { + console.info('FMS_enableFormsUpdate_1200 delPublishCallBack2 end'); + console.log(`FMS_enableFormsUpdate_1200 end`); + done(); + }, 1000); + } + + function onUpdateCallBack(_, data) { + if (data.parameters.kind == "onUpdate") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_1200 onUpdateCallBack====>" + JSON.stringify(data)); + expect(formIds.includes(data.parameters.parameters)).assertEqual(true); + + ++count; + if (count == 2) { + console.debug("====>FMS_enableFormsUpdate_1200 OK====>"); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); + + commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { + console.log(`FMS_enableFormsUpdate_1200 time reset`); + }); + + setTimeout(() => { + let commonEventPublishData1 = { + data: formIds[0] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData1, delPublishCallBack1); + let commonEventPublishData2 = { + data: formIds[1] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack2); + }, 2000); + } + } + } + + function onFormEnableCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_1200 onFormEnableCallBack====>" + JSON.stringify(data)); + expect(data.parameters.kind).assertEqual("enable"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); + } + + async function onFormDisableCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + console.debug("====>FMS_enableFormsUpdate_1200 onFormDisableCallBack====>" + JSON.stringify(data)); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, onFormEnableCallBack); + commonEvent.subscribe(subscriberSupply, onUpdateCallBack); + setTimeout(async () => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility notifyVisible start`); + formIds.push("0"); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "enable", + "stateIds" : formIds, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility notifyVisible end`); + }, 10000); + } + + async function onSecondAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); + console.debug("====>FMS_enableFormsUpdate_1200 onSecondAcquiredCallBack====>" + JSON.stringify(data)); + formIds.push(data.data); + console.debug("====>FMS_enableFormsUpdate_1200 formIds====>" + formIds); + + commonEvent.subscribe(subscriberOnState, onFormDisableCallBack); + + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility notify disable start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "disable", + "stateIds" : formIds, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility notify disable end`); + } + + async function onFirstAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_1200")); + console.debug("====>FMS_enableFormsUpdate_1200 onFirstAcquiredCallBack====>" + JSON.stringify(data)); + formIds.push(data.data); + + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onSecondAcquiredCallBack); + + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility serviceb start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviceh.hmservice", + "ability" : "com.form.formsystemtestserviceh.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility serviceb end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onFirstAcquiredCallBack); + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicee.hmservice", + "ability" : "com.form.formsystemtestservicee.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility servicea end`); + }); + }); +} + +const sleep = async delay => { + return new Promise((resolve, _) => { + setTimeout(async () => { + resolve(0); + }, delay); + }); +}; + +const delPublishCallback = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000); +} + +const unsubscribeOnStateCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); +} + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); +} + +const unsubscribeSupplyCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..9ef8fc567 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsFormStateEnable.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..f89b18b0b --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formenablestatetest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_enable/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/Test.json new file mode 100644 index 000000000..5f8892ba8 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/Test.json @@ -0,0 +1,23 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formstatenotifyinvisibletest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormStateNotifyInvisibleTest.hap", + "FormSystemHostF.hap", + "FormSystemHostG.hap", + "FormSystemHostNoPerm.hap", + "FormSupplyAppA.hap", + "FormSupplyAppF.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json new file mode 100644 index 000000000..5c76a92a5 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json @@ -0,0 +1,150 @@ +{ + "app": { + "bundleName": "com.ohos.st.formstatenotifyinvisibletest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formstatenotifyinvisibletest", + "name": ".FormStateSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnState_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent", + "reason": "need use OnError commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent", + "reason": "need use OnDeleted commonEvent" + }, + { + "name": "FMS_FormOnState_commonEvent", + "reason": "need use OnState commonEvent" + }, + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..11c5d70c4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..9ec7ce2d6 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 10000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Main Ability Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets new file mode 100644 index 000000000..d24d94f6e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets @@ -0,0 +1,544 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { describe, beforeEach, expect, it } from "deccjsunit/index"; + +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; + +var onDeletedFormEvent = { + events: ["FMS_FormOnDeleted_commonEvent"], +}; + +var onStateFormEvent = { + events: ["FMS_FormOnState_commonEvent"], +}; + +var onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + +var subscriberOnAcquired; +var subscriberDel; +var subscriberOnState; +var subscriberSupply; + +export default function test() { + describe(`FmsStateFormTest`, () => { + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberDel = await commonEvent.createSubscriber(onDeletedFormEvent); + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + await sleep(1000); + }) + + /** + * @tc.number: FMS_notifyInvisibleForms_0200 + * @tc.name: The form user does not have permission. + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_0200`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_0200 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0200 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("2"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0200")); + setTimeout(function () { + console.info('FMS_notifyInvisibleForms_0200 onStateCallBack end'); + console.log(`FMS_notifyInvisibleForms_0200 end`); + done(); + }, 1000) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyInvisibleForms_0200 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostnoperm", + abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : ["1"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0200 featureAbility.startAbility again end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_0300 + * @tc.name: The length of the formId list is 0 (no formId) + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_0300`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_0300 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0300 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("7"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0300")) + + setTimeout(function () { + console.info('FMS_notifyInvisibleForms_0300 delPublishCallBack end'); + console.log(`FMS_notifyInvisibleForms_0300 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyInvisibleForms_0300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : [], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_0400 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_0400`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_0400 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0400 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0400")) + + setTimeout(function () { + console.info('FMS_notifyInvisibleForms_0400 delPublishCallBack end'); + console.log(`FMS_notifyInvisibleForms_0400 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyInvisibleForms_0400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : ["-1"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_0500 + * @tc.name: formID id is error(formID == 0) + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_0500`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_0500 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0500 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0500")) + + setTimeout(function () { + console.info('FMS_notifyInvisibleForms_0500 delPublishCallBack end'); + console.log(`FMS_notifyInvisibleForms_0500 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyInvisibleForms_0500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : ["0"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0500 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_0600 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_0600`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_0600 start`); + let formId; + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0600 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0600")); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_notifyInvisibleForms_0600 publish' + JSON.stringify(err)); + }); + } + + async function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0600 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_notifyInvisibleForms_0600")) + formId = data.data; + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : [formId], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0600 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_0700 + * @tc.name: form has been deleted + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_0700`, 0, async (done) => { + console.info(`FMS_notifyInvisibleForms_0700 start`); + let hostFormId; + + const onSupplyCallback = (_, data) => { + if (data.parameters.kind != "onVisibilityChange") { + return; + } + console.debug("====>FMS_notifyInvisibleForms_0700 onSupplyCallback data:====>" + JSON.stringify(data)); + expect().assertFail(); + } + + const onInvisibleCallback = (_, data) => { + if (data.parameters.kind != "invisible") { + return; + } + console.debug("====>FMS_notifyInvisibleForms_0700 onInvisibleCallback data:====>" + JSON.stringify(data)); + + expect(data.data).assertEqual("0"); + expect(data.parameters.formId).assertEqual(hostFormId); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0700")); + setTimeout(() => { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_0700")); + done(); + }, 2000); + } + + const onDeleteCallback = async (_, data) => { + console.debug("====>FMS_notifyInvisibleForms_0700 onDeleteCallback data:====>" + JSON.stringify(data)); + hostFormId = data.parameters.formId; + + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "stateForm": "invisible", + "stateIds": [hostFormId], + "isCreate": false + } + } + }).then((res: any) => { + console.debug(`FMS_notifyInvisibleForms_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_notifyInvisibleForms_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + commonEvent.unsubscribe(subscriberDel, () => { + console.info("====>FMS_notifyInvisibleForms_0700 unSubscribeDelCallback====>"); + }); + } + + commonEvent.subscribe(subscriberDel, onDeleteCallback); + commonEvent.subscribe(subscriberOnState, onInvisibleCallback); + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + console.info(`FMS_notifyInvisibleForms_0700 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "deleteForm": true, + "deleteId": "self", + "isCreate": true + } + } + }).then((res: any) => { + console.debug(`FMS_notifyInvisibleForms_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_notifyInvisibleForms_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_0800 + * @tc.name: The form provider is the system application and config When form visiblenotify is true, + * the form provider can be notified that the form is invisible. + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_0800`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_0800 start`); + let formIdInvisible; + let formIdVisible; + let onSupplyCount = 0; + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyInvisibleForms_0800 onSupplyCallBack====>" + JSON.stringify(data)); + onSupplyCount++; + if (onSupplyCount == 2) { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_0800")); + } + if (formIdInvisible && formIdVisible) { + let commonEventPublishData = { + data: formIdInvisible + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_notifyInvisibleForms_0800 publish' + JSON.stringify(err)); + }); + } + } + } + + function OnInvisibleCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0800 OnInvisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + formIdInvisible = data.parameters.formId; + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0800")); + if (formIdInvisible && formIdVisible && onSupplyCount == 2) { + let commonEventPublishData = { + data: formIdInvisible + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_notifyInvisibleForms_0600 publish' + JSON.stringify(err)); + }); + } + } + async function onVisibleCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0800 onVisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0800")); + formIdVisible = data.parameters.formId; + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, OnInvisibleCallBack); + console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : [formIdVisible], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnState, onVisibleCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0800 featureAbility.startAbility end`); + }); + }); +} + +const sleep = async delay => { + return new Promise((resolve, _) => { + setTimeout(async () => { + resolve(0); + }, delay); + }); +}; + +const delPublishCallback = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000); +} + +const unsubscribeOnStateCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); +} + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); +} + +const unsubscribeSupplyCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..9391dbd80 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsFormStateNotifyInvisible.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..88745269a --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "forminvisiblestatetest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/BUILD.gn new file mode 100644 index 000000000..a9c532b53 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsFormStateNotifyInvisible2Test") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsFormStateNotifyInvisible2Test" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/ets/MainAbility" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/Test.json new file mode 100644 index 000000000..c5dcc8507 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/Test.json @@ -0,0 +1,24 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formstatenotifyinvisibletest2", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormStateNotifyInvisible2Test.hap", + "FormSystemHostG.hap", + "FormSupplyAppA.hap", + "FormSupplyAppB.hap", + "FormSupplyAppD.hap", + "FormSupplyAppF.hap", + "FormSupplyAppNS.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json new file mode 100644 index 000000000..a9d894448 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json @@ -0,0 +1,150 @@ +{ + "app": { + "bundleName": "com.ohos.st.formstatenotifyinvisibletest2", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formstatenotifyinvisibletest2", + "name": ".FormStateSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnState_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent", + "reason": "need use OnError commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent", + "reason": "need use OnDeleted commonEvent" + }, + { + "name": "FMS_FormOnState_commonEvent", + "reason": "need use OnState commonEvent" + }, + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..11c5d70c4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..9ec7ce2d6 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 10000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Main Ability Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets new file mode 100644 index 000000000..6e24fc901 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets @@ -0,0 +1,821 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { beforeEach, describe, expect, it } from "deccjsunit/index"; + +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; + +var onStateFormEvent = { + events: ["FMS_FormOnState_commonEvent"], +}; + +var onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + +var subscriberOnAcquired; +var subscriberOnState; +var subscriberSupply; + +export default function test() { + + describe(`FmsStateFormTest`, () => { + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + await sleep(1000); + }) + + /** + * @tc.number: FMS_notifyInvisibleForms_0900 + * @tc.name: There are correct and wrong formId in the form ID parameter list + * that informs that the form is invisible. + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_0900`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_0900 start`); + let formIdInvisible; + let formIdVisible; + let onSupplyCount = 0; + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyInvisibleForms_0900 onSupplyCallBack====>" + JSON.stringify(data)); + onSupplyCount++; + if (onSupplyCount == 2) { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_0900")); + } + if (formIdInvisible && formIdVisible) { + let commonEventPublishData = { + data: formIdInvisible + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_notifyInvisibleForms_0900 publish' + JSON.stringify(err)); + }); + } + } + } + + function OnInvisibleCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0900 OnInvisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + formIdInvisible = data.parameters.formId; + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0900")); + if (formIdInvisible && formIdVisible && onSupplyCount == 2) { + let commonEventPublishData = { + data: formIdInvisible + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { + console.info('FMS_notifyInvisibleForms_0900 publish' + JSON.stringify(err)); + }); + } + } + async function onVisibleCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_0900 onVisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_0900")); + formIdVisible = data.parameters.formId; + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, OnInvisibleCallBack); + console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : [formIdVisible, "0"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnState, onVisibleCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_0900 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_1000 + * @tc.name: When the form provider is not a system application, notify the form to be invisible + * and do not pull up the form provider. + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_1000`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_1000 start`); + + function onVisibleCallBack(_, data) { + if (data.parameters.kind != "invisible") { + return; + } + console.info("!!!====>FMS_notifyInvisibleForms_1000 onVisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + + setTimeout(function () { + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1000")); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1000")); + + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, () => delPublishCallback("FMS_notifyInvisibleForms_1000",done)); + }, 2000); + } + function onSupplyEventCallBack(_, data) { + if (data.parameters.kind != "onVisibilityChange") { + return; + } + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1000")); + console.debug("====>FMS_notifyInvisibleForms_1000 onSupplyEventCallBack====>" + JSON.stringify(data)); + console.log(`FMS_notifyInvisibleForms_1000 error`); + expect().assertFail(); + } + commonEvent.subscribe(subscriberOnState, onVisibleCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyEventCallBack); + console.log(`FMS_notifyInvisibleForms_1000 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicenotsysapp.hmservice", + "ability" : "com.form.formsystemtestservicenotsysapp.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_1000 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_1100 + * @tc.name: When formVisibleNotify is false in config.json, + * the form provider will not be pulled when the card is invisible. + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_1100`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_1100 start`); + let supplyFlag = false; + let formIdInvisible; + let formIdVisible; + + function delPublishCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1100 delPublishCallBack====>"); + setTimeout(function () { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1100")); + if (supplyFlag) { + expect().assertFail(); + } + console.info('FMS_notifyInvisibleForms_1100 delPublishCallBack end'); + console.log(`FMS_notifyInvisibleForms_1100 end`); + done(); + }, 1000); + } + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyInvisibleForms_1100 onSupplyCallBack====>" + JSON.stringify(data)); + supplyFlag = true; + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1100")); + + if (formIdInvisible && formIdVisible) { + let commonEventPublishData = { + data: formIdInvisible + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); + } + } + } + + function OnInvisibleCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1100 OnInvisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + formIdInvisible = data.parameters.formId; + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1100")); + if (formIdInvisible && formIdVisible) { + let commonEventPublishData = { + data: formIdInvisible + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); + } + } + async function onVisibleCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1100 onVisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1100")); + formIdVisible = data.parameters.formId; + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, OnInvisibleCallBack); + + console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviced.hmservice", + "ability" : "com.form.formsystemtestserviced.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : [formIdVisible], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnState, onVisibleCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviced.hmservice", + "ability" : "com.form.formsystemtestserviced.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_1100 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_1200 + * @tc.name: When formVisibleNotify in config.json is true, + * the provider can be notified of the visibility of the form. + * @tc.desc: 1. The form is created successfully. + * 2. The invisible interface is invoked successfully, + * and the visibility notification of form providers A and B is triggered. + * The formId is the same as the created formId, and the visibility status is invisible. + */ + it(`FMS_notifyInvisibleForms_1200`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_1200 start`); + let formId1; + let formId2; + let delCount = 0; + let onSupplyCount = 0; + + function delPublishCallBack() { + console.info("!!!====>FMS_notifyInvisibleForms_1200 delPublishCallBack====>"); + delCount++; + if (delCount == 2) { + setTimeout(function () { + console.info('FMS_notifyInvisibleForms_1200 delPublishCallBack end'); + console.info('FMS_notifyInvisibleForms_1200 end'); + done(); + }, 500); + } + } + function onAcquiredCallBack_Normal1(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1200 onAcquiredCallBack_Normal1 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal1) + formId1 = data.data; + + FMS_notifyInvisibleForms_1200_normal2(); + } + function unSubscribeOnAcquiredCallBack_Normal1() { + console.debug("====>FMS_notifyInvisibleForms_1200 unSubscribeOnAcquiredCallBack_Normal1 CallBack====>"); + } + + async function FMS_notifyInvisibleForms_1200_normal1() { + console.log(`FMS_notifyInvisibleForms_1200_normal1 start`); + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal1); + console.log(`FMS_notifyInvisibleForms_1200_normal1 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1200_normal1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1200_normal1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.log(`FMS_notifyInvisibleForms_1200_normal1 featureAbility.startAbility end`); + console.log(`FMS_notifyInvisibleForms_1200_normal1 end`); + } + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1200 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1200")) + console.info("!!!====>FMS_notifyInvisibleForms_1200 onStateCallBack formId1:====>" + formId1); + console.info("!!!====>FMS_notifyInvisibleForms_1200 onStateCallBack formId2:====>" + formId2); + console.info("!!!====>FMS_notifyInvisibleForms_1200 onStateCallBack onSupplyCount:====>" + onSupplyCount); + if (formId1 && formId2 && onSupplyCount == 2) { + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); + let commonEventPublishData2 = { + data: formId2 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack); + } + } + + async function onAcquiredCallBack_Normal2(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1200 onAcquiredCallBack_Normal2 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal2); + formId2 = data.data; + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyInvisibleForms_1200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : [formId1, formId2], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_1200 featureAbility.startAbility end`); + } + function unSubscribeOnAcquiredCallBack_Normal2() { + console.debug("====>FMS_notifyInvisibleForms_1200 unSubscribeOnAcquiredCallBack_Normal2====>"); + } + async function FMS_notifyInvisibleForms_1200_normal2() { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal2); + console.log(`FMS_notifyInvisibleForms_1200_normal2 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviceb.hmservice", + "ability" : "com.form.formsystemtestserviceb.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1200_normal2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1200_normal2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.log(`FMS_notifyInvisibleForms_1200_normal2 featureAbility.startAbility end`); + } + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyInvisibleForms_1200 onSupplyCallBack====>" + JSON.stringify(data)); + let parameters = JSON.parse(data.parameters.parameters); + if(parameters[formId1]) { + expect(parameters[formId1]).assertEqual(2); + } + if(parameters[formId2]) { + expect(parameters[formId2]).assertEqual(2); + } + + onSupplyCount++; + if (onSupplyCount == 2) { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1200")); + } + if (formId1 && formId2) { + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); + let commonEventPublishData2 = { + data: formId2 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack); + } + } + } + + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + FMS_notifyInvisibleForms_1200_normal1(); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_1300 + * @tc.name: When formVisibleNotify is true in config.json, + * the form provider will be pulled when the card is invisible. + * @tc.desc: 1.The form user calls the invisible notification interface. + * 2.Verify the result of the invisible notification interface. + */ + it(`FMS_notifyInvisibleForms_1300`, 0, async (done) => { + console.info(`FMS_notifyInvisibleForms_1300 start`); + let hostFormId; + let providerFormId; + let counter = 0; + + const delPublishCallback = (_, data) => { + console.info("!!!====>FMS_notifyInvisibleForms_1300 delPublishCallback====>"); + setTimeout(() => { + expect(hostFormId).assertEqual(providerFormId); + console.info('FMS_notifyInvisibleForms_1300 delPublishCallback end'); + console.info(`FMS_notifyInvisibleForms_1300 end`); + done(); + }, 1000); + } + + const onSupplyCallback = (_, data) => { + if (data.parameters.kind != "onVisibilityChange") { + return; + } + console.debug("====>FMS_notifyInvisibleForms_1300 onSupplyCallback data:====>" + JSON.stringify(data)); + providerFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; + const visibilityStatus = JSON.parse(data.parameters.parameters)[providerFormId]; + + expect(visibilityStatus).assertEqual(2); + commonEvent.unsubscribe(subscriberSupply, () => { + console.info("====>FMS_notifyInvisibleForms_1300 unSubscribeSupplyCallback====>"); + }); + if (++counter == 2) { + const commonEventPublishData = { + data: providerFormId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + } + } + + const onInvisibleCallback = (_, data) => { + if (data.parameters.kind != "invisible") { + return; + } + console.debug("====>FMS_notifyInvisibleForms_1300 onInvisibleCallback data:====>" + JSON.stringify(data)); + hostFormId = data.parameters.formId; + + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => { + console.info("====>FMS_notifyInvisibleForms_1300 unSubscribeOnInvisibleCallback====>"); + }); + if (++counter == 2) { + const commonEventPublishData = { + data: hostFormId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + } + } + + commonEvent.subscribe(subscriberOnState, onInvisibleCallback); + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + console.info(`FMS_notifyInvisibleForms_1300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "stateForm": "invisible", + "stateIds": ["self"], + "isCreate": true + } + } + }).then((res: any) => { + console.debug(`FMS_notifyInvisibleForms_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_notifyInvisibleForms_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + }); + + /** + * @tc.number: FMS_notifyInvisibleForms_1400 + * @tc.name: Use -1 form Id and created 2 form card Id notify the form to be invisible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyInvisibleForms_1400`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_1400 start`); + let formIds = new Array(); + let count = 0; + + function delPublishCallBack1(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1400 delPublishCallBack1====>" + JSON.stringify(data)); + setTimeout(function () { + console.info('FMS_notifyInvisibleForms_1400 delPublishCallBack1 end'); + console.log(`FMS_notifyInvisibleForms_1400 end`); + }, 1000); + } + function delPublishCallBack2(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1400 delPublishCallBack2====>" + JSON.stringify(data)); + setTimeout(function () { + console.info('FMS_notifyInvisibleForms_1400 delPublishCallBack2 end'); + console.log(`FMS_notifyInvisibleForms_1400 end`); + done(); + }, 1000); + } + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyInvisibleForms_1400 onSupplyCallBack====>" + JSON.stringify(data)); + + let retFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; + const visibilityStatus = JSON.parse(data.parameters.parameters)[retFormId]; + expect(formIds.includes(retFormId)).assertTrue(); + expect(visibilityStatus).assertEqual(2); + + ++count; + if (count == 2) { + console.debug("====>FMS_notifyInvisibleForms_1400 OK====>"); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1400")); + + let commonEventPublishData1 = { + data: formIds[0] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData1, delPublishCallBack1); + let commonEventPublishData2 = { + data: formIds[1] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack2); + } + } + } + + async function onSecondAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1400")); + console.debug("====>FMS_notifyInvisibleForms_1400 onSecondAcquiredCallBack====>" + JSON.stringify(data)); + formIds.push(data.data); + formIds.push("-1"); + console.debug("====>FMS_notifyInvisibleForms_1400 formIds====>" + formIds); + + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility notifyInVisible start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : formIds, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility notifyInVisible end`); + } + + async function onFirstAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_notifyInvisibleForms_1400")); + console.debug("====>FMS_notifyInvisibleForms_1400 onFirstAcquiredCallBack====>" + JSON.stringify(data)); + formIds.push(data.data); + + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onSecondAcquiredCallBack); + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility serviceb start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviceb.hmservice", + "ability" : "com.form.formsystemtestserviceb.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility serviceb end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onFirstAcquiredCallBack); + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_1400 featureAbility.startAbility servicea end`); + }); + /** + * @tc.number: FMS_notifyInvisibleForms_1500 + * @tc.name: The size of invisible form ids in the notification form array exceeds 32. + * @tc.desc: 1. Failed to invoke the invisibility interface (parameter error). + */ + it(`FMS_notifyInvisibleForms_1500`, 0, async (done) => { + console.log(`FMS_notifyInvisibleForms_1500 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyInvisibleForms_1500 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("7"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyInvisibleForms_1500")) + + setTimeout(function () { + console.info('FMS_notifyInvisibleForms_1500 delPublishCallBack end'); + console.log(`FMS_notifyInvisibleForms_1500 end`); + done(); + }, 100) + } + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyInvisibleForms_1500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : [ + "1","2","3","4","5","6","7","8","9","10","11","12","13","14", + "15","16","17","18","19","20","21","22","23","24","25","26", + "27","28","29","30","31","32","33" + ], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyInvisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyInvisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyInvisibleForms_1500 featureAbility.startAbility end`); + }); + }); +} + +const sleep = async delay => { + return new Promise((resolve, _) => { + setTimeout(async () => { + resolve(0); + }, delay); + }); +}; + +const delPublishCallback = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000); +} + +const unsubscribeOnStateCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); +} + +const unsubscribeSupplyCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..119c54c57 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsFormStateNotifyInvisible2.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..88745269a --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "forminvisiblestatetest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/Test.json new file mode 100644 index 000000000..29fa626d8 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/Test.json @@ -0,0 +1,29 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.ohos.st.formstatenotifyvisibletest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormStateNotifyVisibleTest.hap", + "FormSystemHostF.hap", + "FormSystemHostG.hap", + "FormSystemHostNoPerm.hap", + "FormSupplyAppA.hap", + "FormSupplyAppB.hap", + "FormSupplyAppD.hap", + "FormSupplyAppE.hap", + "FormSupplyAppF.hap", + "FormSupplyAppG.hap", + "FormSupplyAppH.hap", + "FormSupplyAppNS.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json new file mode 100644 index 000000000..15e46578e --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json @@ -0,0 +1,150 @@ +{ + "app": { + "bundleName": "com.ohos.st.formstatenotifyvisibletest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formstatenotifyvisibletest", + "name": ".FormStateSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnState_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent", + "reason": "need use OnError commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent", + "reason": "need use OnDeleted commonEvent" + }, + { + "name": "FMS_FormOnState_commonEvent", + "reason": "need use OnState commonEvent" + }, + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..11c5d70c4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..9ec7ce2d6 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 10000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Main Ability Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets new file mode 100644 index 000000000..5c71d84f7 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets @@ -0,0 +1,1383 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; + +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; + +var onStateFormEvent = { + events: ["FMS_FormOnState_commonEvent"], +}; + +var onSupplyEvent = { + events: ["FMS_FormSupply_commonEvent"], +}; + +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + +var subscriberOnAcquired; +var subscriberOnState; +var subscriberSupply; + +export default function test() { + describe(`FmsStateFormTest`, () => { + + beforeAll(async (done) => { + done(); + }) + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + await sleep(1000); + }) + + + /** + * @tc.number: FMS_notifyVisibleForms_0200 + * @tc.name: The form user does not have permission. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_0200`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_0200 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_0200 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("2"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0200")); + setTimeout(function () { + console.info('FMS_notifyVisibleForms_0200 onStateCallBack end'); + console.log(`FMS_notifyVisibleForms_0200 end`); + done(); + }, 1000) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyVisibleForms_0200 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostnoperm", + abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["1"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_0200 featureAbility.startAbility again end`); + }); + /** + * @tc.number: FMS_notifyVisibleForms_0300 + * @tc.name: The length of the formId list is 0 (no formId) + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_0300`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_0300 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_0300 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("7"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0300")); + + setTimeout(function () { + console.info('FMS_notifyVisibleForms_0300 delPublishCallBack end'); + console.log(`FMS_notifyVisibleForms_0300 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyVisibleForms_0300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : [], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_0300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyVisibleForms_0400 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_0400`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_0400 start`); + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_0400 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0400")) + + setTimeout(function () { + console.info('FMS_notifyVisibleForms_0400 delPublishCallBack end'); + console.log(`FMS_notifyVisibleForms_0400 end`); + done(); + }, 100) + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyVisibleForms_0400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["-1"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_0400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyVisibleForms_0500 + * @tc.name: formID id is error(formID == 0) + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_0500`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_0500 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_0500 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0500")) + + setTimeout(function () { + console.info('FMS_notifyVisibleForms_0500 delPublishCallBack end'); + console.log(`FMS_notifyVisibleForms_0500 end`); + done(); + }, 100); + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyVisibleForms_0500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["0"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_0500 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyVisibleForms_0600 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_0600`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_0600 start`); + let formId; + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_0600 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0600")); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallback("FMS_notifyVisibleForms_0600", done)); + } + async function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_0600 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_notifyVisibleForms_0600")) + formId = data.data; + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : [formId], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_0600 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyVisibleForms_0700 + * @tc.name: Form ID error (FormID does not exist) + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_0700`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_0700 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_0700 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_0700")); + + setTimeout(function () { + console.info('FMS_notifyVisibleForms_0700 onStateCallBack end'); + console.log(`FMS_notifyVisibleForms_0700 end`); + done(); + }, 100); + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyVisibleForms_0700 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["123456789"], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_0700 featureAbility.startAbility again end`); + }); + /** + * @tc.number: FMS_notifyVisibleForms_1000 + * @tc.name: The form provider is the system application and config When form visiblenotify is true, + * the form provider can be notified that the form is visible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_1000`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1000 start`); + let formIdInvisible; + let formIdVisible; + let onSupplyCount = 0; + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyVisibleForms_1000 onSupplyCallBack====>" + JSON.stringify(data)); + onSupplyCount++; + if (onSupplyCount == 2) { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1000")); + } + if (formIdInvisible && formIdVisible) { + let commonEventPublishData = { + data: formIdInvisible + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallback("FMS_notifyVisibleForms_1000", done)); + } + } + } + + function onVisibleCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1000 onVisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + formIdVisible = data.parameters.formId; + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1000")); + if (formIdInvisible && formIdVisible && onSupplyCount == 2) { + let commonEventPublishData = { + data: formIdInvisible + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallback("FMS_notifyVisibleForms_1000", done)); + } + } + async function OnInvisibleCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1000 OnInvisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1000")) + formIdInvisible = data.parameters.formId; + + subscriberOnState = await commonEvent.createSubscriber(onStateFormEvent); + commonEvent.subscribe(subscriberOnState, onVisibleCallBack); + console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbility again start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : [formIdInvisible], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbility again end`); + } + + commonEvent.subscribe(subscriberOnState, OnInvisibleCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "invisible", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1000 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyVisibleForms_1100 + * @tc.name: Use 0 and created form card Id notify the form to be visible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_1100`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1100 start`); + let assertFormId; + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1100")); + console.debug("====>FMS_notifyVisibleForms_1100 onSupplyCallBack====>" + JSON.stringify(data)); + let formId = Object.keys(JSON.parse(data.parameters.parameters))[0]; + const visibilityStatus = JSON.parse(data.parameters.parameters)[formId]; + expect(formId).assertEqual(assertFormId); + expect(visibilityStatus).assertEqual(1); + + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallback("FMS_notifyVisibleForms_1000", done)); + } + } + + function onVisibleCallBack(_, data) { + if (data.parameters.kind != "visible") { + return; + } + console.info("!!!====>FMS_notifyVisibleForms_1100 onVisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + assertFormId = data.parameters.formId; + + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1100")); + } + + commonEvent.subscribe(subscriberOnState, onVisibleCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.log(`FMS_notifyVisibleForms_1100 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["self", "0"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1100 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_notifyVisibleForms_1200 + * @tc.name: When the form provider is not a system application, notify the form to be visible + * and do not pull up the form provider. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_1200`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1200 start`); + + function onVisibleCallBack(_, data) { + if (data.parameters.kind != "visible") { + return; + } + console.info("!!!====>FMS_notifyVisibleForms_1200 onVisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + + setTimeout(function () { + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1200")); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1200")); + + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallback("FMS_notifyVisibleForms_1200", done)); + }, 2000); + } + function onSupplyEventCallBack(_, data) { + if (data.parameters.kind != "onVisibilityChange") { + return; + } + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1200")); + console.debug("====>FMS_notifyVisibleForms_1200 onSupplyEventCallBack====>" + JSON.stringify(data)); + console.log(`FMS_notifyVisibleForms_1200 error`); + expect().assertFail(); + } + + commonEvent.subscribe(subscriberOnState, onVisibleCallBack); + commonEvent.subscribe(subscriberSupply, onSupplyEventCallBack); + console.log(`FMS_notifyVisibleForms_1200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicenotsysapp.hmservice", + "ability" : "com.form.formsystemtestservicenotsysapp.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1200 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_notifyVisibleForms_1300 + * @tc.name: Provider onVisibleChange can not be called when formVisibleNotify is false. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the onVisibleChange interface. + */ + it(`FMS_notifyVisibleForms_1300`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1300 start`); + + function OnVisibleCallBack(_, data) { + if (data.parameters.kind != "visible") { + return; + } + console.info("!!!====>FMS_notifyVisibleForms_1300 OnVisibleCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1300")); + + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallback("FMS_notifyVisibleForms_1300", done)); + } + + commonEvent.subscribe(subscriberOnState, OnVisibleCallBack); + console.log(`FMS_notifyVisibleForms_1300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviced.hmservice", + "ability" : "com.form.formsystemtestserviced.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : ["self"], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_notifyVisibleForms_1400 + * @tc.name: formVisibleNotify in config.json is true, + * it can notify the form provider that the form is not visible. + * @tc.desc: 1. The card is created successfully. + * 2. The visibility interface is successfully invoked. + * The visibility notification of form provider A is triggered, + * and the formId is the same as that of the created formId. + */ + it(`FMS_notifyVisibleForms_1400`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1400 start`); + let supplyFlag = false; + let formId1; + let formId2; + let delCount = 0; + let onSupplyCount = 0; + + function delPublishCallBack() { + console.info("!!!====>FMS_notifyVisibleForms_1400 delPublishCallBack====>"); + delCount++; + if (delCount == 2) { + setTimeout(function () { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1400")); + if (supplyFlag) { + expect().assertFail(); + } + console.info('FMS_notifyVisibleForms_1400 delPublishCallBack end'); + console.info('FMS_notifyVisibleForms_1400 end'); + done(); + }, 1000); + } + } + function onAcquiredCallBack_Normal1(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1400 onAcquiredCallBack_Normal1 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal1) + formId1 = data.data; + + FMS_notifyVisibleForms_1400_normal2(); + } + function unSubscribeOnAcquiredCallBack_Normal1() { + console.debug("====>FMS_notifyVisibleForms_1400 unSubscribeOnAcquiredCallBack_Normal2====>"); + } + async function FMS_notifyVisibleForms_1400_normal1() { + console.log(`FMS_notifyVisibleForms_1400_normal1 start`); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal1); + console.log(`FMS_notifyVisibleForms_1400_normal1 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1400_normal1 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1400_normal1 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.log(`FMS_notifyVisibleForms_1400_normal1 featureAbility.startAbility end`); + console.log(`FMS_notifyVisibleForms_1400_normal1 end`); + } + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1400 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1400")) + console.info("!!!====>FMS_notifyVisibleForms_1400 onStateCallBack formId1:====>" + formId1); + console.info("!!!====>FMS_notifyVisibleForms_1400 onStateCallBack formId2:====>" + formId2); + console.info("!!!====>FMS_notifyVisibleForms_1400 onStateCallBack onSupplyCount:====>" + onSupplyCount); + if (formId1 && formId2 && onSupplyCount == 1) { + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); + let commonEventPublishData2 = { + data: formId2 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack); + } + } + + async function onAcquiredCallBack_Normal2(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1400 onAcquiredCallBack_Normal2 data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, unSubscribeOnAcquiredCallBack_Normal2); + formId2 = data.data; + + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + + console.log(`FMS_notifyVisibleForms_1400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : [formId1,formId2], + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1400 featureAbility.startAbility end`); + } + function unSubscribeOnAcquiredCallBack_Normal2() { + console.debug("====>FMS_notifyVisibleForms_1400 unSubscribeOnAcquiredCallBack_Normal2====>"); + } + async function FMS_notifyVisibleForms_1400_normal2() { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack_Normal2); + console.log(`FMS_notifyVisibleForms_1400_normal2 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviced.hmservice", + "ability" : "com.form.formsystemtestserviced.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1400_normal2 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1400_normal2 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + + console.log(`FMS_notifyVisibleForms_1400_normal2 featureAbility.startAbility end`); + } + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyVisibleForms_1400 onSupplyCallBack====>" + JSON.stringify(data)); + let parameters = JSON.parse(data.parameters.parameters); + if(parameters[formId1]) { + expect(parameters[formId1]).assertEqual(1); + } + if(parameters[formId2]) { + expect(parameters[formId2]).assertEqual(1); + } + + onSupplyCount++; + if (onSupplyCount == 2) { + supplyFlag = true; + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1400")); + } + + if (formId1 && formId2) { + let commonEventPublishData = { + data: formId1 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallBack); + let commonEventPublishData2 = { + data: formId2 + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack); + } + } + } + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + FMS_notifyVisibleForms_1400_normal1(); + }); + /** + * @tc.number: FMS_notifyVisibleForms_1500 + * @tc.name: Created provider A and B form card, notify the form to be visible 3times. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_1500`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1500 start`); + let formIds = new Array(); + let count = 0; + + function delPublishCallBack1(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1500 delPublishCallBack1====>" + JSON.stringify(data)); + setTimeout(function () { + console.info('FMS_notifyVisibleForms_1500 delPublishCallBack1 end'); + console.log(`FMS_notifyVisibleForms_1500 end`); + }, 1000); + } + function delPublishCallBack2(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1500 delPublishCallBack2====>" + JSON.stringify(data)); + setTimeout(function () { + console.info('FMS_notifyVisibleForms_1500 delPublishCallBack2 end'); + console.log(`FMS_notifyVisibleForms_1500 end`); + done(); + }, 1000); + } + + function onInVisibleSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyVisibleForms_1500 onInVisibleSupplyCallBack====>" + JSON.stringify(data)); + + let retFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; + const visibilityStatus = JSON.parse(data.parameters.parameters)[retFormId]; + expect(formIds.includes(retFormId)).assertTrue(); + expect(visibilityStatus).assertEqual(2); + + ++count; + if (count == 12) { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); + let commonEventPublishData1 = { + data: formIds[0] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData1, delPublishCallBack1); + let commonEventPublishData2 = { + data: formIds[1] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack2); + } + } + } + + async function onVisibleSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyVisibleForms_1500 onVisibleSupplyCallBack====>" + JSON.stringify(data)); + + let retFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; + const visibilityStatus = JSON.parse(data.parameters.parameters)[retFormId]; + expect(formIds.includes(retFormId)).assertTrue(); + expect(visibilityStatus).assertEqual(1); + + ++count; + if (count == 6) { + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); + subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); + commonEvent.subscribe(subscriberSupply, onInVisibleSupplyCallBack); + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyInvisible start`); + for (var i = 0; i < 3; i++) { + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "stateForm": "invisible", + "stateIds": formIds, + "isCreate": false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + } + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyInvisible end`); + } + } + } + + async function onAcquiredCallBack2(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); + console.debug("====>FMS_notifyVisibleForms_1500 onAcquiredCallBack2====>" + JSON.stringify(data)); + formIds.push(data.data); + console.debug("====>FMS_notifyVisibleForms_1500 formIds====>" + formIds); + + commonEvent.subscribe(subscriberSupply, onVisibleSupplyCallBack); + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyVisible start`); + for (var i = 0; i < 3; i++) { + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "stateForm": "visible", + "stateIds": formIds, + "isCreate": false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + } + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility notifyVisible end`); + } + + async function onAcquiredCallBack1(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); + console.debug("====>FMS_notifyVisibleForms_1500 onAcquiredCallBack1====>" + JSON.stringify(data)); + formIds.push(data.data); + console.debug("====>FMS_notifyVisibleForms_1500 formIds====>" + JSON.stringify(formIds)); + + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack2); + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility serviceb start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviceb.hmservice", + "ability" : "com.form.formsystemtestserviceb.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility serviceb end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack1); + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1500 featureAbility.startAbility servicea end`); + }); + + /** + * @tc.number: FMS_notifyVisibleForms_1600 + * @tc.name: Use -1 and created form card Id notify the form to be visible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_1600`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1600 start`); + let formIds = new Array(); + let count = 0; + + function delPublishCallBack1(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1600 delPublishCallBack1====>" + JSON.stringify(data)); + setTimeout(function () { + console.info('FMS_notifyVisibleForms_1600 delPublishCallBack1 end'); + console.log(`FMS_notifyVisibleForms_1600 end`); + }, 1000); + } + function delPublishCallBack2(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1600 delPublishCallBack2====>" + JSON.stringify(data)); + setTimeout(function () { + console.info('FMS_notifyVisibleForms_1600 delPublishCallBack2 end'); + console.log(`FMS_notifyVisibleForms_1600 end`); + done(); + }, 1000); + } + + function onSupplyCallBack(_, data) { + if (data.parameters.kind == "onVisibilityChange") { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + console.debug("====>FMS_notifyVisibleForms_1600 onSupplyCallBack====>" + JSON.stringify(data)); + + let retFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; + const visibilityStatus = JSON.parse(data.parameters.parameters)[retFormId]; + expect(formIds.includes(retFormId)).assertTrue(); + expect(visibilityStatus).assertEqual(1); + + ++count; + if (count == 2) { + console.debug("====>FMS_notifyVisibleForms_1600 OK====>"); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1500")); + + let commonEventPublishData1 = { + data: formIds[0] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData1, delPublishCallBack1); + let commonEventPublishData2 = { + data: formIds[1] + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData2, delPublishCallBack2); + } + } + } + + async function onSecondAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_notifyVisibleForms_1500")); + console.debug("====>FMS_notifyVisibleForms_1600 onSecondAcquiredCallBack====>" + JSON.stringify(data)); + formIds.push(data.data); + formIds.push("-1"); + console.debug("====>FMS_notifyVisibleForms_1600 formIds====>" + formIds); + + commonEvent.subscribe(subscriberSupply, onSupplyCallBack); + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility notifyVisible start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "name", + "bundle" : "bundle", + "ability" : "ability", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : formIds, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility notifyVisible end`); + } + + async function onFirstAcquiredCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_notifyVisibleForms_1500")); + console.debug("====>FMS_notifyVisibleForms_1600 onFirstAcquiredCallBack====>" + JSON.stringify(data)); + formIds.push(data.data); + + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + commonEvent.subscribe(subscriberOnAcquired, onSecondAcquiredCallBack); + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility serviceb start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestserviceb.hmservice", + "ability" : "com.form.formsystemtestserviceb.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility serviceb end`); + } + + commonEvent.subscribe(subscriberOnAcquired, onFirstAcquiredCallBack); + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1600 featureAbility.startAbility servicea end`); + }); + + /** + * @tc.number: FMS_notifyVisibleForms_1700 + * @tc.name: Use -1 and created form card Id notify the form to be visible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_1700`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1700 start`); + + function onFormVisibleCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1700")); + console.debug("====>FMS_notifyVisibleForms_1700 onFirstAcquiredCallBack====>" + JSON.stringify(data)); + expect(data.parameters.kind).assertEqual("visible"); + expect(data.data).assertEqual("0"); + + setTimeout(function () { + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallback("FMS_notifyVisibleForms_1700", done)); + }, 2000); + } + + function onFormSupplyCallBack(_, data) { + expect(data.event).assertEqual("FMS_FormSupply_commonEvent"); + commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback("FMS_notifyVisibleForms_1700")); + console.debug("====>FMS_notifyVisibleForms_1700 onFormSupplyCallBack====>" + JSON.stringify(data)); + if (data.parameters.kind == "onVisibilityChange") { + console.debug("====>FMS_notifyVisibleForms_1700 error"); + expect().assertFail(); + } + } + + commonEvent.subscribe(subscriberOnState, onFormVisibleCallBack); + commonEvent.subscribe(subscriberSupply, onFormSupplyCallBack); + console.log(`FMS_notifyVisibleForms_1700 featureAbility.startAbility servicea start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true, + "isStartOtherApp" : true, + "otherAppState" : "visible" + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1700 featureAbility.startAbility servicea end`); + }); + + /** + * @tc.number: FMS_notifyVisibleForms_1800 + * @tc.name: When formVisibleNotify is true in config.json, + * the form provider will be pulled when the card is visible. + * @tc.desc: 1.The form user calls the visible notification interface. + * 2.Verify the result of the visible notification interface. + */ + it(`FMS_notifyVisibleForms_1800`, 0, async (done) => { + console.info(`FMS_notifyVisibleForms_1800 start`); + let hostFormId; + let providerFormId; + let counter = 0; + + const delPublishCallback = (_, data) => { + console.info("!!!====>FMS_notifyVisibleForms_1800 delPublishCallback====>"); + setTimeout(() => { + expect(hostFormId).assertEqual(providerFormId); + console.info('FMS_notifyVisibleForms_1800 delPublishCallback end'); + console.info(`FMS_notifyVisibleForms_1800 end`); + done(); + }, 1000); + } + + const onSupplyCallback = (_, data) => { + if (data.parameters.kind != "onVisibilityChange") { + return; + } + console.debug("====>FMS_notifyVisibleForms_1800 onSupplyCallback data:====>" + JSON.stringify(data)); + providerFormId = Object.keys(JSON.parse(data.parameters.parameters))[0]; + const visibilityStatus = JSON.parse(data.parameters.parameters)[providerFormId]; + + expect(visibilityStatus).assertEqual(1); + commonEvent.unsubscribe(subscriberSupply, () => { + console.info("====>FMS_notifyVisibleForms_1800 unSubscribeSupplyCallback====>"); + }); + if (++counter == 2) { + const commonEventPublishData = { + data: providerFormId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + } + } + + const onVisibleCallback = (_, data) => { + if (data.parameters.kind != "visible") { + return; + } + console.debug("====>FMS_notifyVisibleForms_1800 onVisibleCallback data:====>" + JSON.stringify(data)); + hostFormId = data.parameters.formId; + + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnState, () => { + console.info("====>FMS_notifyVisibleForms_1800 unSubscribeOnVisibleCallback====>"); + }); + if (++counter == 2) { + const commonEventPublishData = { + data: hostFormId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); + } + } + + commonEvent.subscribe(subscriberOnState, onVisibleCallback); + commonEvent.subscribe(subscriberSupply, onSupplyCallback); + console.info(`FMS_notifyVisibleForms_1800 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId": "0", + "name": "Form_Js001", + "bundle": "com.form.formsystemtestservicef.hmservice", + "ability": "com.form.formsystemtestservicef.hmservice.FormAbility", + "moduleName": "entry", + "temporary": false, + "stateForm": "visible", + "stateIds": ["self"], + "isCreate": true + } + } + }).then((res: any) => { + console.debug(`FMS_notifyVisibleForms_1800 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.debug(`FMS_notifyVisibleForms_1800 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + }); + /** + * @tc.number: FMS_notifyVisibleForms_1900 + * @tc.name: The size of visible form ids in the notification form array exceeds 32. + * @tc.desc: 1. Failed to invoke the visibility interface (parameter error). + */ + it(`FMS_notifyVisibleForms_1900`, 0, async (done) => { + console.log(`FMS_notifyVisibleForms_1900 start`); + + function onStateCallBack(_, data) { + console.info("!!!====>FMS_notifyVisibleForms_1900 onStateCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnState, () => unsubscribeOnStateCallback("FMS_notifyVisibleForms_1900")) + + setTimeout(function () { + console.info('FMS_notifyVisibleForms_1900 delPublishCallBack end'); + console.log(`FMS_notifyVisibleForms_1900 end`); + done(); + }, 100); + } + + commonEvent.subscribe(subscriberOnState, onStateCallBack); + console.log(`FMS_notifyVisibleForms_1900 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostg", + abilityName: "com.ohos.st.formsystemhostg.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.FormAbility", + "moduleName" : "entry", + "temporary" : false, + "stateForm" : "visible", + "stateIds" : [ + "1","2","3","4","5","6","7","8","9","10","11","12","13","14", + "15","16","17","18","19","20","21","22","23","24","25","26", + "27","28","29","30","31","32","33" + ], + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_notifyVisibleForms_1900 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_notifyVisibleForms_1900 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_notifyVisibleForms_1900 featureAbility.startAbility end`); + }); + }); +} + +const sleep = async delay => { + return new Promise((resolve, _) => { + setTimeout(async () => { + resolve(0); + }, delay); + }); +}; + +const delPublishCallback = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000); +} + +const unsubscribeOnStateCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnStateCallback====>`); +} + +const unsubscribeSupplyCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unSubscribeSupplyCallback====>`); +} + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnAcquiredCallback====>`); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..349440c80 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsFormStateNotifyVisible.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..63cba75d5 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formvisiblestatetest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/BUILD.gn diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/Test.json new file mode 100644 index 000000000..229c7ae97 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/Test.json @@ -0,0 +1,21 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "360000", + "package": "com.ohos.st.formstresstest", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "ActsFormStressTest.hap", + "FormSystemHostK.hap", + "FormSupplyAppF.hap", + "FormSupplyAppG.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json new file mode 100644 index 000000000..7f1a40859 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json @@ -0,0 +1,169 @@ +{ + "app": { + "bundleName": "com.ohos.st.formstresstest", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.st.formstresstest", + "name": ".FormStressSTApp", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "defPermissions": [ + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnDeleted_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnAcquired_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnError_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormCast_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormSupply_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormOnRequest_commonEvent" + }, + { + "availableScope": [], + "grantMode": "system_grant", + "name": "FMS_FormDelete_commonEvent" + } + ], + "reqPermissions": [ + { + "name": "FMS_FormOnAcquired_commonEvent", + "reason": "need use onAcquired commonEvent" + }, + { + "name": "FMS_FormOnDeleted_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "FMS_FormOnError_commonEvent", + "reason": "need use OnError commonEvent" + }, + { + "name": "FMS_FormCast_commonEvent", + "reason": "need use castFrom commonEvent" + }, + { + "name": "FMS_FormSupply_commonEvent", + "reason": "need use FormSupply commonEvent" + }, + { + "name": "FMS_FormOnReleased_commonEvent" + }, + { + "name": "FMS_FormOnRequest_commonEvent" + }, + { + "name": "FMS_FormDelete_commonEvent", + "reason": "need use delete commonEvent" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name": "ohos.permission.CLEAN_APPLICATION_DATA" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..11c5d70c4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..a5548b210 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// @ts-nocheck +import featureAbility from "@ohos.ability.featureAbility"; +import file from '@system.file'; +import { Core, ExpectExtend, ReportExtend } from "deccjsunit/index"; +import testsuite from "../test/List.test.ets"; + +@Entry +@Component +struct Index { + + aboutToAppear() { + + console.info("[FormComponent] start run testcase!!!!"); + + featureAbility.getWant() + .then((want: any) => { + console.info('[FormComponent] Operation successful. Data: ' + JSON.stringify(want)); + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + want.parameters['timeout'] = 10000; + console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); + configService.setConfig(want.parameters); + testsuite(); + core.execute(); + }) + .catch((error: any) => { + console.error('[FormComponent] Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Fms Stress Test') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets new file mode 100644 index 000000000..803ce1074 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets @@ -0,0 +1,601 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the `License`); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an `AS IS` BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from '@ohos.ability.featureAbility'; +import formHost from '@ohos.application.formHost'; +import commonEvent from '@ohos.commonEvent'; +import { beforeEach, describe, expect, it } from 'deccjsunit/index'; + +const onDeletedEvent = { + events: [`FMS_FormOnDeleted_commonEvent`] +} +const onAcquiredEvent = { + events: [`FMS_FormOnAcquired_commonEvent`] +}; +const onSupplyEvent = { + events: [`FMS_FormSupply_commonEvent`] +}; +const formOnDeleteEvent = `FMS_FormDelete_commonEvent`; + +const unsubscribeOnDeletedCallback = (tcNumber, done) => { + console.info(`${tcNumber} unsubscribeOnDeleted Callback`); + done(); +} +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.info(`${tcNumber} unsubscribeOnAcquired Callback`); +} +const unsubscribeOnSupplyCallback = (tcNumber) => { + console.info(`${tcNumber} unsubscribeOnSupply Callback`); +} +const publishOnDeleteCallback = (tcNumber) => { + console.info(`${tcNumber} publishOnDelete Callback`); +} + +let onDeletedEventSubscriber; +let onAcquiredEventSubscriber; +let onSupplyEventSubscriber; + +export default function test() { + describe(`FmsStressTest`, () => { + + beforeEach(async () => { + onDeletedEventSubscriber = await commonEvent.createSubscriber(onDeletedEvent); + onAcquiredEventSubscriber = await commonEvent.createSubscriber(onAcquiredEvent); + onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent); + }); + + const subscribeDeletedEvent = (tcNumber, expectedDeletedFormAmount, done) => { + commonEvent.subscribe(onDeletedEventSubscriber, async (err, data) => { + const formIds = data.parameters.formIds; + const deletedFormAmount = data.parameters.deletedFormAmount; + console.info(`${tcNumber} onDeletedCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onDeletedCallback formIds: ${formIds}`); + + expect(expectedDeletedFormAmount).assertEqual(deletedFormAmount); + expect(err.code).assertEqual(0); + console.info(`${tcNumber} onDeletedCallback end`); + commonEvent.unsubscribe(onDeletedEventSubscriber, () => unsubscribeOnDeletedCallback(tcNumber, done)); + }); + } + + /** + * @tc.number: FMS_stressTest_0100 + * @tc.name: Create form test. + * @tc.desc: OnCreate form interface working well. + */ + it(`FMS_stressTest_0100`, 0, async (done) => { + const tcNumber = `FMS_stressTest_0100`; + + subscribeDeletedEvent(tcNumber, 1, done); + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + const formId = data.data; + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); + + expect(err.code).assertEqual(0); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [].concat(formId) + } + }, () => publishOnDeleteCallback(tcNumber)); + }, 500); + console.info(`${tcNumber} onAcquiredCallback end`); + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestservicef.hmservice`, + ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_stressTest_0200 + * @tc.name: Host release form test. + * @tc.desc: releaseForm method working well. + */ + it(`FMS_stressTest_0200`, 0, async (done) => { + const tcNumber = `FMS_stressTest_0200`; + + subscribeDeletedEvent(tcNumber, 1, done); + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + const kind = data.parameters.kind; + const formId = data.parameters.formId; + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); + + expect(err.code).assertEqual(0); + if (`release` == kind) { + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestservicef.hmservice`, + ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, + moduleName: `entry`, + isCreate: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + } else { + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [].concat(formId) + } + }, () => publishOnDeleteCallback(tcNumber)); + }, 500); + console.info(`${tcNumber} onAcquiredCallback end`); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestservicef.hmservice`, + ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, + moduleName: `entry`, + releaseForm: true, + isCreate: true, + temporary: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_stressTest_0300 + * @tc.name: Host cast temp form test. + * @tc.desc: castTempForm method working well. + */ + it(`FMS_stressTest_0300`, 0, async (done) => { + const tcNumber = `FMS_stressTest_0300`; + + subscribeDeletedEvent(tcNumber, 1, done); + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + const kind = data.parameters.kind; + const formId = data.parameters.formId; + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); + + expect(err.code).assertEqual(0); + if (`castTempForm` == kind) { + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: formId, + name: `Form_Js001`, + bundle: `com.form.formsystemtestservicef.hmservice`, + ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, + moduleName: `entry` + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [].concat(formId) + } + }, () => publishOnDeleteCallback(tcNumber)); + }, 500); + console.info(`${tcNumber} onAcquiredCallback end`); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestservicef.hmservice`, + ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, + moduleName: `entry`, + castTempForm: true, + isCreate: true, + temporary: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_stressTest_0500 + * @tc.name: Provider set form next refresh time test. + * @tc.desc: setFormNextRefreshTime method working well. + */ + it(`FMS_stressTest_0500`, 0, async (done) => { + const tcNumber = `FMS_stressTest_0500`; + + subscribeDeletedEvent(tcNumber, 1, done); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : `onVisibilityChange` == kind + ? Object.keys(JSON.parse(data.parameters.parameters))[0] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onSetFormNextRefreshTime` == kind) { + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [].concat(supplyFormId) + } + }, () => publishOnDeleteCallback(tcNumber)); + }, 500); + console.info(`${tcNumber} onSupplyCallback end`); + } + }); + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + const kind = data.parameters.kind; + const formId = data.parameters.formId; + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); + + if (`notifyVisibleForms` == kind) { + expect(err.code).assertEqual(0); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback end`); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + notifyVisibleForms: true, + isCreate: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_stressTest_0700 + * @tc.name: Host request form test. + * @tc.desc: requestForm method working well. + */ + it(`FMS_stressTest_0700`, 0, async (done) => { + const tcNumber = `FMS_stressTest_0700`; + + subscribeDeletedEvent(tcNumber, 1, done); + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + const kind = data.parameters.kind; + const formId = data.parameters.formId; + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); + + if (`request` == kind) { + expect(err.code).assertEqual(0); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [].concat(formId) + } + }, () => publishOnDeleteCallback(tcNumber)); + }, 500); + console.info(`${tcNumber} onAcquiredCallback end`); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestservicef.hmservice`, + ability: `com.form.formsystemtestservicef.hmservice.FormAbility`, + moduleName: `entry`, + requestForm: true, + isCreate: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_stressTest_0900 + * @tc.name: Provider update form test. + * @tc.desc: updateForm method working well. + */ + it(`FMS_stressTest_0900`, 0, async (done) => { + const tcNumber = `FMS_stressTest_0900`; + + subscribeDeletedEvent(tcNumber, 1, done); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : `onVisibilityChange` == kind + ? Object.keys(JSON.parse(data.parameters.parameters))[0] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onUpdateForm` == kind) { + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [].concat(supplyFormId) + } + }, () => publishOnDeleteCallback(tcNumber)); + }, 500); + console.info(`${tcNumber} onSupplyCallback end`); + } + }); + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + const kind = data.parameters.kind; + const formId = data.parameters.formId; + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); + + if (`notifyVisibleForms` == kind) { + expect(err.code).assertEqual(0); + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback end`); + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + notifyVisibleForms: true, + isCreate: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_stressTest_1100 + * @tc.name: Host notify form's visibility test. + * @tc.desc: notifyVisibleForms and notifyInvisibleForms method working well. + */ + it(`FMS_stressTest_1100`, 0, async (done) => { + const tcNumber = `FMS_stressTest_1100`; + let hostCounter = 0; + let providerCounter = 0; + + subscribeDeletedEvent(tcNumber, 1, done); + + commonEvent.subscribe(onSupplyEventSubscriber, async (err, data) => { + console.info(`${tcNumber} onSupplyCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + const kind = data.parameters.kind; + const supplyFormId = `onCreate` == kind + ? JSON.parse(data.parameters.parameters).parameters[`ohos.extra.param.key.form_identity`] + : `onVisibilityChange` == kind + ? Object.keys(JSON.parse(data.parameters.parameters))[0] + : data.parameters.parameters; + console.info(`${tcNumber} onSupplyCallback formId: ${supplyFormId} kind: ${kind}`); + + if (`onVisibilityChange` == kind) { + if (++providerCounter == 2) { + commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeOnSupplyCallback(tcNumber)); + setTimeout(() => { + commonEvent.publish(formOnDeleteEvent, { + parameters: { + formIds: [].concat(supplyFormId) + } + }, () => publishOnDeleteCallback(tcNumber)); + }, 500); + console.info(`${tcNumber} onSupplyCallback end`); + } + } + }); + + commonEvent.subscribe(onAcquiredEventSubscriber, async (err, data) => { + const kind = data.parameters.kind; + const formId = data.parameters.formId; + console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}, error: ${JSON.stringify(err)}`); + console.info(`${tcNumber} onAcquiredCallback formId: ${formId}`); + + if (`notifyVisibleForms` == kind) { + expect(err.code).assertEqual(0); + if (++hostCounter == 2) { + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback end`); + } + } else if (`notifyInvisibleForms` == kind) { + expect(err.code).assertEqual(0); + if (++hostCounter == 2) { + commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeOnAcquiredCallback(tcNumber)); + console.info(`${tcNumber} onAcquiredCallback end`); + } + } + }); + + try { + const res = await featureAbility.startAbility({ + want: { + bundleName: `com.ohos.st.formsystemhostk`, + abilityName: `com.ohos.st.formsystemhostk.MainAbility`, + parameters: { + formId: `0`, + name: `Form_Js001`, + bundle: `com.form.formsystemtestserviceg.hmservice`, + ability: `com.form.formsystemtestserviceg.hmservice.FormAbility`, + moduleName: `entry`, + notifyVisibility: true, + isCreate: true + } + } + }); + console.info(`${tcNumber} featureAbility.startAbility res: ${JSON.stringify(res)}`); + } catch (error) { + console.info(`${tcNumber} error: ${JSON.stringify(error)}`); + console.info(`${tcNumber} should not reach here`); + expect().assertFail(); + } + }); + + /** + * @tc.number: FMS_stressTest_1700 + * @tc.name: Get forms info test. + * @tc.desc: getAllFormsInfo and getFormsInfo method working well. + */ + it(`FMS_stressTest_1700`, 0, async (done) => { + const tcNumber = `FMS_stressTest_1700`; + + let allFormsInfo = await formHost.getAllFormsInfo(); + const providerBundleNameList = [ + `com.form.formsystemtestservicef.hmservice`, + `com.form.formsystemtestserviceg.hmservice` + ]; + + console.info(`${tcNumber} getAllFormsInfo: ${JSON.stringify(allFormsInfo)}`); + console.info(`${tcNumber} before filter size: ${JSON.stringify(allFormsInfo.length)}`); + allFormsInfo = allFormsInfo.filter((formsInfo) => providerBundleNameList.includes(formsInfo.bundleName)); + console.info(`${tcNumber} after filter size: ${JSON.stringify(allFormsInfo.length)}`); + expect(allFormsInfo.length).assertEqual(3); + + allFormsInfo.forEach(async (formsInfo, index) => { + const providerFormsInfo1 = await formHost.getFormsInfo(formsInfo.bundleName); + const providerFormsInfo2 = await formHost.getFormsInfo(formsInfo.bundleName, formsInfo.moduleName); + + console.info(`${tcNumber} getFormsInfo: ${JSON.stringify(providerFormsInfo1)}`); + console.info(`${tcNumber} getFormsInfo: ${JSON.stringify(providerFormsInfo2)}`); + expect(providerFormsInfo1[0].bundleName).assertEqual(providerFormsInfo2[0].bundleName); + + if (index == allFormsInfo.length - 1) { + done(); + } + }); + }); + + + /** + * @tc.number: FMS_stressTest_1800 + * @tc.name: Form system ready test. + * @tc.desc: isSystemReady method working well. + */ + it(`FMS_stressTest_1800`, 0, async (done) => { + const tcNumber = `FMS_stressTest_1800`; + + const systemstatus = await formHost.isSystemReady(); + console.info(`${tcNumber} systemstatus: ${JSON.stringify(systemstatus)}`); + expect(systemstatus).assertEqual(0); + done(); + }); + }); +} diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/List.test.ets new file mode 100644 index 000000000..8b32987f9 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import test from './FmsStress.test.ets'; + +export default function testsuite() { + test(); +} \ No newline at end of file diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formstresstest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/BUILD.gn b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/BUILD.gn rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/BUILD.gn diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/Test.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/Test.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/Test.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/Test.json diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 000000000..11c5d70c4 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('[FormComponent] Application onCreate') + }, + onDestroy() { + console.info('[FormComponent] Application onDestroy') + }, +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/pages/index.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/pages/index.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/pages/index.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets new file mode 100644 index 000000000..213a31c19 --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets @@ -0,0 +1,720 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import featureAbility from "@ohos.ability.featureAbility"; +import commonEvent from '@ohos.commonEvent'; +import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; + +var onAcquiredForm_Event = { + events: ["FMS_FormOnAcquired_commonEvent"], +}; +var onDeletedFormEvent = { + events: ["FMS_FormOnDeleted_commonEvent"], +}; +var onUpdateRefreshEvent = { + events: ["FMS_FormUpdateRefresh_commonEvent"], +}; +var onRequestFormEvent = { + events: ["FMS_FormOnRequest_commonEvent"], +}; + +var deleteForm_Event = "FMS_FormDelete_commonEvent"; + + +var subscriberOnAcquired; +var subscriberOnDeleted; +var subscriberOnRefresh; +var subscriberOnRequest; + +export default function test() { + describe(`FmsUpdateRefreshFormTest`, () => { + + beforeAll(async (done) => { + done(); + }) + + beforeEach(async () => { + subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); + subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); + subscriberOnRefresh = await commonEvent.createSubscriber(onUpdateRefreshEvent); + subscriberOnRequest = await commonEvent.createSubscriber(onRequestFormEvent); + }) + + /** + * @tc.number: FMS_updateForm_0100 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.The form provider A to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_updateForm_0100`, 0, async (done) => { + console.log(`FMS_updateForm_0100 start`); + + function onRefreshCallBack(_, data) { + console.info("!!!====>FMS_updateForm_0100 onRefreshCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0100")); + + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack("FMS_updateForm_0100", done)); + } + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); + console.log(`FMS_updateForm_0100 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "updateForm" : true, + "updateId" : "-1", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_updateForm_0100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_updateForm_0100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_updateForm_0100 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_updateForm_0200 + * @tc.name: formID id is error(formID == 0) + * @tc.desc: 1.The form provider A to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_updateForm_0200`, 0, async (done) => { + console.log(`FMS_updateForm_0200 start`); + + function onRefreshCallBack(_, data) { + console.info("!!!====>FMS_updateForm_0200 onRefreshCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0200")); + + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack("FMS_updateForm_0200", done)); + done(); + } + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); + console.log(`FMS_updateForm_0200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "updateForm" : true, + "updateId" : "0", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_updateForm_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_updateForm_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_updateForm_0200 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_updateForm_0300 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.The form provider B to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_updateForm_0300`, 0, async (done) => { + console.log(`FMS_updateForm_0300 start`); + let formId; + + function onRefreshCallBack(_, data) { + console.info("!!!====>FMS_updateForm_0300 onRefreshCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0300")); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack("FMS_updateForm_0300", done)); + done(); + } + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_updateForm_0300 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_updateForm_0300")); + formId = data.data; + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); + + console.log(`FMS_updateForm_0300 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "updateForm" : true, + "updateId" : formId, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_updateForm_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_updateForm_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_updateForm_0300 featureAbility.startAbility again end`); + } + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.log(`FMS_updateForm_0300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_updateForm_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_updateForm_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_updateForm_0300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_updateForm_0400 + * @tc.name: Form ID error (FormID does not exist) + * @tc.desc: 1.The form provider A to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_updateForm_0400`, 0, async (done) => { + console.log(`FMS_updateForm_0400 start`); + let formId; + + function onRefreshCallBack(_, data) { + console.info("!!!====>FMS_updateForm_0400 onRefreshCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0400")); + setTimeout(function () { + console.info('FMS_updateForm_0400 onRefreshCallBack end'); + console.log(`FMS_updateForm_0400 end`); + done(); + }, 1000); + } + function onDeletedCallBack(_, data) { + console.info("!!!====>FMS_updateForm_0400 onDeletedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnDeleted_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeDeletedCallback("FMS_updateForm_0400")); + formId = data.parameters.formId; + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); + + console.log(`FMS_updateForm_0400 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "updateForm" : true, + "updateId" : formId, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_updateForm_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_updateForm_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_updateForm_0400 featureAbility.startAbility again end`); + } + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallBack); + console.log(`FMS_updateForm_0400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "deleteForm" : true, + "deleteId" : "self", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_updateForm_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_updateForm_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_updateForm_0400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_updateForm_0500 + * @tc.name: The jsonData of form in the provider is empty. + * @tc.desc: 1.The form provider A to invoke the intiative timed refresh interface. + */ + it(`FMS_updateForm_0500`, 0, async (done) => { + console.log(`FMS_updateForm_0500 start`); + + function onRefreshCallBack(_, data) { + console.info("!!!====>FMS_updateForm_0500 onRefreshCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormUpdateRefresh_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeOnRefreshCallback("FMS_updateForm_0500")); + + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack("FMS_updateForm_0500", done)); + done(); + } + commonEvent.subscribe(subscriberOnRefresh, onRefreshCallBack); + console.log(`FMS_updateForm_0500 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "updateForm" : true, + "updateId" : "self", + "jsonEmpty" : true, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_updateForm_0500 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_updateForm_0500 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_updateForm_0500 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_hostRefresh_0100 + * @tc.name: formID id is error(formID < 0) + * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_hostRefresh_0100`, 0, async (done) => { + console.log(`FMS_hostRefresh_0100 start`); + + function onRequestCallBack(_, data) { + console.info("!!!====>FMS_hostRefresh_0100 onRequestCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0100")); + + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack("FMS_hostRefresh_0100", done)); + } + commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); + console.log(`FMS_hostRefresh_0100 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "requestForm" : true, + "requestId" : "-1", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_hostRefresh_0100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_hostRefresh_0100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_hostRefresh_0100 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_hostRefresh_0200 + * @tc.name: formID id is error(formID == 0) + * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_hostRefresh_0200`, 0, async (done) => { + console.log(`FMS_hostRefresh_0200 start`); + + function onRequestCallBack(_, data) { + console.info("!!!====>FMS_hostRefresh_0200 onRequestCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0200")); + + let commonEventPublishData = { + data: data.parameters.formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack("FMS_hostRefresh_0200", done)); + done(); + } + commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); + console.log(`FMS_hostRefresh_0200 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "requestForm" : true, + "requestId" : "0", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_hostRefresh_0200 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_hostRefresh_0200 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_hostRefresh_0200 featureAbility.startAbility end`); + }); + + /** + * @tc.number: FMS_hostRefresh_0300 + * @tc.name: formID id is error because formId is not self + * @tc.desc: 1.The form user B to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_hostRefresh_0300`, 0, async (done) => { + console.log(`FMS_hostRefresh_0300 start`); + let formId; + + function onRequestCallBack(_, data) { + console.info("!!!====>FMS_hostRefresh_0300 onRequestCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRefreshCallback("FMS_hostRefresh_0300")); + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, + () => delPublishCallBack("FMS_hostRefresh_0300", done)); + done(); + } + + function onAcquiredCallBack(_, data) { + console.info("!!!====>FMS_hostRefresh_0300 onAcquiredCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnAcquired_commonEvent"); + commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback("FMS_hostRefresh_0300")); + formId = data.data; + commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); + + console.log(`FMS_hostRefresh_0300 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "requestForm" : true, + "requestId" : formId, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_hostRefresh_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_hostRefresh_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_hostRefresh_0300 featureAbility.startAbility again end`); + } + commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallBack); + console.log(`FMS_hostRefresh_0300 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_hostRefresh_0300 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_hostRefresh_0300 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_hostRefresh_0300 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_hostRefresh_0400 + * @tc.name: Form ID error (FormID does not exist) + * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_hostRefresh_0400`, 0, async (done) => { + console.log(`FMS_hostRefresh_0400 start`); + let formId; + + function onRequestCallBack(_, data) { + console.info("!!!====>FMS_hostRefresh_0400 onRequestCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0400")); + setTimeout(function () { + console.info('FMS_hostRefresh_0400 onRequestCallBack end'); + console.log(`FMS_hostRefresh_0400 end`); + done(); + }, 10); + } + function onDeletedCallBack(_, data) { + console.info("!!!====>FMS_hostRefresh_0400 onDeletedCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnDeleted_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeDeletedCallback("FMS_hostRefresh_0400")); + formId = data.parameters.formId; + commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); + + console.log(`FMS_hostRefresh_0400 featureAbility.startAbility again start`); + featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "requestForm" : true, + "requestId" : formId, + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_hostRefresh_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_hostRefresh_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_hostRefresh_0400 featureAbility.startAbility again end`); + } + commonEvent.subscribe(subscriberOnDeleted, onDeletedCallBack); + console.log(`FMS_hostRefresh_0400 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostf", + abilityName: "com.ohos.st.formsystemhostf.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "deleteForm" : true, + "deleteId" : "self", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_hostRefresh_0400 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_hostRefresh_0400 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_hostRefresh_0400 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_hostRefresh_0600 + * @tc.name: The form user has no form permission. + * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. + * 2.Verify the result of the intiative timed refresh interface. + */ + it(`FMS_hostRefresh_0600`, 0, async (done) => { + console.log(`FMS_hostRefresh_0600 start`); + + function onRequestCallBack(_, data) { + console.info("!!!====>FMS_hostRefresh_0600 onRequestCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); + expect(data.data != "0").assertEqual(true); + commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0600")); + + setTimeout(function () { + console.info('FMS_hostRefresh_0600 onRequestCallBack end'); + console.log(`FMS_hostRefresh_0600 end`); + done(); + }, 1000) + } + + commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); + console.log(`FMS_hostRefresh_0600 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhostnoperm", + abilityName: "com.ohos.st.formsystemhostnoperm.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "requestForm" : true, + "requestId" : "1", + "isCreate" : false + } + } + }).then((res: any) => { + console.log(`FMS_hostRefresh_0600 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_hostRefresh_0600 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_hostRefresh_0600 featureAbility.startAbility end`); + }); + /** + * @tc.number: FMS_hostRefresh_0700 + * @tc.name: Refresh form successfully by the form user. + * @tc.desc: 1.The form user A to invoke the intiative timed refresh interface. + * 2.Verify that pulling up the form provider. + */ + it(`FMS_hostRefresh_0700`, 0, async (done) => { + console.log(`FMS_hostRefresh_0700 start`); + let formId; + + function onRequestCallBack(_, data) { + console.info("!!!====>FMS_hostRefresh_0700 onRequestCallBack data:====>" + JSON.stringify(data)); + expect(data.event).assertEqual("FMS_FormOnRequest_commonEvent"); + expect(data.data).assertEqual("0"); + commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeOnRequestCallback("FMS_hostRefresh_0700")); + formId = data.parameters.formId; + let commonEventPublishData = { + data: formId + }; + commonEvent.publish(deleteForm_Event, commonEventPublishData, () => delPublishCallBack("FMS_hostRefresh_0700", done)); + done(); + } + + commonEvent.subscribe(subscriberOnRequest, onRequestCallBack); + + console.log(`FMS_hostRefresh_0700 featureAbility.startAbility start`); + await featureAbility.startAbility({ + want: { + bundleName: "com.ohos.st.formsystemhoste", + abilityName: "com.ohos.st.formsystemhoste.MainAbility", + parameters: { + "formId" : "0", + "name" : "Form_Js001", + "bundle" : "com.form.formsystemtestservicea.hmservice", + "ability" : "com.form.formsystemtestservicea.hmservice.MainAbility", + "moduleName" : "entry", + "temporary" : false, + "requestForm" : true, + "requestId" : "self", + "isCreate" : true + } + } + }).then((res: any) => { + console.log(`FMS_hostRefresh_0700 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); + }).catch((err: any) => { + console.log(`FMS_hostRefresh_0700 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + }); + console.log(`FMS_hostRefresh_0700 featureAbility.startAbility end`); + }); + }); +} + +const delPublishCallBack = async (tcNumber, done) => { + console.info(`${tcNumber} delPublishCallBack start`); + setTimeout(function () { + console.info(`${tcNumber} delPublishCallBack end`); + done(); + }, 1000) +} + +const unsubscribeOnRequestCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnRequestCallback CallBack====>`); +} + +const unsubscribeOnRefreshCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnRefreshCallback CallBack====>`); +} + +const unsubscribeDeletedCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeDeletedCallback====>`); +} + +const unsubscribeOnAcquiredCallback = (tcNumber) => { + console.debug(`====>${tcNumber} unsubscribeOnAcquiredCallback CallBack====>`); +} diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/List.test.ets diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..be88fb57c --- /dev/null +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsttest" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/signature/openharmony_sx.p7b b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/formmanager/fa/formsystemtest_ets/formupdatefreshtest/signature/openharmony_sx.p7b rename to ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/app.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/app.json new file mode 100644 index 000000000..7ec9f66f2 --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.acts.killprocesswithaccountpackage", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/element/string.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/Test.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..c3dc930c5 --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbilityT onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbilityT onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbilityT onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbilityT onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbilityT onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbilityT onBackground") + } +}; diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json new file mode 100644 index 000000000..6bcf8cc50 --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json @@ -0,0 +1,37 @@ +{ + "module": { + "name": "com.acts.killprocesswithaccountpackage", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.acts.killprocesswithaccountpackage.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/signature/openharmony_sx.p7b b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/signature/openharmony_sx.p7b rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/app.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/app.json rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/app.json diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/element/string.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/BUILD.gn b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/BUILD.gn rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/BUILD.gn diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/Test.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/Test.json rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/Test.json diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/List.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/signature/openharmony_sx.p7b b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountTest/signature/openharmony_sx.p7b rename to ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/BUILD.gn b/ability/ability_runtime/killprocesswithaccountstage/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/killprocesswithaccountstage/BUILD.gn rename to ability/ability_runtime/killprocesswithaccountstage/BUILD.gn diff --git a/aafwk/aafwk_standard/newwant/BUILD.gn b/ability/ability_runtime/newwant/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/BUILD.gn rename to ability/ability_runtime/newwant/BUILD.gn diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/BUILD.gn b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/BUILD.gn rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/BUILD.gn diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/config.json b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/config.json rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json diff --git a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/app.js b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/app.js new file mode 100644 index 000000000..f052c8a90 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/en-US.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/zh-CN.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.css old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.hml old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..2f9470d82 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/AppScope/app.json b/ability/ability_runtime/newwant/actsnewwantarelyhap/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/AppScope/app.json rename to ability/ability_runtime/newwant/actsnewwantarelyhap/AppScope/app.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwantarelyhap/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/AppScope/resources/base/element/string.json rename to ability/ability_runtime/newwant/actsnewwantarelyhap/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/newwant/actsnewwantarelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/newwant/actsnewwantarelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/BUILD.gn b/ability/ability_runtime/newwant/actsnewwantarelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/BUILD.gn rename to ability/ability_runtime/newwant/actsnewwantarelyhap/BUILD.gn diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/Test.json b/ability/ability_runtime/newwant/actsnewwantarelyhap/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/Test.json rename to ability/ability_runtime/newwant/actsnewwantarelyhap/Test.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/module.json rename to ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/AppScope/app.json b/ability/ability_runtime/newwant/actsnewwantbrelyhap/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/AppScope/app.json rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/AppScope/app.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwantbrelyhap/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/AppScope/resources/base/element/string.json rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/newwant/actsnewwantbrelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/BUILD.gn b/ability/ability_runtime/newwant/actsnewwantbrelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/BUILD.gn rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/BUILD.gn diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/Test.json b/ability/ability_runtime/newwant/actsnewwantbrelyhap/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/Test.json rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/Test.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/module.json rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/AppScope/app.json b/ability/ability_runtime/newwant/actsnewwantrelyhap/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/AppScope/app.json rename to ability/ability_runtime/newwant/actsnewwantrelyhap/AppScope/app.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwantrelyhap/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/AppScope/resources/base/element/string.json rename to ability/ability_runtime/newwant/actsnewwantrelyhap/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/newwant/actsnewwantrelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/newwant/actsnewwantrelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/BUILD.gn b/ability/ability_runtime/newwant/actsnewwantrelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/BUILD.gn rename to ability/ability_runtime/newwant/actsnewwantrelyhap/BUILD.gn diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/Test.json b/ability/ability_runtime/newwant/actsnewwantrelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts new file mode 100644 index 000000000..8a848aab9 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +export default class SecondAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("ACTS_NewWant SecondAbility onCreate") + globalThis.abilityWant = want; + commonEvent.publish("onCreateSecond_To_Test_CommonEvent", () => { + console.log("ACTS_NewWant Publish CallBack onCreateSecond_To_Test_CommonEvent") + }); + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("ACTS_NewWant SecondAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("ACTS_NewWant SecondAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + + commonEvent.publish("onWindowStageCreateSecond_To_Test_CommonEvent", () => { + console.log("ACTS_NewWant Publish CallBack onWindowStageCreateSecond_To_Test_CommonEvent") + }); + } + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("ACTS_NewWant SecondAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + var connId; + console.log("ACTS_NewWant SecondAbility onForeground") + if (globalThis.abilityWant.action == 'startSingleton0400') + { + globalThis.abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.MainAbility", + action:"startStandard0400" + }, (error, data) => { + console.log('ACTS_NewWant SecondAbility onForeground - startAbility start standard: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + } + if (globalThis.abilityWant.action == 'startSingleton0300') + { + globalThis.abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.MainAbility", + action:"restartSingleton" + }, (error, data) => { + console.log('ACTS_NewWant SecondAbility onForeground - startAbility restart standard: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + } + if (globalThis.abilityWant.action == 'startHapA0500') { + globalThis.abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapb.MainAbility", + action: "restartHapB" + }, (error, data) => { + console.log('ACTS_NewWant SecondAbility onForeground - startAbility restart HapB: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + } + if (globalThis.abilityWant.action == 'startHapA0600') { + globalThis.abilityContext.startAbility({ + bundleName: "com.example.newwanthapa", + abilityName: "com.example.newwanthapc.MainAbility", + action: "restartHapC" + }, (error, data) => { + console.log('ACTS_NewWant SecondAbility onForeground - startAbility restart HapC: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + } + if (globalThis.abilityWant.action == 'startSecondAbility0700') { + globalThis.abilityContext.startAbility( + { + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.MainAbility", + action: "startMainAbility0700" + }, (error, data) => { + console.log('ACTS_NewWant SecondAbility onForeground - startAbility startMainAbility0700: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }); + } + if (globalThis.abilityWant.action == 'startSecondAbility0800') { + globalThis.abilityContext.startAbility( + { + bundleName: "com.example.newwanthapapi7", + abilityName: "com.example.newwanthapapi7.MainAbility", + action: "startapi70800" + }, (error, data) => { + console.log('ACTS_NewWant SecondAbility onForeground - startAbility startapi70800: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }); + } + commonEvent.publish("onForegroundSecond_To_Test_CommonEvent", () => { + console.log("ACTS_NewWant SecondAbility Publish CallBack onForegroundSecond_To_Test_CommonEvent") + }); + } + + onBackground() { + // Ability has back to background + console.log("ACTS_NewWant SecondAbility onBackground") + } + + onNewWant(want) { + // Ability has brought to foreground when it already in foreground + console.log("ACTS_NewWant SecondAbility onNewWant") + globalThis.abilityWant = want; + console.log("ACTS_NewWant SecondAbility onNewWant deviceId :" + want.deviceId) + console.log("ACTS_NewWant SecondAbility onNewWant bundleName :" + want.bundleName) + console.log("ACTS_NewWant SecondAbility onNewWant abilityName :" + want.abilityName) + console.log("ACTS_NewWant SecondAbility onNewWant uri :" + want.uri) + console.log("ACTS_NewWant SecondAbility onNewWant type :" + want.type) + console.log("ACTS_NewWant SecondAbility onNewWant flags :" + want.flags) + console.log("ACTS_NewWant SecondAbility onNewWant action :" + want.action) + var publishData = { + data: want.action + } + commonEvent.publish("onNewWantSecond_To_Test_CommonEvent", publishData,() => { + console.log("ACTS_NewWant SecondAbility Publish CallBack onNewWantSecond_To_Test_CommonEvent") + }); + } +}; diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/module.json rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/AppScope/app.json b/ability/ability_runtime/newwant/actsnewwanttest/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/AppScope/app.json rename to ability/ability_runtime/newwant/actsnewwanttest/AppScope/app.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/AppScope/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwanttest/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/newwant/actsnewwanttest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/newwant/actsnewwanttest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/newwant/actsnewwanttest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/BUILD.gn b/ability/ability_runtime/newwant/actsnewwanttest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/BUILD.gn rename to ability/ability_runtime/newwant/actsnewwanttest/BUILD.gn diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/Test.json b/ability/ability_runtime/newwant/actsnewwanttest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/Test.json rename to ability/ability_runtime/newwant/actsnewwanttest/Test.json diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..6837617a9 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets new file mode 100644 index 000000000..0df04ae14 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets @@ -0,0 +1,653 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent' +import missionManager from '@ohos.application.missionManager' +import appManager from '@ohos.application.appManager' + +const MAX_MISSION_NUM = 1024; +var subscriberInfo = { + events: ['onCreateMain_To_Test_CommonEvent', + 'onWindowStageCreateMain_To_Test_CommonEvent', + 'onForegroundMain_To_Test_CommonEvent', + 'onNewWantMain_To_Test_CommonEvent', + 'onCreateSecond_To_Test_CommonEvent', + 'onWindowStageCreateSecond_To_Test_CommonEvent', + 'onForegroundSecond_To_Test_CommonEvent', + 'onNewWantSecond_To_Test_CommonEvent', + ], +}; + +function getMissionId() { + return new Promise(async (resolve, reject) => { + var missionId = -1; + var missionInfos = await missionManager.getMissionInfos('', MAX_MISSION_NUM); + console.log('======>ACTS_NewWant_Test getMissionId missionInfos<=======' + missionInfos); + for (let i = 0; i < missionInfos.length; i++) { + console.log('getMissionId result: ' + i + '= ' + JSON.stringify(missionInfos[i])) + if ((missionInfos[i].want.abilityName == "com.example.newwanttest.MainAbility") && + (missionInfos[i].runningState == 0)) { + missionId = missionInfos[i].missionId; + break; + } + } + console.log('======>ACTS_NewWant_Test getMissionId resolve missionId<=======' + missionId); + resolve(missionId); + }) +} + +export default function abilityTest(abilityContext) { + describe('ActsNewWantTest', function () { + + afterEach(async (done) => { + + var testMissionId; + testMissionId = await getMissionId(); + console.log('======>ACTS_NewWant_Test afterEach test missionId<=======' + testMissionId); + await missionManager.moveMissionToFront(testMissionId); + console.log('======>ACTS_NewWant_Test afterEach test move<======='); + + await appManager.killProcessesByBundleName("com.example.newwanthapapi7"); + await appManager.killProcessesByBundleName("com.example.newwanthapa"); + await appManager.killProcessesByBundleName("com.example.newwanthap"); + + done(); + }) + + /** + * @tc.number: ACTS_NewWant_Test_0100 + * @tc.name: Starting standard Ability for the first time does not trigger onNewWant. + * @tc.desc: Starting standard Ability for the first time does not trigger onNewWant. + */ + it('ACTS_NewWant_Test_0100', 0, async function (done) { + console.log("ACTS_NewWant_Test_0100 --- start") + var Subscriber; + var flagOnCreate = 0; + var flagOnWindowStageCreate = 0; + var flagOnForeground = 0; + var flagOnNewWant = 0; + + abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.MainAbility" + }, (error, data) => { + console.log('ACTS_NewWant_Test_0100 - startAbility start standard: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_NewWant_Test_0100====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + + console.debug("ACTS_NewWant_Test_0100====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_NewWant_Test_0100====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + switch (data.event) { + case 'onCreateMain_To_Test_CommonEvent': + flagOnCreate++; + break; + case 'onWindowStageCreateMain_To_Test_CommonEvent': + flagOnWindowStageCreate++; + break; + case 'onForegroundMain_To_Test_CommonEvent': + flagOnForeground++; + break; + case 'onNewWantMain_To_Test_CommonEvent': + flagOnNewWant++; + break; + } + console.debug("ACTS_NewWant_Test_0100====>flagOnCreate:====>" + + flagOnCreate) + console.debug("ACTS_NewWant_Test_0100====>flagOnWindowStageCreate:====>" + + flagOnWindowStageCreate) + console.debug("ACTS_NewWant_Test_0100====>flagOnForeground:====>" + + flagOnForeground) + console.debug("ACTS_NewWant_Test_0100====>flagOnNewWant:====>" + + flagOnNewWant) + if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 + && flagOnForeground == 1 && flagOnNewWant == 0) { + expect(flagOnCreate).assertEqual(1); + expect(flagOnWindowStageCreate).assertEqual(1); + expect(flagOnForeground).assertEqual(1); + expect(flagOnNewWant).assertEqual(0); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + + function UnSubscribeCallback() { + console.debug("ACTS_NewWant_Test_0100====>UnSubscribe CallBack====>"); + done(); + } + }) + + /** + * @tc.number: ACTS_NewWant_Test_0200 + * @tc.name: Starting singleton Ability for the first time does not trigger onNewWant. + * @tc.desc: Starting singleton Ability for the first time does not trigger onNewWant. + */ + it('ACTS_NewWant_Test_0200', 0, async function (done) { + console.log("ACTS_NewWant_Test_0200 --- start") + var Subscriber; + var flagOnCreate = 0; + var flagOnWindowStageCreate = 0; + var flagOnForeground = 0; + var flagOnNewWant = 0; + + abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.SecondAbility" + }, (error, data) => { + console.log('ACTS_NewWant_Test_0200 - startAbility start singleton: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_NewWant_Test_0200====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + + console.debug("ACTS_NewWant_Test_0200====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_NewWant_Test_0200====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + switch (data.event) { + case 'onCreateSecond_To_Test_CommonEvent': + flagOnCreate++; + break; + case 'onWindowStageCreateSecond_To_Test_CommonEvent': + flagOnWindowStageCreate++; + break; + case 'onForegroundSecond_To_Test_CommonEvent': + flagOnForeground++; + break; + case 'onNewWantSecond_To_Test_CommonEvent': + flagOnNewWant++; + break; + } + console.debug("ACTS_NewWant_Test_0200====>flagOnCreate:====>" + + flagOnCreate) + console.debug("ACTS_NewWant_Test_0200====>flagOnWindowStageCreate:====>" + + flagOnWindowStageCreate) + console.debug("ACTS_NewWant_Test_0200====>flagOnForeground:====>" + + flagOnForeground) + console.debug("ACTS_NewWant_Test_0200====>flagOnNewWant:====>" + + flagOnNewWant) + if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 + && flagOnForeground == 1 && flagOnNewWant == 0) { + expect(flagOnCreate).assertEqual(1); + expect(flagOnWindowStageCreate).assertEqual(1); + expect(flagOnForeground).assertEqual(1); + expect(flagOnNewWant).assertEqual(0); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + + function UnSubscribeCallback() { + console.debug("ACTS_NewWant_Test_0200====>UnSubscribe CallBack====>"); + done(); + } + }) + + /** + * @tc.number: ACTS_NewWant_Test_0300 + * @tc.name: Starting standard ability the second time does not trigger onNewWant. + * @tc.desc: Starting standard ability the second time does not trigger onNewWant. + */ + it('ACTS_NewWant_Test_0300', 0, async function (done) { + console.log("ACTS_NewWant_Test_0300 --- start") + var Subscriber; + var flagOnCreate = 0; + var flagOnWindowStageCreate = 0; + var flagOnForeground = 0; + var flagOnNewWant = 0; + + abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.MainAbility", + action: "startStandard0300" + }, (error, data) => { + console.log('ACTS_NewWant_Test_0300 - startAbility start standard: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_NewWant_Test_0300====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + + console.debug("ACTS_NewWant_Test_0300====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_NewWant_Test_0300====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + switch (data.event) { + case 'onCreateMain_To_Test_CommonEvent': + flagOnCreate++; + break; + case 'onWindowStageCreateMain_To_Test_CommonEvent': + flagOnWindowStageCreate++; + break; + case 'onForegroundMain_To_Test_CommonEvent': + flagOnForeground++; + break; + case 'onNewWantMain_To_Test_CommonEvent': + flagOnNewWant++; + break; + } + console.debug("ACTS_NewWant_Test_0300====>flagOnCreate:====>" + + flagOnCreate) + console.debug("ACTS_NewWant_Test_0300====>flagOnWindowStageCreate:====>" + + flagOnWindowStageCreate) + console.debug("ACTS_NewWant_Test_0300====>flagOnForeground:====>" + + flagOnForeground) + console.debug("ACTS_NewWant_Test_0300====>flagOnNewWant:====>" + + flagOnNewWant) + + if (flagOnCreate == 2 && flagOnWindowStageCreate == 2 + && flagOnForeground == 2 && flagOnNewWant == 0) { + expect(flagOnCreate).assertEqual(2); + expect(flagOnWindowStageCreate).assertEqual(2); + expect(flagOnForeground).assertEqual(2); + expect(flagOnNewWant).assertEqual(0); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + function UnSubscribeCallback() { + console.debug("ACTS_NewWant_Test_0300====>UnSubscribe CallBack====>"); + done(); + } + }) + + /** + * @tc.number: ACTS_NewWant_Test_0400 + * @tc.name: Two abilities of the same hap + * @tc.desc: Starting singleton ability the second time does triggers onNewWant. + */ + it('ACTS_NewWant_Test_0400', 0, async function (done) { + console.log("ACTS_NewWant_Test_0400 --- start") + var Subscriber; + var flagOnCreate = 0; + var flagOnWindowStageCreate = 0; + var flagOnForeground = 0; + var flagOnNewWant = 0; + + abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.SecondAbility", + action: "startSingleton0400" + }, (error, data) => { + console.log('ACTS_NewWant_Test_0400 - startAbility start singleton: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_NewWant_Test_0400====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + + console.debug("ACTS_NewWant_Test_0400====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_NewWant_Test_0400====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + switch (data.event) { + case 'onCreateSecond_To_Test_CommonEvent': + flagOnCreate++; + break; + case 'onWindowStageCreateSecond_To_Test_CommonEvent': + flagOnWindowStageCreate++; + break; + case 'onForegroundSecond_To_Test_CommonEvent': + flagOnForeground++; + break; + case 'onNewWantSecond_To_Test_CommonEvent': + flagOnNewWant++; + expect(data.data).assertEqual('restartSingleton'); + break; + } + console.debug("ACTS_NewWant_Test_0400====>flagOnCreate:====>" + + flagOnCreate) + console.debug("ACTS_NewWant_Test_0400====>flagOnWindowStageCreate:====>" + + flagOnWindowStageCreate) + console.debug("ACTS_NewWant_Test_0400====>flagOnForeground:====>" + + flagOnForeground) + console.debug("ACTS_NewWant_Test_0400====>flagOnNewWant:====>" + + flagOnNewWant) + + if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 + && flagOnForeground == 2 && flagOnNewWant == 1) { + expect(flagOnCreate).assertEqual(1); + expect(flagOnWindowStageCreate).assertEqual(1); + expect(flagOnForeground).assertEqual(2); + expect(flagOnNewWant).assertEqual(1); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + + function UnSubscribeCallback() { + console.debug("ACTS_NewWant_Test_0400====>UnSubscribe CallBack====>"); + done(); + } + }) + + /** + * @tc.number: ACTS_NewWant_Test_0500 + * @tc.name: Two haps of the same app + * @tc.desc: Starting singleton ability the second time does triggers onNewWant. + */ + it('ACTS_NewWant_Test_0500', 0, async function (done) { + console.log("ACTS_NewWant_Test_0500 --- start") + var Subscriber; + var flagOnCreate = 0; + var flagOnWindowStageCreate = 0; + var flagOnForeground = 0; + var flagOnNewWant = 0; + + abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapb.MainAbility", + action: "startHapB" + }, (error, data) => { + console.log('ACTS_NewWant_Test_0500 - startAbility start HapB: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_NewWant_Test_0500====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + + console.debug("ACTS_NewWant_Test_0500====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_NewWant_Test_0500====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + switch (data.event) { + case 'onCreateMain_To_Test_CommonEvent': + flagOnCreate++; + break; + case 'onWindowStageCreateMain_To_Test_CommonEvent': + flagOnWindowStageCreate++; + break; + case 'onForegroundMain_To_Test_CommonEvent': + flagOnForeground++; + break; + case 'onNewWantMain_To_Test_CommonEvent': + flagOnNewWant++; + expect(data.data).assertEqual('restartHapB'); + break; + } + console.debug("ACTS_NewWant_Test_0500====>flagOnCreate:====>" + + flagOnCreate) + console.debug("ACTS_NewWant_Test_0500====>flagOnWindowStageCreate:====>" + + flagOnWindowStageCreate) + console.debug("ACTS_NewWant_Test_0500====>flagOnForeground:====>" + + flagOnForeground) + console.debug("ACTS_NewWant_Test_0500====>flagOnNewWant:====>" + + flagOnNewWant) + + if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 + && flagOnForeground == 2 && flagOnNewWant == 1) { + expect(flagOnCreate).assertEqual(1); + expect(flagOnWindowStageCreate).assertEqual(1); + expect(flagOnForeground).assertEqual(2); + expect(flagOnNewWant).assertEqual(1); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + + function UnSubscribeCallback() { + console.debug("ACTS_NewWant_Test_0500====>UnSubscribe CallBack====>"); + done(); + } + }) + + /** + * @tc.number: ACTS_NewWant_Test_0600 + * @tc.name: Cross-application + * @tc.desc: Starting singleton ability the second time does triggers onNewWant. + */ + it('ACTS_NewWant_Test_0600', 0, async function (done) { + console.log("ACTS_NewWant_Test_0600 --- start") + var Subscriber; + var flagOnCreate = 0; + var flagOnWindowStageCreate = 0; + var flagOnForeground = 0; + var flagOnNewWant = 0; + + abilityContext.startAbility({ + bundleName: "com.example.newwanthapa", + abilityName: "com.example.newwanthapc.MainAbility", + action: "startHapC" + }, (error, data) => { + console.log('ACTS_NewWant_Test_0600 - startAbility start HapC: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_NewWant_Test_0600====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + + console.debug("ACTS_NewWant_Test_0600====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_NewWant_Test_0600====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + switch (data.event) { + case 'onCreateMain_To_Test_CommonEvent': + flagOnCreate++; + break; + case 'onWindowStageCreateMain_To_Test_CommonEvent': + flagOnWindowStageCreate++; + break; + case 'onForegroundMain_To_Test_CommonEvent': + flagOnForeground++; + break; + case 'onNewWantMain_To_Test_CommonEvent': + flagOnNewWant++; + expect(data.data).assertEqual('restartHapC'); + break; + } + console.debug("ACTS_NewWant_Test_0600====>flagOnCreate:====>" + + flagOnCreate) + console.debug("ACTS_NewWant_Test_0600====>flagOnWindowStageCreate:====>" + + flagOnWindowStageCreate) + console.debug("ACTS_NewWant_Test_0600====>flagOnForeground:====>" + + flagOnForeground) + console.debug("ACTS_NewWant_Test_0600====>flagOnNewWant:====>" + + flagOnNewWant) + + if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 + && flagOnForeground == 2 && flagOnNewWant == 1) { + expect(flagOnCreate).assertEqual(1); + expect(flagOnWindowStageCreate).assertEqual(1); + expect(flagOnForeground).assertEqual(2); + expect(flagOnNewWant).assertEqual(1); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + + function UnSubscribeCallback() { + console.debug("ACTS_NewWant_Test_0600====>UnSubscribe CallBack====>"); + done(); + } + }) + + /** + * @tc.number: ACTS_NewWant_Test_0700 + * @tc.name: Service ability + * @tc.desc: Starting singleton ability the second time does triggers onNewWant. + */ + it('ACTS_NewWant_Test_0700', 0, async function (done) { + console.log("ACTS_NewWant_Test_0700 --- start") + var Subscriber; + var flagOnCreate = 0; + var flagOnWindowStageCreate = 0; + var flagOnForeground = 0; + var flagOnNewWant = 0; + + abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.SecondAbility", + action: "startSecondAbility0700" + }, (error, data) => { + console.log('ACTS_NewWant_Test_0700 - startAbility start SecondAbility: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_NewWant_Test_0700====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + + console.debug("ACTS_NewWant_Test_0700====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_NewWant_Test_0700====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + switch (data.event) { + case 'onCreateSecond_To_Test_CommonEvent': + flagOnCreate++; + break; + case 'onWindowStageCreateSecond_To_Test_CommonEvent': + flagOnWindowStageCreate++; + break; + case 'onForegroundSecond_To_Test_CommonEvent': + flagOnForeground++; + break; + case 'onNewWantSecond_To_Test_CommonEvent': + flagOnNewWant++; + expect(data.data).assertEqual('restartSecondAbility0700'); + break; + } + console.debug("ACTS_NewWant_Test_0700====>flagOnCreate:====>" + + flagOnCreate) + console.debug("ACTS_NewWant_Test_0700====>flagOnWindowStageCreate:====>" + + flagOnWindowStageCreate) + console.debug("ACTS_NewWant_Test_0700====>flagOnForeground:====>" + + flagOnForeground) + console.debug("ACTS_NewWant_Test_0700====>flagOnNewWant:====>" + + flagOnNewWant) + + if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 + && flagOnForeground == 2 && flagOnNewWant == 1) { + expect(flagOnCreate).assertEqual(1); + expect(flagOnWindowStageCreate).assertEqual(1); + expect(flagOnForeground).assertEqual(2); + expect(flagOnNewWant).assertEqual(1); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + function UnSubscribeCallback() { + console.debug("ACTS_NewWant_Test_0700====>UnSubscribe CallBack====>"); + done(); + } + }) + + /** + * @tc.number: ACTS_NewWant_Test_0800 + * @tc.name: API8 startup API7 + * @tc.desc: Starting singleton ability the second time does triggers onNewWant. + */ + it('ACTS_NewWant_Test_0800', 0, async function (done) { + console.log("ACTS_NewWant_Test_0800 --- start") + var Subscriber; + var flagOnCreate = 0; + var flagOnWindowStageCreate = 0; + var flagOnForeground = 0; + var flagOnNewWant = 0; + + abilityContext.startAbility({ + bundleName: "com.example.newwanthap", + abilityName: "com.example.newwanthapa.SecondAbility", + action: "startSecondAbility0800" + }, (error, data) => { + console.log('ACTS_NewWant_Test_0800 - startAbility start SecondAbility: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }) + + commonEvent.createSubscriber(subscriberInfo).then(async (data) => { + console.debug("ACTS_NewWant_Test_0800====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + function SubscribeCallBack(err, data) { + + console.debug("ACTS_NewWant_Test_0800====>Subscribe CallBack data:====>" + + JSON.stringify(data)); + console.debug("ACTS_NewWant_Test_0800====>Subscribe CallBack data.event:====>" + + JSON.stringify(data.event)); + switch (data.event) { + case 'onCreateSecond_To_Test_CommonEvent': + flagOnCreate++; + break; + case 'onWindowStageCreateSecond_To_Test_CommonEvent': + flagOnWindowStageCreate++; + break; + case 'onForegroundSecond_To_Test_CommonEvent': + flagOnForeground++; + break; + case 'onNewWantSecond_To_Test_CommonEvent': + flagOnNewWant++; + expect(data.data).assertEqual('restartSecondAbility0800'); + break; + } + console.debug("ACTS_NewWant_Test_0800====>flagOnCreate:====>" + + flagOnCreate) + console.debug("ACTS_NewWant_Test_0800====>flagOnWindowStageCreate:====>" + + flagOnWindowStageCreate) + console.debug("ACTS_NewWant_Test_0800====>flagOnForeground:====>" + + flagOnForeground) + console.debug("ACTS_NewWant_Test_0800====>flagOnNewWant:====>" + + flagOnNewWant) + + if (flagOnCreate == 1 && flagOnWindowStageCreate == 1 + && flagOnForeground == 2 && flagOnNewWant == 1) { + expect(flagOnCreate).assertEqual(1); + expect(flagOnWindowStageCreate).assertEqual(1); + expect(flagOnForeground).assertEqual(2); + expect(flagOnNewWant).assertEqual(1); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + } + function UnSubscribeCallback() { + console.debug("ACTS_NewWant_Test_0800====>UnSubscribe CallBack====>"); + done(); + } + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..ecda46da3 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import abilityTest from './Ability.test.ets' + + +export default function testsuite(context) { + + abilityTest(context) + +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/module.json rename to ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/newwant/actsnewwanttest/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/newwant/actsnewwanttest/signature/openharmony_sx.p7b rename to ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/non_concurrent/BUILD.gn b/ability/ability_runtime/non_concurrent/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/BUILD.gn rename to ability/ability_runtime/non_concurrent/BUILD.gn diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/app.json b/ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/app.json new file mode 100644 index 000000000..cf576dc15 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.actsabilitypermissiontest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/resources/base/element/string.json b/ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/BUILD.gn b/ability/ability_runtime/non_concurrent/acts_systemappa_test/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/BUILD.gn rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/BUILD.gn diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/Test.json b/ability/ability_runtime/non_concurrent/acts_systemappa_test/Test.json new file mode 100644 index 000000000..f568cdbf0 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/Test.json @@ -0,0 +1,62 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "300000", + "package": "com.example.actsabilitypermissiontest", + "shell-timeout": "300000" + }, + "kits": [ + { + "test-file-name": [ + "ActsSystemAppATest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount" + ] + }, + { + "type": "PushKit", + "push": [ + "ActsSystemAppATest.hap->/system/app/ActsSystemAppATest.hap" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "acm create -n 101 -t normal", + "acm switch -i 101" + ] + }, + { + "type": "PushKit", + "push": [ + "ActsSystemAppOneRelyHap.hap->/system/app/ActsSystemAppOneRelyHap.hap" + ] + }, + { + "test-file-name": [ + "ActsSystemAppOneRelyHap.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "acm switch -i 100" + ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/*.hap" + ] + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..d88d073b2 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..d96a855d9 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne1() { + console.debug("====>Publish CallBack ACTS_ThirdPartyAbilityPermission_0100_CommonEvent====>"); + globalThis.ability2Context.terminateSelf(); + console.debug("====>close this context====>") +} + + +export default class MainAbility2 extends Ability { + + onCreate(want, launchParam) { + console.log("MainAbility2 onCreate") + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility2 onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/index/index2", null) + globalThis.ability2Context = this.context; + commonEvent.publish("ACTS_AbilityPermission_0100_Start_CommonEvent", PublishCallBackOne1); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility2 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility2 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility2 onBackground") + } +}; diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index2.ets b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index2.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index2.ets rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/index/index2.ets diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets new file mode 100644 index 000000000..d1a70fef8 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/AbilityPermission.test.ets @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// @ts-nocheck +import osaccount from '@ohos.account.osaccount' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import commonEvent from '@ohos.commonEvent' +var AbilityPermission1 = { + events: ["ACTS_AbilityPermission_0100_Start_CommonEvent"] +} +var AbilityPermission3 = { + events: ["ACTS_AbilityPermission_0300_Start_CommonEvent"] +} +var AbilityPermission4 = { + events: ["ACTS_AbilityPermission_0400_Start_CommonEvent"] +} +var AbilityPermission6 = { + events: ["ACTS_AbilityPermission_0600_Start_CommonEvent"] +} +const START_ABILITY_TIMEOUT = 3000; +export default function abilityPermissionTest(abilityContext) { + describe('ActsAbilityPermissionTest', function () { + var osAccountManager = osaccount.getAccountManager(); + var userA; + var userB; + beforeAll(async function(done){ + osAccountManager.getOsAccountLocalIdFromProcess().then((data)=>{ + userA = data + userB=userA+1 + console.log("userA=====>"+userA) + done() + }); + + }) + afterAll(async function(done){ + await osAccountManager.removeOsAccount(userB, (err)=>{ + console.debug("====>remove localId: " + userB + " err:" + JSON.stringify(err)); + expect(err.code).assertEqual(0); + done(); + }) + }) + + /* + * @tc.number: ACTS_AbilityPermission_0100 + * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start + * @tc.desc: Start an ability that belongs to the current user with the current user + */ + it('ACTS_AbilityPermission_0100', 0, async function (done) { + console.log("ACTS_AbilityPermission_0100====>callback start====>") + var Subscriber; + var flag = true; + + function SubscribeCallBack(err, data) { + console.debug("ACTS_AbilityPermission_0100====>Subscribe CallBack data:====>" + JSON.stringify(data)); + expect(data.event == 'ACTS_AbilityPermission_0100_Start_CommonEvent').assertTrue() + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + + commonEvent.createSubscriber(AbilityPermission1).then(async (data) => { + console.debug("ACTS_AbilityPermission_0100====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>start startAbility_100====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actsabilitypermissiontest', + abilityName: 'com.example.actsabilitypermissiontest.MainAbility2' + }, userA, () => { + console.debug("====>startAbility end_100====>"); + }) + }) + + function UnSubscribeCallback() { + flag = false + console.debug("ACTS_AbilityPermission_0100====>UnSubscribe CallBack====>"+flag); + done(); + } + setTimeout(()=>{ + if (flag == true) { + expect().assertFail(); + console.debug('in ACTS_AbilityPermission_0100====>timeout====>'+flag); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + console.debug('ACTS_AbilityPermission_0100====>timeout====>'); + }, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number: ACTS_AbilityPermission_0300 + * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start + * @tc.desc: Start an ability under user U101 with the current user + */ + it('ACTS_AbilityPermission_0300', 0, async function (done) { + console.log("ACTS_AbilityPermission_0300====>callback start====>") + var Subscriber + var flag = 0; + console.debug("====>get AccountManager finish===="); + + function SubscribeCallBack(err, data) { + console.debug("ACTS_AbilityPermission_0300====>Subscribe CallBack data:====>" + JSON.stringify(data)); + expect(data.event == 'ACTS_AbilityPermission_0300_Start_CommonEvent').assertTrue() + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + commonEvent.createSubscriber(AbilityPermission3).then(async (data) => { + console.debug("ACTS_AbilityPermission_0300====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>start startAbility_0300====>"); + await abilityContext.startAbilityWithAccount( + { + bundleName: 'com.example.actssystemappuonehundredonerelytest', + abilityName: 'com.example.actssystemappuonehundredonerelytest.MainAbility' + }, userA ).then().catch((err) => { + console.debug("ACTS_AbilityPermission_0300====>" + err) + + console.debug("====>startAbility end_0300====>"); + }) + }) + function UnSubscribeCallback() { + if(flag == 0) { + expect().assertFail(); + } + console.debug("ACTS_AbilityPermission_0300====>UnSubscribe CallBack====>"); + done(); + } + function timeout() { + console.debug('ACTS_AbilityPermission_0300====>timeout====>'); + if(flag == 0){ + flag = 1; + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number: ACTS_AbilityPermission_0400 + * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start + * @tc.desc: Bind an Ability to which you belong with the current user + */ + it('ACTS_AbilityPermission_0400', 0, async function (done) { + console.log("ACTS_AbilityPermission_0400====>callback start====>") + let Subscriber + var flag = true + + function SubscribeCallBack(err, data) { + expect(data.event == "ACTS_AbilityPermission_0400_Start_CommonEvent").assertTrue(); + console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); + abilityContext.disconnectAbility(globalThis.number).then((data) => { + console.debug("====>data is====>" + JSON.stringify(data)); + }) + console.log('====>disconnectAbility finish'); + } + + function onConnectCallback(element, remote) { + console.log('ACTS_AbilityPermission_0400_Start_CommonEvent onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_AbilityPermission_0400_Start_CommonEvent onConnectCallback====> remote=' + JSON.stringify(remote)); + setTimeout(() => { + console.log('====>in timeout'); + console.debug("====>flag is====>" + JSON.stringify(flag)); + if (flag == true) { + console.debug('ACTS_AbilityPermission_0400_Start_CommonEvent - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + } + }, 1000); + } + + function onDisconnectCallback(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + + function onFailedCallback(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + + commonEvent.createSubscriber(AbilityPermission4).then(async (data) => { + console.debug("====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBack); + console.debug("====>0400start connectAbility====>"); + globalThis.number = await abilityContext.connectAbilityWithAccount( + { + bundleName: 'com.example.actsabilitypermissiontest', + abilityName: 'com.example.actsabilitypermissiontest.ServiceAbility', + action: "StartAbilityPromise" + }, userA, { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback, + onFailed: onFailedCallback + }) + console.debug("====>number is====>" + JSON.stringify(globalThis.number)); + }) + + function UnSubscribeCallback() { + console.debug("====>UnSubscribeCallback====>"); + flag = false + done() + } + + function timeout() { + console.debug('in ACTS_AbilityPermission_0400_Start_CommonEvent timeout'); + if (flag == true) { + expect().assertFail(); + console.debug('ACTS_AbilityPermission_0400_Start_CommonEvent - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + } + } + setTimeout(timeout, START_ABILITY_TIMEOUT); + }) + + /* + * @tc.number: ACTS_AbilityPermission_0600 + * @tc.name: In non-concurrent mode, if the target application is not the current user, it is forbidden to start + * @tc.desc: Bind a U101 Ability with the current user + */ + it('ACTS_AbilityPermission_0600', 0, async function (done) { + console.log("ACTS_AbilityPermission_0600====>callback start====>") + let Subscriber + let connId + function onConnectCallbackC(element, remote) { + console.log('ACTS_AbilityPermission_0600_Start_CommonEvent onConnectCallback====> element=' + JSON.stringify(element)); + console.log('ACTS_AbilityPermission_0600_Start_CommonEvent onConnectCallback====> remote=' + JSON.stringify(remote)); + expect().assertFail(); + } + function onDisconnectCallbackC(element) { + console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); + } + function onFailedCallbackC(code) { + console.log('onFailedCallback====> code=' + JSON.stringify(code)) + } + function SubscribeCallBackF(err, data) { + console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); + } + function UnSubscribeCallbackF() { + console.debug("====>UnSubscribeCallback====>"); + } + commonEvent.createSubscriber(AbilityPermission6).then(async (data) => { + console.debug("====>Create Subscriber====>"); + Subscriber = data; + commonEvent.subscribe(Subscriber, SubscribeCallBackF); + }) + console.debug("====>0600start connectAbility====>"); + connId = await abilityContext.connectAbilityWithAccount( + { + bundleName: 'com.example.actssystemappuonehundredonerelytest', + abilityName: 'com.example.actssystemappuonehundredonerelytest.ServiceAbility', + action: "StartAbilityPromise" + }, userA, { + onConnect: onConnectCallbackC, + onDisconnect: onDisconnectCallbackC, + onFailed: onFailedCallbackC + }) + console.debug("====>number is====>" + JSON.stringify(connId)); + setTimeout(() =>{ + console.debug('in ACTS_AbilityPermission_0600_Start_CommonEvent timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallbackF) + done() + }, START_ABILITY_TIMEOUT); + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..998089c74 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityPermissionText from './AbilityPermission.test.ets' + +export default function testsuite(context) { + abilityPermissionText(context) +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json new file mode 100644 index 000000000..c8dcd29a0 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json @@ -0,0 +1,121 @@ +{ + "module": { + "name": "com.example.actsabilitypermissiontest", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actsabilitypermissiontest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + }, + { + "name": "com.example.actsabilitypermissiontest.MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.example.actsabilitypermissiontest.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + }, + { + "name":"ohos.permission.MANAGE_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" + }, + { + "name":"ohos.permission.INTERACT_ACROSS)LOCAL_ACCOUNTS_EXTENSION", + "reason":"need use ohos.permission.INTERACT_ACROSS)LOCAL_ACCOUNTS_EXTENSION" + }, + { + "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + } + ] + } +} diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b b/ability/ability_runtime/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b rename to ability/ability_runtime/non_concurrent/acts_systemappa_test/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/app.json b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/app.json new file mode 100644 index 000000000..22ec98ecb --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.acts.pmvendorappa", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/element/string.json b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/BUILD.gn b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/BUILD.gn rename to ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/BUILD.gn diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/Test.json b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..7335dbf49 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' +function PublishCallBackOne3() { + console.debug("====>Publish CallBack ACTS_StartAbility_0300_CommonEvent====>"); + setTimeout(globalThis.abilityContext.terminateSelfWithResult(()=>{ + console.debug("====>terminateSelfWithResult succese====>") + }),1000) +} + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + commonEvent.publish("ACTS_AbilityPermission_0300_Start_CommonEvent", PublishCallBackOne3); + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json new file mode 100644 index 000000000..620defb95 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json @@ -0,0 +1,48 @@ +{ + "module": { + "name": "com.example.actssystemappuonehundredonerelytest", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.actssystemappuonehundredonerelytest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.example.actssystemappuonehundredonerelytest.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ] + } +} diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b rename to ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/processmultiinstance/BUILD.gn b/ability/ability_runtime/processmultiinstance/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/BUILD.gn rename to ability/ability_runtime/processmultiinstance/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/app.json new file mode 100644 index 000000000..26ab7bd17 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.multiinstancehapa", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..f770af1c8 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("ACTS_Process_MultiInstance_HapAA MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("ACTS_Process_MultiInstance_HapAA MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("ACTS_Process_MultiInstance_HapAA MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + + commonEvent.publish("HapAA_To_Test_CommonEvent", () => { + console.log("ACTS_Process_MultiInstance_HapAA Publish CallBack HapAA_To_Test_CommonEvent") + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("ACTS_Process_MultiInstance_HapAA MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_Process_MultiInstance_HapAA MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("ACTS_Process_MultiInstance_HapAA MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json new file mode 100644 index 000000000..1089647e9 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json @@ -0,0 +1,37 @@ +{ + "module": { + "name": "com.example.multiinstancehapaa", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.multiinstancehapaa.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/app.json new file mode 100644 index 000000000..26ab7bd17 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.multiinstancehapa", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..ef8a0e1a5 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("ACTS_Process_MultiInstance_HapAB MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("ACTS_Process_MultiInstance_HapAB MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("ACTS_Process_MultiInstance_HapAB MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index/index", null) + + commonEvent.publish("HapAB_To_Test_CommonEvent", () => { + console.log("ACTS_Process_MultiInstance_HapAB Publish CallBack HapAB_To_Test_CommonEvent") + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("ACTS_Process_MultiInstance_HapAB MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_Process_MultiInstance_HapAB MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("ACTS_Process_MultiInstance_HapAB MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json new file mode 100644 index 000000000..7e3387923 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json @@ -0,0 +1,38 @@ +{ + "module": { + "name": "com.example.multiinstancehapab", + "process": "com.example.multiinstancehapb", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.multiinstancehapab.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/app.json new file mode 100644 index 000000000..d307b6fff --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.multiinstancehapb", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..f1c52538a --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +let connectionId = -1; + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context; + + let context = this.context; + + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_Process_MultiInstance_HapBA MainAbility onForeground") + commonEvent.publish("HapBA_To_Test_CommonEvent", () => { + console.log("ACTS_Process_MultiInstance_HapBA Publish CallBack HapBA_To_Test_CommonEvent") + }); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json new file mode 100644 index 000000000..73bdcb7f6 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json @@ -0,0 +1,37 @@ +{ + "module": { + "name": "com.example.multiinstancehapba", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.multiinstancehapba.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/app.json new file mode 100644 index 000000000..d307b6fff --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.multiinstancehapb", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..fdd62659d --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +let connectionId = -1; + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context; + + let context = this.context; + + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_Process_MultiInstance_HapBB MainAbility onForeground") + commonEvent.publish("HapBB_To_Test_CommonEvent", () => { + console.log("ACTS_Process_MultiInstance_HapBB Publish CallBack HapBB_To_Test_CommonEvent") + }); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json new file mode 100644 index 000000000..9d46fa80f --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json @@ -0,0 +1,37 @@ +{ + "module": { + "name": "com.example.multiinstancehapbb", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.multiinstancehapbb.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/app.json new file mode 100644 index 000000000..d307b6fff --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.multiinstancehapb", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..6782e5820 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +let connectionId = -1; + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context; + + let context = this.context; + + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_Process_MultiInstance_HapBC MainAbility onForeground") + commonEvent.publish("HapBC_To_Test_CommonEvent", () => { + console.log("ACTS_Process_MultiInstance_HapBC Publish CallBack HapBC_To_Test_CommonEvent") + }); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json new file mode 100644 index 000000000..e14379235 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json @@ -0,0 +1,38 @@ +{ + "module": { + "name": "com.example.multiinstancehapbc", + "process": "com.example.multiinstancehapc", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.multiinstancehapbc.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/app.json new file mode 100644 index 000000000..d307b6fff --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.multiinstancehapb", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..cf0378810 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +let connectionId = -1; + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context; + + let context = this.context; + + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_Process_MultiInstance_HapBD MainAbility onForeground") + commonEvent.publish("HapBD_To_Test_CommonEvent", () => { + console.log("ACTS_Process_MultiInstance_HapBD Publish CallBack HapBD_To_Test_CommonEvent") + }); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json new file mode 100644 index 000000000..ead67d4bb --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json @@ -0,0 +1,38 @@ +{ + "module": { + "name": "com.example.multiinstancehapbd", + "process": "com.example.multiinstancehapc", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.multiinstancehapbd.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/app.json new file mode 100644 index 000000000..d307b6fff --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.multiinstancehapb", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..b043dc469 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +let connectionId = -1; + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context; + + let context = this.context; + + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_Process_MultiInstance_HapBE MainAbility onForeground") + commonEvent.publish("HapBE_To_Test_CommonEvent", () => { + console.log("ACTS_Process_MultiInstance_HapBE Publish CallBack HapBE_To_Test_CommonEvent") + }); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json new file mode 100644 index 000000000..527f67cd1 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json @@ -0,0 +1,38 @@ +{ + "module": { + "name": "com.example.multiinstancehapbe", + "process": "com.example.multiinstancehapa", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.multiinstancehapbe.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/app.json new file mode 100644 index 000000000..d307b6fff --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.multiinstancehapb", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/BUILD.gn diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..0d3d245f9 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' +import commonEvent from '@ohos.commonEvent' + +let connectionId = -1; + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context; + + let context = this.context; + + windowStage.setUIContent(this.context, "pages/index/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("ACTS_Process_MultiInstance_HapBF MainAbility onForeground") + commonEvent.publish("HapBF_To_Test_CommonEvent", () => { + console.log("ACTS_Process_MultiInstance_HapBF Publish CallBack HapBF_To_Test_CommonEvent") + }); + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json new file mode 100644 index 000000000..d9eb79683 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json @@ -0,0 +1,38 @@ +{ + "module": { + "name": "com.example.multiinstancehapbf", + "process": "com.example.multiinstancehapb", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.multiinstancehapbf.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/app.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/app.json similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/app.json rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/app.json diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/BUILD.gn b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/BUILD.gn rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/BUILD.gn diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/Test.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/Test.json similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/Test.json rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/Test.json diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/index/index.ets similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/second/second.ets similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/List.test.ets similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/element/string.json similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/signature/openharmony_sx.p7b b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/processmultiinstance/actsamsprocessmultiinstancetest/signature/openharmony_sx.p7b rename to ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/stage/BUILD.gn b/ability/ability_runtime/stage/BUILD.gn new file mode 100644 index 000000000..f05ebb7ec --- /dev/null +++ b/ability/ability_runtime/stage/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +group("stage") { + testonly = true + if (is_standard_system) { + deps = [ + "actslifecyclemultihap2test:ActsLifecycleMultiHap2Test", + "actslifecyclemultihap3test:ActsLifecycleMultiHap3Test", + "actslifecyclemultihaptest:ActsLifecycleMultiHapTest", + "actslifecyclesinglehaptest:ActsLifecycleSingleHapTest", + ] + } +} diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/app.json b/ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/app.json new file mode 100644 index 000000000..c5c4b86cc --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.lifecycletest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon": "$media:icon", + "label": "$string:app_name", + "description": "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 9, + "targetAPIVersion": 9, + "car": { + "apiCompatibleVersion": 9, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..d1bcc101e --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"LifecycleHap2Test" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap2test/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/stage/actslifecyclemultihap2test/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/BUILD.gn b/ability/ability_runtime/stage/actslifecyclemultihap2test/BUILD.gn new file mode 100644 index 000000000..50af07476 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsLifecycleMultiHap2Test") { + hap_profile = "entry/src/main/module.json" + deps = [ + ":actslifecyclemultihap2test_js_assets", + ":actslifecyclemultihap2test_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsLifecycleMultiHap2Test" +} + +ohos_app_scope("actslifecyclemultihap2test_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("actslifecyclemultihap2test_js_assets") { + source_dir = "entry/src/main/ets" +} + +ohos_resources("actslifecyclemultihap2test_resources") { + sources = [ "entry/src/main/resources" ] + deps = [ ":actslifecyclemultihap2test_app_profile" ] + hap_profile = "entry/src/main/module.json" +} diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/Test.json b/ability/ability_runtime/stage/actslifecyclemultihap2test/Test.json new file mode 100644 index 000000000..f90168bef --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "180000", + "package": "com.example.lifecycletest", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsLifecycleMultiHap2Test.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility1/Hap2MainAbility1.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility1/Hap2MainAbility1.ts new file mode 100644 index 000000000..bec960b3c --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility1/Hap2MainAbility1.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility1 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility1 onCreate") + globalThis.abilityWant = want; + + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility1 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility1 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility1_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility1 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility1 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility1 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility10/Hap2MainAbility10.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility10/Hap2MainAbility10.ts new file mode 100644 index 000000000..347dedffc --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility10/Hap2MainAbility10.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility10 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility10 onCreate") + globalThis.abilityWant = want; + + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility10 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility10 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility10_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility10 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility10 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility10 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility2/Hap2MainAbility2.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility2/Hap2MainAbility2.ts new file mode 100644 index 000000000..a37bf2c0a --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility2/Hap2MainAbility2.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility2 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility2 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility2 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility2_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility2 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility2 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility2 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility3/Hap2MainAbility3.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility3/Hap2MainAbility3.ts new file mode 100644 index 000000000..a854922b4 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility3/Hap2MainAbility3.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility3 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility3 onCreate") + globalThis.abilityWant = want; + + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap2MainAbility3 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap2MainAbility3 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 2000) + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility3 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility3 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility3_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility3 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility3 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility3 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility4/Hap2MainAbility4.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility4/Hap2MainAbility4.ts new file mode 100644 index 000000000..b6f878c71 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility4/Hap2MainAbility4.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility4 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility4 onCreate") + globalThis.abilityWant = want; + + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap2MainAbility4 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap2MainAbility4 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 2000) + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility4 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility4 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility4_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility4 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility4 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility4 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility5/Hap2MainAbility5.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility5/Hap2MainAbility5.ts new file mode 100644 index 000000000..63bb90174 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility5/Hap2MainAbility5.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility5 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility5 onCreate") + globalThis.abilityWant = want; + + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap2MainAbility5 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap2MainAbility5 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 2000) + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility5 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility5 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility5_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility5 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility5 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility5 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility6/Hap2MainAbility6.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility6/Hap2MainAbility6.ts new file mode 100644 index 000000000..37b0c2335 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility6/Hap2MainAbility6.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility6 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility6 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility6 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility6 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility6_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility6 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility6 onForeground") + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap2MainAbility6 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap2MainAbility6 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 2000) + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility6 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility7/Hap2MainAbility7.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility7/Hap2MainAbility7.ts new file mode 100644 index 000000000..b6db343ce --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility7/Hap2MainAbility7.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility7 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility7 onCreate") + globalThis.abilityWant = want; + + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap2MainAbility7 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap2MainAbility7 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 2000) + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility7 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility7 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility7_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility7 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility7 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility7 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility8/Hap2MainAbility8.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility8/Hap2MainAbility8.ts new file mode 100644 index 000000000..65a9a6373 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility8/Hap2MainAbility8.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility8 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility8 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility8 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility8 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility8_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resourcesl + console.log("[Demo] Hap2MainAbility8 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility8 onForeground") + + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap2MainAbility8 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap2MainAbility8 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 500) + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility8 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility9/Hap2MainAbility9.ts b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility9/Hap2MainAbility9.ts new file mode 100644 index 000000000..63a663c39 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/Hap2MainAbility9/Hap2MainAbility9.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ability from '@ohos.application.Ability' + +export default class Hap2MainAbility9 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap2MainAbility9 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] Hap2MainAbility9 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap2MainAbility9 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap2MainAbility9_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap2MainAbility9 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap2MainAbility9 onForeground") + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap2MainAbility9 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap2MainAbility9 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 500) + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap2MainAbility9 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility10_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility10_pages.ets new file mode 100644 index 000000000..dc63965cb --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility10_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility10_pages { + @State message: string = 'Hap2MainAbility10' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility1_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility1_pages.ets new file mode 100644 index 000000000..0b6d6f9a5 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility1_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility1_pages { + @State message: string = 'Hap2MainAbility1' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility2_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility2_pages.ets new file mode 100644 index 000000000..7992f9f03 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility2_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility2_pages { + @State message: string = 'Hap2MainAbility2' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility3_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility3_pages.ets new file mode 100644 index 000000000..dab4f096f --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility3_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility3_pages { + @State message: string = 'Hap2MainAbility3' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility4_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility4_pages.ets new file mode 100644 index 000000000..d19f359d5 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility4_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility4_pages { + @State message: string = 'Hap2MainAbility4' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility5_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility5_pages.ets new file mode 100644 index 000000000..ca736ab24 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility5_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility5_pages { + @State message: string = 'Hap2MainAbility5' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility6_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility6_pages.ets new file mode 100644 index 000000000..770bf42ca --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility6_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility6_pages { + @State message: string = 'Hap2MainAbility6' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility7_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility7_pages.ets new file mode 100644 index 000000000..debef0b41 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility7_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility7_pages { + @State message: string = 'Hap2MainAbility7' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility8_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility8_pages.ets new file mode 100644 index 000000000..657a45041 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility8_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility8_pages { + @State message: string = 'Hap2MainAbility8' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility9_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility9_pages.ets new file mode 100644 index 000000000..3ecfb15ce --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/ets/pages/Hap2MainAbility9_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap2MainAbility9_pages { + @State message: string = 'Hap2MainAbility9' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/module.json b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/module.json new file mode 100644 index 000000000..9f1792371 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/module.json @@ -0,0 +1,121 @@ +{ + "module": { + "name": "hap2", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:hap2_desc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.example.lifecycletest.Hap2MainAbility1", + "srcEntrance": "./ets/Hap2MainAbility1/Hap2MainAbility1.ts", + "description": "$string:Hap2MainAbility1_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility1_label", + "visible": true, + "orientation": "portrait", + "skills": [{ + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + }] + }, + { + "name": "Hap2MainAbility2", + "srcEntrance": "./ets/Hap2MainAbility2/Hap2MainAbility2.ts", + "description": "$string:Hap2MainAbility2_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility2_label" + }, + { + "name": "Hap2MainAbility3", + "srcEntrance": "./ets/Hap2MainAbility3/Hap2MainAbility3.ts", + "description": "$string:Hap2MainAbility3_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility3_label" + }, + { + "name": "Hap2MainAbility4", + "srcEntrance": "./ets/Hap2MainAbility4/Hap2MainAbility4.ts", + "description": "$string:Hap2MainAbility4_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility4_label", + "launchType": "singleton" + }, + { + "name": "Hap2MainAbility5", + "srcEntrance": "./ets/Hap2MainAbility5/Hap2MainAbility5.ts", + "description": "$string:Hap2MainAbility5_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility5_label", + "launchType": "standard" + }, + { + "name": "Hap2MainAbility6", + "srcEntrance": "./ets/Hap2MainAbility6/Hap2MainAbility6.ts", + "description": "$string:Hap2MainAbility6_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility6_label" + }, + { + "name": "Hap2MainAbility7", + "srcEntrance": "./ets/Hap2MainAbility7/Hap2MainAbility7.ts", + "description": "$string:Hap2MainAbility7_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility7_label" + }, + { + "name": "Hap2MainAbility8", + "srcEntrance": "./ets/Hap2MainAbility8/Hap2MainAbility8.ts", + "description": "$string:Hap2MainAbility8_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility8_label" + }, + { + "name": "Hap2MainAbility9", + "srcEntrance": "./ets/Hap2MainAbility9/Hap2MainAbility9.ts", + "description": "$string:Hap2MainAbility9_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility9_label" + }, + { + "name": "Hap2MainAbility10", + "srcEntrance": "./ets/Hap2MainAbility10/Hap2MainAbility10.ts", + "description": "$string:Hap2MainAbility10_desc", + "icon": "$media:icon", + "label": "$string:Hap2MainAbility10_label" + }], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.MANAGE_MISSIONS" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..f892fcdcb --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/resources/base/element/string.json @@ -0,0 +1,120 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsLifecycleMultihapTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "hap2_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "Hap2MainAbility1_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility1_label", + "value": "label" + }, + { + "name": "Hap2MainAbility2_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility2_label", + "value": "label" + }, + { + "name": "Hap2MainAbility3_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility3_label", + "value": "label" + }, + { + "name": "Hap2MainAbility4_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility4_label", + "value": "label" + }, + { + "name": "Hap2MainAbility5_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility5_label", + "value": "label" + }, + { + "name": "Hap2MainAbility6_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility6_label", + "value": "label" + }, + { + "name": "Hap2MainAbility7_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility7_label", + "value": "label" + }, + { + "name": "Hap2MainAbility8_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility8_label", + "value": "label" + }, + { + "name": "Hap2MainAbility9_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility9_label", + "value": "label" + }, + { + "name": "Hap2MainAbility10_desc", + "value": "description" + }, + { + "name": "Hap2MainAbility10_label", + "value": "label" + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap2test/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/stage/actslifecyclemultihap2test/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap2test/signature/openharmony_sx.p7b b/ability/ability_runtime/stage/actslifecyclemultihap2test/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap2test/signature/openharmony_sx.p7b rename to ability/ability_runtime/stage/actslifecyclemultihap2test/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/app.json b/ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/app.json new file mode 100644 index 000000000..c5c4b86cc --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.lifecycletest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon": "$media:icon", + "label": "$string:app_name", + "description": "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 9, + "targetAPIVersion": 9, + "car": { + "apiCompatibleVersion": 9, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..40cc8793e --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"LifecycleHap3Test" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap3test/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/stage/actslifecyclemultihap3test/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/BUILD.gn b/ability/ability_runtime/stage/actslifecyclemultihap3test/BUILD.gn new file mode 100644 index 000000000..d163f02cf --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsLifecycleMultiHap3Test") { + hap_profile = "entry/src/main/module.json" + deps = [ + ":actslifecyclemultihap3test_js_assets", + ":actslifecyclemultihap3test_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsLifecycleMultiHap3Test" +} + +ohos_app_scope("actslifecyclemultihap3test_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("actslifecyclemultihap3test_js_assets") { + source_dir = "entry/src/main/ets" +} + +ohos_resources("actslifecyclemultihap3test_resources") { + sources = [ "entry/src/main/resources" ] + deps = [ ":actslifecyclemultihap3test_app_profile" ] + hap_profile = "entry/src/main/module.json" +} diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/Test.json b/ability/ability_runtime/stage/actslifecyclemultihap3test/Test.json new file mode 100644 index 000000000..9fe74e621 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "180000", + "package": "com.example.lifecycletest", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsLifecycleMultiHap3Test.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility1/Hap3MainAbility1.ts b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility1/Hap3MainAbility1.ts new file mode 100644 index 000000000..6cf700e0b --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility1/Hap3MainAbility1.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import commonEvent from '@ohos.commonEvent'; +import Ability from '@ohos.application.Ability' + +export default class Hap3MainAbility1 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap3MainAbility1 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] Hap3MainAbility1 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap3MainAbility1 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap3MainAbility1_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap3MainAbility1 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap3MainAbility1 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap3MainAbility1 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility2/Hap3MainAbility2.ts b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility2/Hap3MainAbility2.ts new file mode 100644 index 000000000..7162be27b --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility2/Hap3MainAbility2.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap3MainAbility2 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap3MainAbility2 onCreate") + globalThis.abilityWant = want; + + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap3MainAbility2 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap3MainAbility2 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 2000) + } + + onDestroy() { + console.log("[Demo] Hap3MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap3MainAbility2 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap3MainAbility2_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap3MainAbility2 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap3MainAbility2 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap3MainAbility2 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility3/Hap3MainAbility3.ts b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility3/Hap3MainAbility3.ts new file mode 100644 index 000000000..23852902a --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/Hap3MainAbility3/Hap3MainAbility3.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import commonEvent from '@ohos.commonEvent'; +import Ability from '@ohos.application.Ability' + +export default class Hap3MainAbility3 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap3MainAbility3 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] Hap3MainAbility3 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap3MainAbility3 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap3MainAbility3_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap3MainAbility3 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap3MainAbility3 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap3MainAbility3 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility1_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility1_pages.ets new file mode 100644 index 000000000..6a9ce9f21 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility1_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap3MainAbility1_pages { + @State message: string = 'Hap3MainAbility1' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility2_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility2_pages.ets new file mode 100644 index 000000000..7b9f5c021 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility2_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap3MainAbility2_pages { + @State message: string = 'Hap3MainAbility2' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility3_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility3_pages.ets new file mode 100644 index 000000000..408e868c5 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/ets/pages/Hap3MainAbility3_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Hap3MainAbility3_pages { + @State message: string = 'Hap3MainAbility3' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/module.json b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/module.json new file mode 100644 index 000000000..52dbb626f --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/module.json @@ -0,0 +1,70 @@ +{ + "module": { + "name": "hap3", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:hap3_desc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.example.lifecycletest.Hap3MainAbility1", + "srcEntrance": "./ets/Hap3MainAbility1/Hap3MainAbility1.ts", + "description": "$string:Hap3MainAbility1_desc", + "icon": "$media:icon", + "label": "$string:Hap3MainAbility1_label", + "visible": true, + "orientation": "portrait", + "skills": [{ + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + }] + }, + { + "name": "Hap3MainAbility2", + "srcEntrance": "./ets/Hap3MainAbility2/Hap3MainAbility2.ts", + "description": "$string:Hap3MainAbility2_desc", + "icon": "$media:icon", + "label": "$string:Hap3MainAbility2_label" + }, + { + "name": "Hap3MainAbility3", + "srcEntrance": "./ets/Hap3MainAbility3/Hap3MainAbility3.ts", + "description": "$string:Hap3MainAbility3_desc", + "icon": "$media:icon", + "label": "$string:Hap3MainAbility3_label" + }], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.MANAGE_MISSIONS" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..128e6511d --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/resources/base/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsLifecycleMultihapTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "hap3_desc", + "value": "description" + }, + { + "name": "Hap3MainAbility1_desc", + "value": "description" + }, + { + "name": "Hap3MainAbility1_label", + "value": "label" + }, + { + "name": "Hap3MainAbility2_desc", + "value": "description" + }, + { + "name": "Hap3MainAbility2_label", + "value": "label" + }, + { + "name": "Hap3MainAbility3_desc", + "value": "description" + }, + { + "name": "Hap3MainAbility3_label", + "value": "label" + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap3test/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/stage/actslifecyclemultihap3test/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihap3test/signature/openharmony_sx.p7b b/ability/ability_runtime/stage/actslifecyclemultihap3test/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihap3test/signature/openharmony_sx.p7b rename to ability/ability_runtime/stage/actslifecyclemultihap3test/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/app.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/app.json new file mode 100644 index 000000000..c5c4b86cc --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.lifecycletest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon": "$media:icon", + "label": "$string:app_name", + "description": "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 9, + "targetAPIVersion": 9, + "car": { + "apiCompatibleVersion": 9, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..0d1f12ea9 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"LifecycleTest" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihaptest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/stage/actslifecyclemultihaptest/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/BUILD.gn b/ability/ability_runtime/stage/actslifecyclemultihaptest/BUILD.gn new file mode 100644 index 000000000..fe3b14b8a --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsLifecycleMultiHapTest") { + hap_profile = "entry/src/main/module.json" + deps = [ + ":actslifecyclemultihaptest_js_assets", + ":actslifecyclemultihaptest_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsLifecycleMultiHapTest" +} + +ohos_app_scope("actslifecyclemultihaptest_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("actslifecyclemultihaptest_js_assets") { + source_dir = "entry/src/main/ets" +} + +ohos_resources("actslifecyclemultihaptest_resources") { + sources = [ "entry/src/main/resources" ] + deps = [ ":actslifecyclemultihaptest_app_profile" ] + hap_profile = "entry/src/main/module.json" +} diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/Test.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/Test.json new file mode 100644 index 000000000..d188df594 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/Test.json @@ -0,0 +1,20 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "180000", + "package": "com.example.lifecycletest", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsLifecycleMultiHapTest.hap", + "ActsLifecycleMultiHap2Test.hap", + "ActsLifecycleMultiHap3Test.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..a9d13d23d --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + console.log("[Demo] MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context; + windowStage.setUIContent(this.context, "pages/MainAbility_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts new file mode 100644 index 000000000..9a351b4c5 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility1 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility1 onCreate") + globalThis.abilityWant = want; + + var listKey = []; + var abilityName = ""; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityCreate") + listKey.push(abilityName +" onAbilityCreate"); + console.log("listKey is :" + listKey); + }, + onAbilityWindowStageCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityWindowStageCreate") + listKey.push(abilityName +" onAbilityWindowStageCreate"); + console.log("listKey is :" + listKey); + }, + onAbilityForeground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityForeground") + listKey.push(abilityName +" onAbilityForeground"); + console.log("listKey is :" + listKey); + }, + onAbilityBackground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityBackground") + listKey.push(abilityName +" onAbilityBackground"); + console.log("listKey is :" + listKey); + }, + onAbilityWindowStageDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityWindowStageDestroy") + listKey.push(abilityName +" onAbilityWindowStageDestroy"); + console.log("listKey is :" + listKey); + }, + onAbilityDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityDestroy") + listKey.push(abilityName +" onAbilityDestroy"); + console.log("listKey is :" + listKey); + }, + onAbilityContinue(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityContinue") + listKey.push(abilityName +" onAbilityContinue"); + console.log("listKey is :" + listKey); + } + } + + globalThis.mainAbility1ListKey = listKey + var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); + globalThis.mainAbility1CallBackId = callBackId + setTimeout(() => { + console.log("listKey is :" + listKey); + console.log("callBackId is :" + callBackId); + this.context.getApplicationContext().unregisterAbilityLifecycleCallback (callBackId, (error, data)=> { + console.log("unRegisterAbilityLifecycleCallback err is :" + + JSON.stringify(error) + ",data is : " + JSON.stringify(data)) + }); + }, 4000) + + + setTimeout(()=>{ + this.context.terminateSelf().then((data) => { + console.log("[Demo] MainAbility1 terminateSelf windowStage data: " + JSON.stringify(data)) + }).catch((error) => { + console.log("[Demo] MainAbility1 terminateSelf windowStage error: " + JSON.stringify(error)) + }) + }, 3000) + } + + onDestroy() { + console.log("[Demo] MainAbility1 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility1 onWindowStageCreate") + globalThis.ability2Context = this.context; + windowStage.setUIContent(this.context, "pages/MainAbility1_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility1 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility1 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility1 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..133af9605 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility2 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility2 onCreate") + globalThis.abilityWant = want; + + var listKey = []; + var abilityName = ""; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityCreate") + listKey.push(abilityName +" onAbilityCreate"); + console.log("listKey is :" + listKey); + }, + onAbilityWindowStageCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityWindowStageCreate") + listKey.push(abilityName +" onAbilityWindowStageCreate"); + console.log("listKey is :" + listKey); + }, + onAbilityForeground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityForeground") + listKey.push(abilityName +" onAbilityForeground"); + console.log("listKey is :" + listKey); + }, + onAbilityBackground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityBackground") + listKey.push(abilityName +" onAbilityBackground"); + console.log("listKey is :" + listKey); + }, + onAbilityWindowStageDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityWindowStageDestroy") + listKey.push(abilityName +" onAbilityWindowStageDestroy"); + console.log("listKey is :" + listKey); + }, + onAbilityDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityDestroy") + listKey.push(abilityName +" onAbilityDestroy"); + console.log("listKey is :" + listKey); + }, + onAbilityContinue(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityContinue") + listKey.push(abilityName +" onAbilityContinue"); + console.log("listKey is :" + listKey); + } + } + + var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); + + setTimeout(() => { + globalThis.mainAbility2ListKey = listKey + globalThis.mainAbility2CallBackId = callBackId + console.log("listKey is :" + listKey); + console.log("callBackId is :" + callBackId); + }, 3000) + } + + onDestroy() { + console.log("[Demo] MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility2 onWindowStageCreate") + globalThis.ability3Context = this.context; + windowStage.setUIContent(this.context, "pages/MainAbility2_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility2 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility2 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts new file mode 100644 index 000000000..e8e4263ae --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import commonEvent from '@ohos.commonEvent'; +import Ability from '@ohos.application.Ability' + +export default class MainAbility3 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility3 onCreate") + globalThis.abilityWant = want; + + var getauxMainAbilityContext = { + events: ["auxMainAbilityContext"] + } + + + var a; + function SubscribeCallBackContext(err, data) { + console.log(" Subscribe CallBack data:" + JSON.stringify(data)); + a = data.parameters; + if(data.event != ""){ + for (var key in data.parameters){ + console.log("data.parameters[key] is :" + data.parameters[key]) + } + } + } + + commonEvent.createSubscriber(getauxMainAbilityContext).then(async (data) => { + console.debug("====>Create Subscriber====>"); + var Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBackContext); + }); + + var listKey = []; + var abilityName = ""; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityCreate") + listKey.push(abilityName +" onAbilityCreate"); + console.log("listKey is :" + listKey); + }, + onAbilityWindowStageCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityWindowStageCreate") + listKey.push(abilityName +" onAbilityWindowStageCreate"); + console.log("listKey is :" + listKey); + }, + onAbilityForeground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityForeground") + listKey.push(abilityName +" onAbilityForeground"); + console.log("listKey is :" + listKey); + }, + onAbilityBackground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityBackground") + listKey.push(abilityName +" onAbilityBackground"); + console.log("listKey is :" + listKey); + }, + onAbilityWindowStageDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityWindowStageDestroy") + listKey.push(abilityName +" onAbilityWindowStageDestroy"); + console.log("listKey is :" + listKey); + }, + onAbilityDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityDestroy") + listKey.push(abilityName +" onAbilityDestroy"); + console.log("listKey is :" + listKey); + }, + onAbilityContinue(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName +" onAbilityContinue") + listKey.push(abilityName +" onAbilityContinue"); + console.log("listKey is :" + listKey); + } + } + + setTimeout(() => { + console.log("mainAbility3ListKey a is : " + JSON.stringify(a)) + //TODO: + var callBackId = a.auxMainAbilityContext.getApplicationContext(). + registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("mainAbility3ListKey callBackId is : " + callBackId) + globalThis.mainAbility3ListKey = listKey + console.log("mainAbility3ListKey mainAbility3ListKey is : " + globalThis.mainAbility3ListKey) + globalThis.mainAbility3CallBackId = callBackId + console.log("mainAbility3ListKey listKey is :" + listKey); + console.log("mainAbility3ListKey globalThis.callBackId is :" + globalThis.callBackId); + }, 3000) + + } + + onDestroy() { + console.log("[Demo] MainAbility3 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility3 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/MainAbility3_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility3 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility3 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility3 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts new file mode 100644 index 000000000..d6a2a28cd --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility4 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility4 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility4 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility4 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/MainAbility4_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility4 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility4 onForeground") + + var listKey = []; + var abilityName = ""; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityCreate") + listKey.push(abilityName+" onAbilityCreate"); + }, + onAbilityWindowStageCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityWindowStageCreate") + listKey.push(abilityName+" onAbilityWindowStageCreate"); + }, + onAbilityForeground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityForeground") + listKey.push(abilityName+" onAbilityForeground"); + }, + onAbilityBackground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityBackground") + listKey.push(abilityName+" onAbilityBackground"); + }, + onAbilityWindowStageDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityWindowStageDestroy") + listKey.push(abilityName+" onAbilityWindowStageDestroy"); + }, + onAbilityDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityDestroy") + listKey.push(abilityName+" onAbilityDestroy"); + }, + onAbilityContinue(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityContinue") + listKey.push(abilityName+" onAbilityContinue"); + } + } + var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); + globalThis.abilityContext111 = this.context; + console.log("callBackId is aaa :" + callBackId); + setTimeout(() => { + globalThis.mainAbility4ListKey = listKey + globalThis.mainAbility4CallBackId = callBackId + console.log("listKey is :" + listKey); + console.log("callBackId is :" + callBackId); + }, 3000) + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility4 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts new file mode 100644 index 000000000..a1003a889 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ability from '@ohos.application.Ability' + +export default class MainAbility5 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility5 onCreate") + globalThis.abilityWant = want; + + var listKey = []; + var abilityName = ""; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityCreate") + listKey.push(abilityName+" onAbilityCreate"); + }, + onAbilityWindowStageCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityWindowStageCreate") + listKey.push(abilityName+" onAbilityWindowStageCreate"); + }, + onAbilityForeground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityForeground") + listKey.push(abilityName+" onAbilityForeground"); + }, + onAbilityBackground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityBackground") + listKey.push(abilityName+" onAbilityBackground"); + }, + onAbilityWindowStageDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityWindowStageDestroy") + listKey.push(abilityName+" onAbilityWindowStageDestroy"); + }, + onAbilityDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityDestroy") + listKey.push(abilityName+" onAbilityDestroy"); + }, + onAbilityContinue(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityContinue") + listKey.push(abilityName+" onAbilityContinue"); + } + } + var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("callBackId is aaa :" + callBackId); + + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap2MainAbility6 EventTest terminateSelf data: " + JSON.stringify(data)); + globalThis.mainAbility5ListKey = listKey + globalThis.mainAbility5CallBackId = callBackId + console.log("listKey is :" + listKey); + console.log("callBackId is :" + callBackId); + }).catch((error) => { + console.log("Hap2MainAbility6 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 1000) + } + + onDestroy() { + console.log("[Demo] MainAbility5 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility5 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/MainAbility5_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility5 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility5 onForeground") + + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility5 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts new file mode 100644 index 000000000..885bd3d18 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ability from '@ohos.application.Ability' + +export default class MainAbility6 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility6 onCreate") + globalThis.abilityWant = want; + + var listKey = []; + var abilityName = ""; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityCreate") + listKey.push(abilityName+" onAbilityCreate"); + }, + onAbilityWindowStageCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityWindowStageCreate") + listKey.push(abilityName+" onAbilityWindowStageCreate"); + }, + onAbilityForeground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityForeground") + listKey.push(abilityName+" onAbilityForeground"); + }, + onAbilityBackground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityBackground") + listKey.push(abilityName+" onAbilityBackground"); + }, + onAbilityWindowStageDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityWindowStageDestroy") + listKey.push(abilityName+" onAbilityWindowStageDestroy"); + }, + onAbilityDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityDestroy") + listKey.push(abilityName+" onAbilityDestroy"); + }, + onAbilityContinue(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName+" onAbilityContinue") + listKey.push(abilityName+" onAbilityContinue"); + } + } + var callBackId = this.context.getApplicationContext().registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("callBackId is aaa :" + callBackId); + setTimeout(() => { + globalThis.mainAbility6ListKey = listKey + globalThis.mainAbility6CallBackId = callBackId + console.log("listKey is :" + listKey); + console.log("callBackId is :" + callBackId); + }, 3000) + } + + onDestroy() { + console.log("[Demo] MainAbility6 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility6 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/MainAbility6_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility6 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility6 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility6 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility1_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility1_pages.ets new file mode 100644 index 000000000..cdf7a8254 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility1_pages.ets @@ -0,0 +1,32 @@ +// @ts-nocheck +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct MainAbility1_pages { + @State message: string = 'MainAbility1' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility2_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility2_pages.ets new file mode 100644 index 000000000..5aef19847 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility2_pages.ets @@ -0,0 +1,32 @@ +// @ts-nocheck +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct MainAbility2_pages { + @State message: string = 'MainAbility2' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility3_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility3_pages.ets new file mode 100644 index 000000000..80f93c74b --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility3_pages.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct MainAbility3_pages { + @State message: string = 'MainAbility3_pages' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility4_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility4_pages.ets new file mode 100644 index 000000000..34b2f2c25 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility4_pages.ets @@ -0,0 +1,32 @@ +// @ts-nocheck +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct MainAbility4_pages { + @State message: string = 'MainAbility4' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility5_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility5_pages.ets new file mode 100644 index 000000000..3fa76011f --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility5_pages.ets @@ -0,0 +1,32 @@ +// @ts-nocheck +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct MainAbility5_pages { + @State message: string = 'MainAbility5' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility6_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility6_pages.ets new file mode 100644 index 000000000..e274ffebe --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility6_pages.ets @@ -0,0 +1,32 @@ +// @ts-nocheck +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct MainAbility6_pages { + @State message: string = 'MainAbility6' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility_pages.ets new file mode 100644 index 000000000..50269f6de --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/pages/MainAbility_pages.ets @@ -0,0 +1,57 @@ +// @ts-nocheck +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import file from '@system.file'; +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" +import list from '../test/ListTest' + +@Entry +@Component +struct Index { + @State message: string = 'MainAbility' + + aboutToAppear() { + console.info("start run testcase!!!!") + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + const reportExtend = new ReportExtend(file) + + core.addService('report', reportExtend) + core.init() + globalThis.abilityWant.parameters.timeout = 20000; + + core.subscribeEvent('task', reportExtend) + const configService = core.getDefaultService('config') + configService.setConfig(globalThis.abilityWant.parameters) + console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) + list(globalThis.abilityContext) + core.execute() + } + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets new file mode 100644 index 000000000..1f178fdca --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets @@ -0,0 +1,793 @@ +// @ts-nocheck +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" + +export default function abilityTest(abilityContext){ + + describe('AbilityTest', function() { + + console.info("-----------------LifecycleTest is start----------------") + + var TAG; + var listKeyTemp = []; + var listKeyTemp1 = []; + + + function sleep(time) { + return new Promise((resolve) => setTimeout(resolve, time)) + } + + /* + * @tc.number Multihap_LifecycleTest_001 + * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B + * @tc.desc Function test + * @tc.level 0 + */ + it("Multihap_LifecycleTest_001", 0, async function (done) { + console.info("---------------Multihap_LifecycleTest_001 is start---------------") + TAG = "Multihap_LifecycleTest_001"; + listKeyTemp = []; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4" + }, (error, data) => { + console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility3" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": Hap2MainAbility3 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) { + if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility3") { + listKeyTemp.push(globalThis.mainAbility4ListKey[i]); + } + } + console.log(TAG + "listKeyTemp is :" + listKeyTemp); + console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId); + expect(listKeyTemp[0]).assertEqual("Hap2MainAbility3 onAbilityCreate"); + expect(listKeyTemp[1]).assertEqual("Hap2MainAbility3 onAbilityWindowStageCreate"); + expect(listKeyTemp[2]).assertEqual("Hap2MainAbility3 onAbilityForeground"); + expect(listKeyTemp[3]).assertEqual("Hap2MainAbility3 onAbilityBackground"); + expect(listKeyTemp[4]).assertEqual("Hap2MainAbility3 onAbilityWindowStageDestroy"); + expect(listKeyTemp[5]).assertEqual("Hap2MainAbility3 onAbilityDestroy"); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 4000) + }); + console.info("---------------Multihap_LifecycleTest_001 is end---------------") + }); + + /* + * @tc.number Multihap_LifecycleTest_002 + * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B (single instance) + * @tc.desc Function test + * @tc.level 0 + */ + it("Multihap_LifecycleTest_002", 0, async function (done) { + console.log("------------Multihap_LifecycleTest_002 start-------------"); + TAG = "Multihap_LifecycleTest_002"; + listKeyTemp = []; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4" + }, (error, data) => { + console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility4" + }, (error, data) => { + console.log(TAG + ":first Hap2MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility4" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": second Hap2MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + for(var i = 0; i { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 3000) + }); + console.log("------------Multihap_LifecycleTest_002 end-------------"); + }); + + /* + * @tc.number Multihap_LifecycleTest_003 + * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B (multiple cases) + * @tc.desc Function test + * @tc.level 0 + */ + it("Multihap_LifecycleTest_003", 0, async function (done) { + console.log("------------Multihap_LifecycleTest_003 start-------------"); + TAG = "Multihap_LifecycleTest_003"; + listKeyTemp = []; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4" + }, (error, data) => { + console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility5" + }, (error, data) => { + console.log(TAG + ":first Hap2MainAbility5 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility5" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": second Hap2MainAbility5 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + for(var i = 0;i { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 3000) + }); + console.log("------------Multihap_LifecycleTest_003 end-------------"); + }); + + /* + * @tc.number Multihap_LifecycleTest_004 + * @tc.name The ability of HAP A monitors the ability life cycle callback of HAP B and HAP C + * @tc.desc Function test + * @tc.level 0 + */ + it("Multihap_LifecycleTest_004", 0, async function (done) { + console.log("------------Multihap_LifecycleTest_004 start-------------"); + TAG = "Multihap_LifecycleTest_004"; + listKeyTemp = []; + listKeyTemp1 = []; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4" + }, (error, data) => { + console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility6" + }, (error, data) => { + console.log(TAG + ":first Hap2MainAbility6 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap3MainAbility2" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": second Hap3MainAbility2 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + for(var i = 0;i { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 3000) + }); + console.log("------------Multihap_LifecycleTest_004 end-------------"); + }); + + /* + * @tc.number Multihap_LifecycleTest_005 + * @tc.name The ability of HAP A listens to two ability life cycle callbacks in HAP B + * @tc.desc Function test + * @tc.level 0 + */ + it("Multihap_LifecycleTest_005", 0, async function (done) { + console.log("------------Multihap_LifecycleTest_005 start-------------"); + TAG = "Multihap_LifecycleTest_005"; + listKeyTemp = []; + listKeyTemp1 = []; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4" + }, (error, data) => { + console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility6" + }, (error, data) => { + console.log(TAG + ":first Hap2MainAbility6 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility7" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": second Hap2MainAbility7 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + for(var i = 0;i { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 3000) + }); + console.log("------------end Multihap_LifecycleTest_005-------------"); + }); + + /* + * @tc.number Multihap_LifecycleTest_006 + * @tc.name Repeat the registration. The ability of HAP A listens to the life + cycle callback of the ability of HAP B + * @tc.desc Function test + * @tc.level 0 + */ + it("Multihap_LifecycleTest_006", 0, async function (done) { + console.log("------------Multihap_LifecycleTest_006 start-------------"); + TAG = "Multihap_LifecycleTest_006"; + listKeyTemp = []; + listKeyTemp1 = []; + var firstCallbackId; + var secondCallbackId; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4" + }, (error, data) => { + console.log(TAG + ": first MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility8" + }, (error, data) => { + setTimeout(function(){ + console.log(TAG + ": first Hap2MainAbility8 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log(TAG + "first globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId); + firstCallbackId = globalThis.mainAbility4CallBackId; + console.log(TAG + "firstCallbackId is : " + firstCallbackId); + }, 3000) + }); + + await sleep(1000); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4" + }, (error, data) => { + console.log(TAG + ": second MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility8" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": second Hap2MainAbility8 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + for(var i = 0;i { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 3000) + }); + + console.log("------------Multihap_LifecycleTest_006 end-------------"); + }); + + /* + * @tc.number Multihap_LifecycleTest_007 + * @tc.name Repeat registration and deregistration. The ability of HAP A listens to the life + cycle callback of the ability of HAP B + * @tc.desc Function test + * @tc.level 0 + */ + it("Multihap_LifecycleTest_007", 0, async function (done) { + console.log("------------Multihap_LifecycleTest_007 start-------------"); + TAG = "Multihap_LifecycleTest_007"; + listKeyTemp = []; + listKeyTemp1 = []; + var callBackId1; + var callBackId2; + var flag; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility6" + }, (error, data) => { + console.log(TAG + ": first MainAbility6 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + setTimeout(function(){ + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility9" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ":first Hap2MainAbility9 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + + for(var i = 0;i { + console.log(TAG + ": first unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + flag = error.code; + console.log(TAG + "flag is:" + flag); + }); + }, 3000) + }); + }, 1000) + + + setTimeout(function(){ + if(flag == 0){ + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility6" + }, (error, data) => { + console.log(TAG + ": first MainAbility6 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + setTimeout(function(){ + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility9" + }, (error, data) => { + + setTimeout(() => { + console.log(TAG + ":second Hap2MainAbility9 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + + for(var i = 0;i { + console.log(TAG + ": second unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 3000) + }) + }, 2000) + } + }, 10000) + + console.log("------------Multihap_LifecycleTest_007 end-------------"); + }); + + /* + * @tc.number Multihap_LifecycleTest_008 + * @tc.name Repeat deregistration. The ability of HAP A listens to the life + cycle callback of the ability of HAP B + * @tc.desc Function test + * @tc.level 0 + */ + it("Multihap_LifecycleTest_008", 0, async function (done) { + console.log("------------Multihap_LifecycleTest_008 start-------------"); + TAG = "Multihap_LifecycleTest_008"; + listKeyTemp = []; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4" + }, (error, data) => { + console.log(TAG + ": MainAbility4 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility6" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": Hap2MainAbility6 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + + for(var i = 0;i { + console.log(TAG + ": first unregisterAbilityLifecycleCallback, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue; + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => { + console.log(TAG + ": second unregisterAbilityLifecycleCallback, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue; + done() + }); + }); + }, 4000) + }); + console.log("------------Multihap_LifecycleTest_008 end-------------"); + }); + + /* + * @tc.number Multihap_LifecycleTest_010 + * @tc.name Switch the front and background for many times to monitor the life cycle + * @tc.desc Function test + * @tc.level 0 + */ + it('Multihap_LifecycleTest_010', 0, async function (done) { + console.info("---------------Multihap_LifecycleTest_010 is start---------------") + TAG = "Multihap_LifecycleTest_010"; + listKeyTemp = []; + listKeyTemp1 = []; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility4", + }, (error, data) => { + console.log(TAG + ": MainAbility4 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + }) + + await sleep(1000) + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility10", + }, (error, data) => { + console.log(TAG + ": first Hap2MainAbility10 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + }) + + await sleep(1000) + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap3MainAbility3", + }, (error, data) => { + console.log(TAG + ": first Hap3MainAbility3 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + }) + + await sleep(1000) + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility10", + }, (error, data) => { + console.log(TAG + ": second Hap2MainAbility10 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + }) + + await sleep(1000) + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap3MainAbility3", + }, (error, data) => { + console.log(TAG + ": second Hap3MainAbility3 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + }) + + + await sleep(1000) + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap2MainAbility10", + }, (error, data) => { + console.log(TAG + ": third Hap2MainAbility10 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + }) + + await sleep(1000) + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap3MainAbility3", + }, (error, data) => { + + setTimeout(() => { + console.log(TAG + ": third Hap3MainAbility3 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + + for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) { + if (globalThis.mainAbility4ListKey[i].substring(0, 17) == "Hap2MainAbility10") { + listKeyTemp.push(globalThis.mainAbility4ListKey[i]); + }else if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap3MainAbility3") { + listKeyTemp1.push(globalThis.mainAbility4ListKey[i]); + } + } + console.log(TAG + " listKeyTemp is :" + listKeyTemp); + console.log(TAG + " listKeyTemp1 is :" + listKeyTemp1); + console.log(TAG + " globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId); + + expect(listKeyTemp[0]).assertEqual("Hap2MainAbility10 onAbilityCreate"); + expect(listKeyTemp[1]).assertEqual("Hap2MainAbility10 onAbilityWindowStageCreate"); + expect(listKeyTemp[2]).assertEqual("Hap2MainAbility10 onAbilityForeground"); + expect(listKeyTemp[3]).assertEqual("Hap2MainAbility10 onAbilityBackground"); + expect(listKeyTemp[4]).assertEqual("Hap2MainAbility10 onAbilityForeground"); + expect(listKeyTemp[5]).assertEqual("Hap2MainAbility10 onAbilityBackground"); + expect(listKeyTemp[6]).assertEqual("Hap2MainAbility10 onAbilityForeground"); + expect(listKeyTemp[7]).assertEqual("Hap2MainAbility10 onAbilityBackground"); + + expect(listKeyTemp1[0]).assertEqual("Hap3MainAbility3 onAbilityCreate"); + expect(listKeyTemp1[1]).assertEqual("Hap3MainAbility3 onAbilityWindowStageCreate"); + expect(listKeyTemp1[2]).assertEqual("Hap3MainAbility3 onAbilityForeground"); + expect(listKeyTemp1[3]).assertEqual("Hap3MainAbility3 onAbilityBackground"); + expect(listKeyTemp1[4]).assertEqual("Hap3MainAbility3 onAbilityForeground"); + expect(listKeyTemp1[5]).assertEqual("Hap3MainAbility3 onAbilityBackground"); + expect(listKeyTemp1[6]).assertEqual("Hap3MainAbility3 onAbilityForeground"); + + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 4000) + }) + console.info("---------------Multihap_LifecycleTest_010 is end---------------") + }) + + /* + * @tc.number Multihap_LifecycleTest_011 + * @tc.name The ability of HAP A listens to the life cycle callback + of the ability of HAP B in different processes + * @tc.desc Function test + * @tc.level 0 + */ + it('Multihap_LifecycleTest_011', 0, async function (done) { + console.info("---------------Multihap_LifecycleTest_011 is start---------------") + TAG = "Multihap_LifecycleTest_011"; + listKeyTemp = []; + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "MainAbility2", + }, (error, data) => { + console.log(TAG + ": Hap1MainAbility2 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + }) + + await sleep(500); + + abilityContext.startAbility({ + bundleName: "com.example.lifecycletest", + abilityName: "Hap4MainAbility1", + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": Hap4MainAbility1 startAbility success, err: " + + JSON.stringify(error) + ",data: " + JSON.stringify(data)); + + for (var i = 0; i < globalThis.mainAbility2ListKey.length; i++) { + if (globalThis.mainAbility2ListKey[i].substring(0, 16) == "Hap4MainAbility1") { + listKeyTemp.push(globalThis.mainAbility2ListKey[i]); + } + } + console.log(TAG + " listKeyTemp is :" + listKeyTemp); + console.log(TAG + " globalThis.mainAbility2CallBackId is :" + globalThis.mainAbility2CallBackId); + expect(listKeyTemp.length == 0).assertTrue(); + + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.mainAbility2CallBackId, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + expect(error.code == 0).assertTrue() + done(); + }); + }, 4000) + }); + console.info("---------------Multihap_LifecycleTest_011 is end---------------") + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/ListTest.ets new file mode 100644 index 000000000..5fc84a667 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/ets/test/ListTest.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import lifecycleTest from './LifecycleTest' + +export default function List(context) { + + lifecycleTest(context) + +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/module.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/module.json new file mode 100644 index 000000000..447e6ace6 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/module.json @@ -0,0 +1,99 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.example.lifecycletest.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [{ + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + }] + }, + { + "name": "MainAbility1", + "srcEntrance": "./ets/MainAbility1/MainAbility1.ts", + "description": "$string:MainAbility1_desc", + "icon": "$media:icon", + "label": "$string:MainAbility1_label" + }, + { + "name": "MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:MainAbility2_desc", + "icon": "$media:icon", + "label": "$string:MainAbility2_label" + }, + { + "name": "MainAbility3", + "srcEntrance": "./ets/MainAbility3/MainAbility3.ts", + "description": "$string:MainAbility3_desc", + "icon": "$media:icon", + "label": "$string:MainAbility3_label" + }, + { + "name": "MainAbility4", + "srcEntrance": "./ets/MainAbility4/MainAbility4.ts", + "description": "$string:MainAbility4_desc", + "icon": "$media:icon", + "label": "$string:MainAbility4_label" + }, + { + "name": "MainAbility5", + "srcEntrance": "./ets/MainAbility5/MainAbility5.ts", + "description": "$string:MainAbility5_desc", + "icon": "$media:icon", + "label": "$string:MainAbility5_label" + }, + { + "name": "MainAbility6", + "srcEntrance": "./ets/MainAbility6/MainAbility6.ts", + "description": "$string:MainAbility6_desc", + "icon": "$media:icon", + "label": "$string:MainAbility6_label", + "launchType": "standard" + }], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.MANAGE_MISSIONS" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..3603f45a9 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,84 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsLifecycleMultihapTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "MainAbility1_desc", + "value": "description" + }, + { + "name": "MainAbility1_label", + "value": "label" + }, + { + "name": "MainAbility2_desc", + "value": "description" + }, + { + "name": "MainAbility2_label", + "value": "label" + }, + { + "name": "MainAbility3_desc", + "value": "description" + }, + { + "name": "MainAbility3_label", + "value": "label" + }, + { + "name": "MainAbility4_desc", + "value": "description" + }, + { + "name": "MainAbility4_label", + "value": "label" + }, + { + "name": "MainAbility5_desc", + "value": "description" + }, + { + "name": "MainAbility5_label", + "value": "label" + }, + { + "name": "MainAbility6_desc", + "value": "description" + }, + { + "name": "MainAbility6_label", + "value": "label" + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihaptest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/Hap4MainAbility1/Hap4MainAbility1.ts b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/Hap4MainAbility1/Hap4MainAbility1.ts new file mode 100644 index 000000000..1bd2524dc --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/Hap4MainAbility1/Hap4MainAbility1.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ability from '@ohos.application.Ability' + +export default class Hap4MainAbility1 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap4MainAbility1 onCreate") + globalThis.abilityWant = want; + + setTimeout(()=>{ + this.context.terminateSelf().then((data) => { + console.log("[Demo] Hap4MainAbility1 terminateSelf windowStage data: " + JSON.stringify(data)) + }).catch((error) => { + console.log("[Demo] Hap4MainAbility1 terminateSelf windowStage error: " + JSON.stringify(error)) + }) + }, 2000) + } + + onDestroy() { + console.log("[Demo] Hap4MainAbility1 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap4MainAbility1 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/Hap4MainAbility1_pages", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap4MainAbility1 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap4MainAbility1 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap4MainAbility1 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/pages/Hap4MainAbility1_pages.ets b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/pages/Hap4MainAbility1_pages.ets new file mode 100644 index 000000000..83b9b6186 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/ets/pages/Hap4MainAbility1_pages.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct Index { + @State message: string = 'Hap4MainAbility1' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/module.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/module.json new file mode 100644 index 000000000..3bac8ff18 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/module.json @@ -0,0 +1,57 @@ +{ + "module": { + "name": "hap4", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:hap4_desc", + "mainElement": "Hap4MainAbility1", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "process": "hap4mainability", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.example.lifecycletest.hap4mainability", + "srcEntrance": "./ets/hap4mainability/hap4mainability.ts", + "description": "$string:Hap4MainAbility1_desc", + "icon": "$media:icon", + "label": "$string:Hap4MainAbility1_label", + "visible": true, + "orientation": "portrait", + "skills": [{ + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + }] + }], + "requestPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.MANAGE_MISSIONS" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/element/string.json new file mode 100644 index 000000000..b7a137f35 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/element/string.json @@ -0,0 +1,48 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsLifecycleMultihapTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "hap4_desc", + "value": "description" + }, + { + "name": "Hap4MainAbility1_desc", + "value": "description" + }, + { + "name": "Hap4MainAbility1_label", + "value": "label" + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/media/icon.png b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/media/icon.png rename to ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/stage/actslifecyclemultihaptest/signature/openharmony_sx.p7b b/ability/ability_runtime/stage/actslifecyclemultihaptest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclemultihaptest/signature/openharmony_sx.p7b rename to ability/ability_runtime/stage/actslifecyclemultihaptest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/app.json b/ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/app.json new file mode 100644 index 000000000..8d3530ad8 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.lifecycle_xts", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon": "$media:icon", + "label": "$string:app_name", + "description": "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive": true, + "singleUser": true, + "minAPIVersion": 9, + "targetAPIVersion": 9, + "car": { + "apiCompatibleVersion": 9, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..9f5968071 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string":[ + { + "name":"app_name", + "value":"LifeCycle_XTS" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/resources/base/media/app_icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/stage/actslifecyclesinglehaptest/AppScope/resources/base/media/app_icon.png diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/BUILD.gn b/ability/ability_runtime/stage/actslifecyclesinglehaptest/BUILD.gn new file mode 100644 index 000000000..431d74fb0 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsLifecycleSingleHapTest") { + hap_profile = "entry/src/main/module.json" + deps = [ + ":actslifecyclesinglehaptest_js_assets", + ":actslifecyclesinglehaptest_resources", + ] + ets2abc = true + certificate_profile = "signature/openharmony_sx.p7b" + hap_name = "ActsLifecycleSingleHapTest" +} + +ohos_app_scope("actslifecyclesinglehaptest_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("actslifecyclesinglehaptest_js_assets") { + source_dir = "entry/src/main/ets" +} + +ohos_resources("actslifecyclesinglehaptest_resources") { + sources = [ "entry/src/main/resources" ] + deps = [ ":actslifecyclesinglehaptest_app_profile" ] + hap_profile = "entry/src/main/module.json" +} diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/Test.json b/ability/ability_runtime/stage/actslifecyclesinglehaptest/Test.json new file mode 100644 index 000000000..916b765f7 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "180000", + "package": "com.example.lifecycle_xts", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsLifecycleSingleHapTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Application/AbilityStage.ts similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts new file mode 100644 index 000000000..ded1affab --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap1MainAbility1 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap1MainAbility1 onCreate") + globalThis.abilityWant = want; + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap1MainAbility1 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap1MainAbility1 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 2000) + } + + onDestroy() { + console.log("[Demo] Hap1MainAbility1 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap1MainAbility1 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/indexh1a1", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap1MainAbility1 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap1MainAbility1 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap1MainAbility1 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts new file mode 100644 index 000000000..f8552bfa8 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class Hap1MainAbility2 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] Hap1MainAbility2 onCreate") + globalThis.abilityWant = want; + + setTimeout(() => { + this.context.terminateSelf().then((data) => { + console.log("Hap1MainAbility2 EventTest terminateSelf data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("Hap1MainAbility2 EventTest terminateSelf error: " + JSON.stringify(error)); + }) + }, 2000) + } + + onDestroy() { + console.log("[Demo] Hap1MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] Hap1MainAbility2 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/indexh1a2", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] Hap1MainAbility2 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] Hap1MainAbility2 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] Hap1MainAbility2 onBackground") + } +}; \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..245fde713 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability'; + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context; + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts new file mode 100644 index 000000000..df05232e4 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility1/MainAbility1.ts @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility1 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility1 onCreate") + globalThis.abilityWant = want; + console.log("[Demo] MainAbility1 context: " + JSON.stringify(this.context)); + var listKey1 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback1 onAbilityCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback1 onAbilityCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey1.push(abilityname + " onAbilityCreate"); + console.log("[Demo] 1listKey1:" + JSON.stringify(listKey1)); + }, + onAbilityWindowStageCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback1 onAbilityWindowStageCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback1 onAbilityWindowStageCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey1.push(abilityname + " onAbilityWindowStageCreate"); + console.log("[Demo] 2listKey1:" + JSON.stringify(listKey1)); + }, + onAbilityWindowStageDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback1 onAbilityWindowStageDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback1 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey1.push(abilityname + " onAbilityWindowStageDestroy"); + console.log("[Demo] 3listKey1:" + JSON.stringify(listKey1)); + }, + onAbilityDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback1 onAbilityDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback1 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey1.push(abilityname + " onAbilityDestroy"); + console.log("[Demo] 4listKey1:" + JSON.stringify(listKey1)); + }, + onAbilityForeground(ability) { + console.log("[Demo] AbilityLifecycleCallback1 onAbilityForeground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback1 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey1.push(abilityname + " onAbilityForeground"); + console.log("[Demo] 5listKey1:" + JSON.stringify(listKey1)); + }, + onAbilityBackground(ability) { + console.log("[Demo] AbilityLifecycleCallback1 onAbilityBackground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback1 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey1.push(abilityname + " onAbilityBackground"); + console.log("[Demo] 6listKey1:" + JSON.stringify(listKey1)); + }, + onAbilityContinue(ability) { + console.log("[Demo] AbilityLifecycleCallback1 onAbilityContinue ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback1 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey1.push(abilityname + " onAbilityContinue"); + console.log("[Demo] 7listKey1:" + JSON.stringify(listKey1)); + } + } + let applicationContext = this.context.getApplicationContext(); + console.log("[Demo] MainAbility1 applicationContext: " + JSON.stringify(applicationContext)); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] registerAbilityLifecycleCallback1 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] registerAbilityLifecycleCallback1 listKey: " + JSON.stringify(listKey1)); + globalThis.list1 = listKey1; + globalThis.callbackid1 = lifecycleid; + }, 2500); + } + + onDestroy() { + console.log("[Demo] MainAbility1 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility1 onWindowStageCreate") + globalThis.ability1context = this.context; + windowStage.setUIContent(this.context, "pages/index1", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility1 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility1 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility1 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility10/MainAbility10.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility10/MainAbility10.ts new file mode 100644 index 000000000..c134f1ebb --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility10/MainAbility10.ts @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility10 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility10 onCreate") + globalThis.abilityWant = want; + var listKey10 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback10 onAbilityCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey10.push(abilityname + " onAbilityCreate"); + console.log("[Demo] 1listKey10:" + JSON.stringify(listKey10)); + }, + onAbilityWindowStageCreate(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback10 onAbilityWindowStageCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey10.push(abilityname + " onAbilityWindowStageCreate"); + console.log("[Demo] 2listKey10:" + JSON.stringify(listKey10)); + }, + onAbilityWindowStageDestroy(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback10 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey10.push(abilityname + " onAbilityWindowStageDestroy"); + console.log("[Demo] 3listKey10:" + JSON.stringify(listKey10)); + }, + onAbilityDestroy(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback10 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey10.push(abilityname + " onAbilityDestroy"); + console.log("[Demo] 4listKey10:" + JSON.stringify(listKey10)); + }, + onAbilityForeground(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback10 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey10.push(abilityname + " onAbilityForeground"); + console.log("[Demo] 5listKey10:" + JSON.stringify(listKey10)); + }, + onAbilityBackground(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback10 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey10.push(abilityname + " onAbilityBackground"); + console.log("[Demo] 6listKey10:" + JSON.stringify(listKey10)); + }, + onAbilityContinue(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback10 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey10.push(abilityname + " onAbilityContinue"); + console.log("[Demo] 7listKey10:" + JSON.stringify(listKey10)); + } + } + let applicationContext = this.context.getApplicationContext(); + console.log("[Demo] MainAbility10 applicationContext: " + JSON.stringify(applicationContext)); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] registerAbilityLifecycleCallback10 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] registerAbilityLifecycleCallback10 listKey: " + JSON.stringify(listKey10)); + globalThis.list10 = listKey10; + globalThis.callbackid10 = lifecycleid; + }, 1500); + } + + onDestroy() { + console.log("[Demo] MainAbility10 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility10 onWindowStageCreate") + globalThis.ability10 = this.context; + windowStage.setUIContent(this.context, "pages/index10", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility10 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility10 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility10 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility11/MainAbility11.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility11/MainAbility11.ts new file mode 100644 index 000000000..cb1e56d50 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility11/MainAbility11.ts @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility11 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility11 onCreate") + globalThis.abilityWant = want; + globalThis.ability11 = this.context; + var listKey11 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback11 onAbilityCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey11.push(abilityname + " onAbilityCreate"); + }, + onAbilityWindowStageCreate(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback11 onAbilityWindowStageCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey11.push(abilityname + " onAbilityWindowStageCreate"); + }, + onAbilityWindowStageDestroy(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback11 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey11.push(abilityname + " onAbilityWindowStageDestroy"); + }, + onAbilityDestroy(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback11 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey11.push(abilityname + " onAbilityDestroy"); + }, + onAbilityForeground(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback11 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey11.push(abilityname + " onAbilityForeground"); + }, + onAbilityBackground(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback11 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey11.push(abilityname + " onAbilityBackground"); + }, + onAbilityContinue(ability) { + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback11 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey11.push(abilityname + " onAbilityContinue"); + } + } + let applicationContext = globalThis.ability11.getApplicationContext(); + console.log("[Demo] MainAbility11 applicationContext: " + JSON.stringify(applicationContext)); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] registerAbilityLifecycleCallback11 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] registerAbilityLifecycleCallback11 listKey: " + JSON.stringify(listKey11)); + globalThis.list11 = listKey11; + globalThis.callbackid11 = lifecycleid; + }, 2000); + } + + onDestroy() { + console.log("[Demo] MainAbility11 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility11 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/index11", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility11 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility11 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility12/MainAbility12.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility12/MainAbility12.ts new file mode 100644 index 000000000..19f577b7f --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility12/MainAbility12.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility12 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility12 onCreate") + globalThis.abilityWant = want; + var listKey12 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback12 onAbilityCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey12.push(abilityname + " onAbilityCreate"); + }, + onAbilityWindowStageCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback12 onAbilityWindowStageCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey12.push(abilityname + " onAbilityWindowStageCreate"); + }, + onAbilityWindowStageDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback12 onAbilityWindowStageDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey12.push(abilityname + " onAbilityWindowStageDestroy"); + }, + onAbilityDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback12 onAbilityDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey12.push(abilityname + " onAbilityDestroy"); + }, + onAbilityForeground(ability) { + console.log("[Demo] AbilityLifecycleCallback12 onAbilityForeground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey12.push(abilityname + " onAbilityForeground"); + }, + onAbilityBackground(ability) { + console.log("[Demo] AbilityLifecycleCallback12 onAbilityBackground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey12.push(abilityname + " onAbilityBackground"); + }, + onAbilityContinue(ability) { + console.log("[Demo] AbilityLifecycleCallback12 onAbilityContinue ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey12.push(abilityname + " onAbilityContinue"); + } + } + let applicationContext = this.context.getApplicationContext(); + console.log("[Demo] MainAbility12 applicationContext: " + JSON.stringify(applicationContext)); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] registerAbilityLifecycleCallback12 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] registerAbilityLifecycleCallback12 listKey: " + JSON.stringify(listKey12)); + globalThis.list12 = listKey12; + globalThis.callbackid12 = lifecycleid; + }, 1700); + } + + onDestroy() { + console.log("[Demo] MainAbility12 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility12 onWindowStageCreate") + globalThis.ability12 = this.context; + windowStage.setUIContent(this.context, "pages/index12", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility12 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility12 onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility12 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts new file mode 100644 index 000000000..bd6a71c86 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility2/MainAbility2.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility2 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility2 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility2 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility2 onWindowStageCreate") + globalThis.ability2 = this.context; + windowStage.setUIContent(this.context, "pages/index2", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility2 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility2 onForeground") + setTimeout(function () { + globalThis.ability2.terminateSelf() + .then((data) => { + console.info('[Demo] MainAbility2 terminateself succeeded: ' + data); + }).catch((error) => { + console.error('[Demo] MainAbility2 terminateself failed. Cause: ' + error); + }) + }, 500); + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility2 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts new file mode 100644 index 000000000..9ba38e1e4 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility3/MainAbility3.ts @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility3 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility3 onCreate") + globalThis.abilityWant = want; + + console.log("[Demo] MainAbility3 context: " + JSON.stringify(this.context)); + var listKey3 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback3 onAbilityCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback3 onAbilityCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey3.push(abilityname + " onAbilityCreate"); + console.log("[Demo] 1listKey3:" + JSON.stringify(listKey3)); + }, + onAbilityWindowStageCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback3 onAbilityWindowStageCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback3 onAbilityWindowStageCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey3.push(abilityname + " onAbilityWindowStageCreate"); + console.log("[Demo] 2listKey3:" + JSON.stringify(listKey3)); + }, + onAbilityWindowStageDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback3 onAbilityWindowStageDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback3 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey3.push(abilityname + " onAbilityWindowStageDestroy"); + console.log("[Demo] 3listKey3:" + JSON.stringify(listKey3)); + }, + onAbilityDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback3 onAbilityDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback3 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey3.push(abilityname + " onAbilityDestroy"); + console.log("[Demo] 4listKey3:" + JSON.stringify(listKey3)); + }, + onAbilityForeground(ability) { + console.log("[Demo] AbilityLifecycleCallback3 onAbilityForeground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback3 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey3.push(abilityname + " onAbilityForeground"); + console.log("[Demo] 5listKey3:" + JSON.stringify(listKey3)); + }, + onAbilityBackground(ability) { + console.log("[Demo] AbilityLifecycleCallback3 onAbilityBackground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback3 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey3.push(abilityname + " onAbilityBackground"); + console.log("[Demo] 6listKey3:" + JSON.stringify(listKey3)); + }, + onAbilityContinue(ability) { + console.log("[Demo] AbilityLifecycleCallback3 onAbilityContinue ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback3 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey3.push(abilityname + " onAbilityContinue"); + console.log("[Demo] 7listKey3:" + JSON.stringify(listKey3)); + } + } + let applicationContext = this.context.getApplicationContext(); + console.log("[Demo] MainAbility3 applicationContext: " + JSON.stringify(applicationContext)); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] registerAbilityLifecycleCallback3 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] registerAbilityLifecycleCallback3 listKey : " + JSON.stringify(listKey3)); + globalThis.list3 = listKey3; + globalThis.callbackid3 = lifecycleid; + }, 2000); + } + + onDestroy() { + console.log("[Demo] MainAbility3 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility3 onWindowStageCreate") + globalThis.ability3 = this.context + windowStage.setUIContent(this.context, "pages/index3", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility3 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts new file mode 100644 index 000000000..74bfcc2d7 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility4/MainAbility4.ts @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility4 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility4 onCreate") + globalThis.abilityWant = want; + + console.log("[Demo] MainAbility4 context: " + JSON.stringify(this.context)); + var listKey4 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback4 onAbilityCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback4 onAbilityCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey4.push(abilityname + " onAbilityCreate"); + console.log("[Demo] 1listKey4:" + JSON.stringify(listKey4)); + }, + onAbilityWindowStageCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback4 onAbilityWindowStageCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback4 onAbilityWindowStageCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey4.push(abilityname + " onAbilityWindowStageCreate"); + console.log("[Demo] 2listKey4:" + JSON.stringify(listKey4)); + }, + onAbilityWindowStageDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback4 onAbilityWindowStageDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback4 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey4.push(abilityname + " onAbilityWindowStageDestroy"); + console.log("[Demo] 3listKey4:" + JSON.stringify(listKey4)); + }, + onAbilityDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback4 onAbilityDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback4 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey4.push(abilityname + " onAbilityDestroy"); + console.log("[Demo] 4listKey4:" + JSON.stringify(listKey4)); + }, + onAbilityForeground(ability) { + console.log("[Demo] AbilityLifecycleCallback4 onAbilityForeground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback4 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey4.push(abilityname + " onAbilityForeground"); + console.log("[Demo] 5listKey4:" + JSON.stringify(listKey4)); + }, + onAbilityBackground(ability) { + console.log("[Demo] AbilityLifecycleCallback4 onAbilityBackground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback4 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey4.push(abilityname + " onAbilityBackground"); + console.log("[Demo] 6listKey4:" + JSON.stringify(listKey4)); + }, + onAbilityContinue(ability) { + console.log("[Demo] AbilityLifecycleCallback4 onAbilityContinue ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback4 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey4.push(abilityname + " onAbilityContinue"); + console.log("[Demo] 7listKey4:" + JSON.stringify(listKey4)); + } + } + let applicationContext = this.context.getApplicationContext(); + console.log("[Demo] MainAbility4 applicationContext: " + JSON.stringify(applicationContext)); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] registerAbilityLifecycleCallback4 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] registerAbilityLifecycleCallback4 listKey : " + JSON.stringify(listKey4)); + globalThis.list4 = listKey4; + globalThis.callbackid4 = lifecycleid; + }, 1500); + } + + onDestroy() { + console.log("[Demo] MainAbility4 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility4 onWindowStageCreate") + globalThis.ability4 = this.context; + windowStage.setUIContent(this.context, "pages/index4", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility4 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility4 onForeground") + setTimeout(function () { + globalThis.ability4.terminateSelf() + .then((data) => { + console.info('[Demo] MainAbility4 terminateself succeeded: ' + data); + }).catch((error) => { + console.error('[Demo] MainAbility4 terminateself failed. Cause: ' + error); + }) + }, 5000); + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility4 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts new file mode 100644 index 000000000..a37e29a18 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility5/MainAbility5.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility5 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility5 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility5 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility5 onWindowStageCreate") + globalThis.ability5 = this.context; + windowStage.setUIContent(this.context, "pages/index5", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility5 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility5 onForeground") + setTimeout(function () { + globalThis.ability5.terminateSelf() + .then((data) => { + console.info('[Demo] MainAbility5 terminateself succeeded: ' + data); + }).catch((error) => { + console.error('[Demo] MainAbility5 terminateself failed. Cause: ' + error); + }) + }, 500); + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility5 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts new file mode 100644 index 000000000..1a5ba0d6b --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility6/MainAbility6.ts @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility6 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility6 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility6 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility6 onWindowStageCreate") + globalThis.ability6 = this.context; + windowStage.setUIContent(this.context, "pages/index6", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility6 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility6 onForeground") + + var listKey6 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback6 onAbilityCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback6 onAbilityCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey6.push(abilityname + " onAbilityCreate"); + console.log("[Demo] 1listKey6:" + JSON.stringify(listKey6)); + }, + onAbilityWindowStageCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback6 onAbilityWindowStageCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback6 onAbilityWindowStageCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey6.push(abilityname + " onAbilityWindowStageCreate"); + console.log("[Demo] 2listKey6:" + JSON.stringify(listKey6)); + }, + onAbilityWindowStageDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback6 onAbilityWindowStageDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback6 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey6.push(abilityname + " onAbilityWindowStageDestroy"); + console.log("[Demo] 3listKey6:" + JSON.stringify(listKey6)); + }, + onAbilityDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback6 onAbilityDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback6 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey6.push(abilityname + " onAbilityDestroy"); + console.log("[Demo] 4listKey6:" + JSON.stringify(listKey6)); + }, + onAbilityForeground(ability) { + console.log("[Demo] AbilityLifecycleCallback6 onAbilityForeground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback6 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey6.push(abilityname + " onAbilityForeground"); + console.log("[Demo] 5listKey6:" + JSON.stringify(listKey6)); + }, + onAbilityBackground(ability) { + console.log("[Demo] AbilityLifecycleCallback6 onAbilityBackground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback6 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey6.push(abilityname + " onAbilityBackground"); + console.log("[Demo] 6listKey6:" + JSON.stringify(listKey6)); + }, + onAbilityContinue(ability) { + console.log("[Demo] AbilityLifecycleCallback6 onAbilityContinue ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback6 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey6.push(abilityname + " onAbilityContinue"); + console.log("[Demo] 7listKey6:" + JSON.stringify(listKey6)); + } + } + let applicationContext = globalThis.ability6.getApplicationContext(); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] registerAbilityLifecycleCallback6 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] registerAbilityLifecycleCallback6 listKey: " + JSON.stringify(listKey6)); + globalThis.list6 = listKey6; + globalThis.callbackid6 = lifecycleid; + }, 1500); + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility6 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility7/MainAbility7.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility7/MainAbility7.ts new file mode 100644 index 000000000..863ef25ad --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility7/MainAbility7.ts @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility7 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility7 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility7 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility7 onWindowStageCreate") + globalThis.ability7 = this.context; + windowStage.setUIContent(this.context, "pages/index7", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility7 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility7 onForeground") + + var listKey7 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback7 onAbilityCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback7 onAbilityCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey7.push(abilityname + " onAbilityCreate"); + console.log("[Demo] 1listKey7:" + JSON.stringify(listKey7)); + }, + onAbilityWindowStageCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback7 onAbilityWindowStageCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback7 onAbilityWindowStageCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey7.push(abilityname + " onAbilityWindowStageCreate"); + console.log("[Demo] 2listKey7:" + JSON.stringify(listKey7)); + }, + onAbilityWindowStageDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback7 onAbilityWindowStageDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback7 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey7.push(abilityname + " onAbilityWindowStageDestroy"); + console.log("[Demo] 3listKey7:" + JSON.stringify(listKey7)); + }, + onAbilityDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback7 onAbilityDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback7 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey7.push(abilityname + " onAbilityDestroy"); + console.log("[Demo] 4listKey7:" + JSON.stringify(listKey7)); + }, + onAbilityForeground(ability) { + console.log("[Demo] AbilityLifecycleCallback7 onAbilityForeground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback7 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey7.push(abilityname + " onAbilityForeground"); + console.log("[Demo] 5listKey7:" + JSON.stringify(listKey7)); + }, + onAbilityBackground(ability) { + console.log("[Demo] AbilityLifecycleCallback7 onAbilityBackground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback7 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey7.push(abilityname + " onAbilityBackground"); + console.log("[Demo] 6listKey7:" + JSON.stringify(listKey7)); + }, + onAbilityContinue(ability) { + console.log("[Demo] AbilityLifecycleCallback7 onAbilityContinue ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback7 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey7.push(abilityname + " onAbilityContinue"); + console.log("[Demo] 7listKey7:" + JSON.stringify(listKey7)); + } + } + let applicationContext = this.context.getApplicationContext(); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] AbilityLifecycleCallback7 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] AbilityLifecycleCallback7 listKey: " + JSON.stringify(listKey7)); + globalThis.list7 = listKey7; + globalThis.callbackid7 = lifecycleid; + }, 1500); + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility7 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility8/MainAbility8.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility8/MainAbility8.ts new file mode 100644 index 000000000..31a6b4019 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility8/MainAbility8.ts @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility8 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility8 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility8 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility8 onWindowStageCreate") + globalThis.ability8 = this.context; + windowStage.setUIContent(this.context, "pages/index8", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility8 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility8 onForeground") + var listKey8 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback8 onAbilityCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback8 onAbilityCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityCreate"); + listKey8.push(abilityname + " onAbilityCreate"); + console.log("[Demo] 1listKey8:" + JSON.stringify(listKey8)); + }, + onAbilityWindowStageCreate(ability) { + console.log("[Demo] AbilityLifecycleCallback8 onAbilityWindowStageCreate ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback8 onAbilityWindowStageCreate abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageCreate"); + listKey8.push(abilityname + " onAbilityWindowStageCreate"); + console.log("[Demo] 2listKey8:" + JSON.stringify(listKey8)); + }, + onAbilityWindowStageDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback8 onAbilityWindowStageDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback8 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityWindowStageDestroy"); + listKey8.push(abilityname + " onAbilityWindowStageDestroy"); + console.log("[Demo] 3listKey8:" + JSON.stringify(listKey8)); + }, + onAbilityDestroy(ability) { + console.log("[Demo] AbilityLifecycleCallback8 onAbilityDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback8 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityDestroy"); + listKey8.push(abilityname + " onAbilityDestroy"); + console.log("[Demo] 4listKey8:" + JSON.stringify(listKey8)); + }, + onAbilityForeground(ability) { + console.log("[Demo] AbilityLifecycleCallback8 onAbilityForeground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback8 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityForeground"); + listKey8.push(abilityname + " onAbilityForeground"); + console.log("[Demo] 5listKey8:" + JSON.stringify(listKey8)); + }, + onAbilityBackground(ability) { + console.log("[Demo] AbilityLifecycleCallback8 onAbilityBackground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback8 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityBackground"); + listKey8.push(abilityname + " onAbilityBackground"); + console.log("[Demo] 6listKey8:" + JSON.stringify(listKey8)); + }, + onAbilityContinue(ability) { + console.log("[Demo] AbilityLifecycleCallback8 onAbilityContinue ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log("[Demo] AbilityLifecycleCallback8 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log("[Demo] " + abilityname + " onAbilityContinue"); + listKey8.push(abilityname + " onAbilityContinue"); + console.log("[Demo] 7listKey8:" + JSON.stringify(listKey8)); + } + } + let applicationContext = this.context.getApplicationContext(); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("[Demo] AbilityLifecycleCallback8 number: " + JSON.stringify(lifecycleid)); + setTimeout(function () { + console.log("[Demo] AbilityLifecycleCallback8 listKey: " + JSON.stringify(listKey8)); + globalThis.list8 = listKey8; + globalThis.callbackid8 = lifecycleid; + }, 1500); + + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility8 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility9/MainAbility9.ts b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility9/MainAbility9.ts new file mode 100644 index 000000000..0056e6dd6 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/MainAbility9/MainAbility9.ts @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility9 extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility9 onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility9 onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility9 onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/index9", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility9 onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility9 onForeground") + + var listKey9 = []; + var abilityName = ""; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName + " onAbilityCreate") + listKey9.push(abilityName + " onAbilityCreate"); + }, + onAbilityWindowStageCreate(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName + " onAbilityWindowStageCreate") + listKey9.push(abilityName + " onAbilityWindowStageCreate"); + }, + onAbilityForeground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName + " onAbilityForeground") + listKey9.push(abilityName + " onAbilityForeground"); + }, + onAbilityBackground(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName + " onAbilityBackground") + listKey9.push(abilityName + " onAbilityBackground"); + }, + onAbilityWindowStageDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName + " onAbilityWindowStageDestroy") + listKey9.push(abilityName + " onAbilityWindowStageDestroy"); + }, + onAbilityDestroy(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName + " onAbilityDestroy") + listKey9.push(abilityName + " onAbilityDestroy"); + }, + onAbilityContinue(ability) { + abilityName = ability.context.abilityInfo.name; + console.log(abilityName + " onAbilityContinue") + listKey9.push(abilityName + " onAbilityContinue"); + } + } + var callBackId = this.context.getApplicationContext() + .registerAbilityLifecycleCallback(AbilityLifecycleCallback); + + console.log("callBackId is aaa :" + callBackId); + setTimeout(() => { + globalThis.mainAbility9ListKey = listKey9 + globalThis.mainAbility9CallBackId = callBackId + console.log("listKey is :" + listKey9); + console.log("callBackId is :" + callBackId); + }, 3000) + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility9 onBackground") + } +}; diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index.ets new file mode 100644 index 000000000..e279086a0 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index.ets @@ -0,0 +1,55 @@ +// @ts-nocheck +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import file from '@system.file'; +import { Core, ExpectExtend, InstrumentLog, ReportExtend } from "deccjsunit/index" +import List from '../test/ListTest' + +@Entry +@Component +struct Index { + aboutToAppear() { + console.info("start run testcase!!!!") + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + core.addService('expect', expectExtend) + const reportExtend = new ReportExtend(file) + core.addService('report', reportExtend) + core.init() + globalThis.abilityWant.parameters.timeout = 10000; + core.subscribeEvent('task', reportExtend) + const configService = core.getDefaultService('config') + configService.setConfig(globalThis.abilityWant.parameters); + List(globalThis.abilityContext) + core.execute() + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index1.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index1.ets new file mode 100644 index 000000000..5f0560de7 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index1.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index1 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability1') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index10.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index10.ets new file mode 100644 index 000000000..faf118b32 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index10.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index10 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability10') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index11.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index11.ets new file mode 100644 index 000000000..fbcf1d266 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index11.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index11 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability11') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index12.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index12.ets new file mode 100644 index 000000000..054b13b6e --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index12.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index12 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability12') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index2.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index2.ets new file mode 100644 index 000000000..3454fec43 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index2.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index2 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability2') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index3.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index3.ets new file mode 100644 index 000000000..1da36da3d --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index3.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index3 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability3') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index4.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index4.ets new file mode 100644 index 000000000..93ff08b65 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index4.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index4 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability4') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index5.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index5.ets new file mode 100644 index 000000000..3c3c29044 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index5.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index5 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability5') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index6.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index6.ets new file mode 100644 index 000000000..a8c2b4e15 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index6.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index6 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability6') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index7.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index7.ets new file mode 100644 index 000000000..2acfc9b16 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index7.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index7 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability7') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index8.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index8.ets new file mode 100644 index 000000000..40ebaa205 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index8.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index8 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability8') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index9.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index9.ets new file mode 100644 index 000000000..7aeb88994 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/index9.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct Index9 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Mainability9') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a1.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a1.ets new file mode 100644 index 000000000..4a5bc62f9 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a1.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct indexh1a1 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Hap1MainAbility1') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a2.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a2.ets new file mode 100644 index 000000000..8e82f9dfd --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/pages/indexh1a2.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct indexh1a2 { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World Hap1MainAbility2') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets new file mode 100644 index 000000000..b709cc955 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets @@ -0,0 +1,1593 @@ +// @ts-nocheck +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" + +export default function lifecycleTest(abilityContext) { + describe('LifeCycleTest', function () { + + beforeEach(async function (done) { + console.info('LifeCycleTest before each called'); + await sleep(1000); + done() + }); + + afterEach(async function (done) { + console.info('LifeCycleTest after each called'); + if ("Singlehap_LifeCycleTest_0200" === TAG || "Singlehap_LifeCycleTest_0300" === TAG + || "Singlehap_LifeCycleTest_0500" === TAG || "Singlehap_LifeCycleTest_0600" === TAG + || "Singlehap_LifeCycleTest_0800" === TAG || "Singlehap_LifeCycleTest_0900" === TAG) { + var para = { + resultCode: 2, + want: { + "abilityName": "MainAbility1", + "bundleName": "com.example.lifecycle_xts" + } + } + console.log("LifeCycleTest terminateSelfwithresult para: " + JSON.stringify(para)); + await globalThis.ability1context.terminateSelfWithResult(para) + .then((data) => { + console.log("LifeCycleTest terminateSelfwithresult successful data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("LifeCycleTest terminateSelfwithresult error: " + JSON.stringify(error)); + }); + } else if ("Singlehap_LifeCycleTest_2000" === TAG) { + var para1 = { + resultCode: 2, + want: { + "abilityName": "MainAbility12", + "bundleName": "com.example.lifecycle_xts" + } + } + console.log("LifeCycleTest terminateSelfwithresult para: " + JSON.stringify(para1)); + await globalThis.ability12.terminateSelfWithResult(para1) + .then((data) => { + console.log("LifeCycleTest terminateSelfwithresult successful data: " + JSON.stringify(data)); + }).catch((error) => { + console.log("LifeCycleTest terminateSelfwithresult error: " + JSON.stringify(error)); + }); + } + done(); + }); + + var TAG = ""; + var listKeyTemp = "" + function sleep(time) { + return new Promise((resolve) => setTimeout(resolve, time)) + } + /* + * @tc.number Singlehap_LifeCycleTest_0100 + * @tc.name Register in abilitystage,listen to the lifecycle of abilityA,deregister after listening + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0100", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0100 START-------------"); + TAG = "Singlehap_LifeCycleTest_0100"; + var code; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list)); + console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list.length; i++) { + strtemp = globalThis.list[i].substring(0, 12); + if (strtemp === "MainAbility2") { + listtemp.push(globalThis.list[i]); + } + } + console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); + let exlist = listtemp; + globalThis.abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code = error.code; + }); + setTimeout(function () { + expect(exlist[0]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[1]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(code).assertEqual(0); + console.log("------------Singlehap_LifeCycleTest_0100 END-------------"); + done(); + }, 1000); + }, 3000); + }) + + /* + * @tc.number Singlehap_LifeCycleTest_0200 + * @tc.name Register in abilityA,listen to the lifecycle of abilityB,deregister after listening + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0200", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0200 START-------------"); + TAG = "Singlehap_LifeCycleTest_0200"; + var code; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility1", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); + var list = globalThis.list1 + console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list1.length; i++) { + strtemp = globalThis.list1[i].substring(0, 12); + if (strtemp === "MainAbility1" || strtemp === "MainAbility2") { + listtemp.push(globalThis.list1[i]); + } + } + console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); + let exlist = listtemp; + globalThis.ability1context.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code = error.code; + }) + setTimeout(function () { + expect(exlist[0]).assertEqual("MainAbility1 onAbilityWindowStageCreate"); + expect(exlist[1]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[5]).assertEqual("MainAbility1 onAbilityBackground"); + expect(exlist[6]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(code).assertEqual(0); + console.log("------------Singlehap_LifeCycleTest_0200 END-------------"); + done(); + }, 1000); + }, 3000); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_0300 + * @tc.name Register in abilityA,listening the lifecycle of abilityB,deregister,repeat the unregister + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0300", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0300 START-------------"); + TAG = "Singlehap_LifeCycleTest_0300"; + var code; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility1", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); + console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list1.length; i++) { + strtemp = globalThis.list1[i].substring(0, 12); + if (strtemp === "MainAbility1" || strtemp === "MainAbility2") { + listtemp.push(globalThis.list1[i]); + } + } + console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); + let exlist = listtemp; + globalThis.ability1context.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid1) + .then((data) => { + console.info(TAG + ' unregisterAbilityLifecycleCallback successful. Data: ' + data); + }) + .catch((error) => { + console.error(TAG + ' unregisterAbilityLifecycleCallback failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + console.log(TAG + " secondunregister callbackid : " + JSON.stringify(globalThis.callbackid1)); + globalThis.ability1context.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback_1 success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code = error.code; + }) + }, 500); + setTimeout(function () { + expect(exlist[0]).assertEqual("MainAbility1 onAbilityWindowStageCreate"); + expect(exlist[1]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[5]).assertEqual("MainAbility1 onAbilityBackground"); + expect(exlist[6]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(code).assertEqual(1); + console.log("------------Singlehap_LifeCycleTest_0300 END-------------"); + done(); + }, 2000); + }, 3000); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_0400 + * @tc.name Register in abilityA,listening the lifecycle of abilityB,terminate abilityA,unregister + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0400", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0400 START-------------"); + TAG = "Singlehap_LifeCycleTest_0400"; + var code; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility3", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start3 successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start3 failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start2 successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start2 failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list3)); + console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid3)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list3.length; i++) { + strtemp = globalThis.list3[i].substring(0, 12); + if (strtemp === "MainAbility3" || strtemp === "MainAbility2") { + listtemp.push(globalThis.list3[i]); + } + } + console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); + let exlist = listtemp; + var para = { + resultCode: 1, + want: { + "abilityName": "MainAbility3", + "bundleName": "com.example.lifecycle_xts" + } + } + console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); + globalThis.ability3.terminateSelfWithResult(para) + .then((data) => { + console.log(TAG + " terminateSelfwithresult successful data: " + JSON.stringify(data)); + }).catch((error) => { + console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); + }); + setTimeout(function () { + globalThis.ability1context.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid3, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback3 success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code = error.code; + }) + }, 500); + setTimeout(function () { + expect(exlist[0]).assertEqual("MainAbility3 onAbilityWindowStageCreate"); + expect(exlist[1]).assertEqual("MainAbility3 onAbilityForeground"); + expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[5]).assertEqual("MainAbility3 onAbilityBackground"); + expect(exlist[6]).assertEqual("MainAbility3 onAbilityForeground"); + expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(code).assertEqual(0); + console.log("------------Singlehap_LifeCycleTest_0400 END-------------"); + done(); + }, 1000); + }, 3000); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_0500 + * @tc.name Register in abilityA and abilityB,unregister MainabilityB,then Register in ManinabilityC + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0500", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0500 START-------------"); + TAG = "Singlehap_LifeCycleTest_0500"; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility1", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start1 successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility3", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start3 successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start3 failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + console.log(TAG + " start after callbackid3 : " + JSON.stringify(globalThis.callbackid3)); + globalThis.abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid3) + .then((data) => { + console.info(TAG + ' unregisterAbilityLifecycleCallback3 successful. Data: ' + data); + }) + .catch((error) => { + console.error(TAG + ' unregisterAbilityLifecycleCallback3 failed. Cause: ' + JSON.stringify(error)); + }); + var str2 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility4", + } + globalThis.abilityContext.startAbility(str2) + .then((data) => { + console.info(TAG + ' start4 successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start4 failed. Cause: ' + JSON.stringify(error)); + }) + }, 2800); + setTimeout(function () { + console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1)); + console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1)); + console.log(TAG + " listKey3 : " + JSON.stringify(globalThis.list3)); + console.log(TAG + " callbackid3 : " + JSON.stringify(globalThis.callbackid3)); + let id3 = globalThis.callbackid3; + console.log(TAG + " listKey4 : " + JSON.stringify(globalThis.list4)); + console.log(TAG + " callbackid4 : " + JSON.stringify(globalThis.callbackid4)); + let id4 = globalThis.callbackid4; + expect(id3 + 1).assertEqual(id4); + globalThis.ability1context.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid4, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback4 success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }) + globalThis.ability1context.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback1 success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_0500 END-------------"); + done(); + }) + }, 4500); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_0600 + * @tc.name Register in abilityA,start abilityB、abilityC,terminate abilityB 、abilityC + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0600", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0600 START-------------"); + TAG = "Singlehap_LifeCycleTest_0600"; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility1", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start1 successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start1 failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility5", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start5 successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start5 failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + var str2 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str2) + .then((data) => { + console.info(TAG + ' start2 successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start2 failed. Cause: ' + JSON.stringify(error)); + }) + }, 1100); + setTimeout(function () { + console.log(TAG + " listKey1 : " + JSON.stringify(globalThis.list1)); + console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list1.length; i++) { + strtemp = globalThis.list1[i].substring(0, 12); + if (strtemp == "MainAbility5" || strtemp == "MainAbility2") { + listtemp.push(globalThis.list1[i]); + } + } + console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); + let exlist = listtemp; + expect(exlist[0]).assertEqual("MainAbility5 onAbilityCreate"); + expect(exlist[1]).assertEqual("MainAbility5 onAbilityWindowStageCreate"); + expect(exlist[2]).assertEqual("MainAbility5 onAbilityForeground"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[5]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[6]).assertEqual("MainAbility5 onAbilityBackground"); + expect(exlist[7]).assertEqual("MainAbility5 onAbilityWindowStageDestroy"); + expect(exlist[8]).assertEqual("MainAbility5 onAbilityDestroy"); + expect(exlist[9]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[10]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[11]).assertEqual("MainAbility2 onAbilityDestroy"); + globalThis.ability1context.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_0600 END-------------"); + done(); + }) + }, 4200); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_0700 + * @tc.name Multiple registration/unregistration + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0700", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0700 START-------------"); + TAG = "Singlehap_LifeCycleTest_0700"; + var code1; + var code2; + var code3; + var id1; + var id2; + var id3; + var listKey8 = []; + let AbilityLifecycleCallback = { + onAbilityCreate(ability) { + console.log(TAG + " onAbilityCreate ability:" + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log(TAG + " onAbilityCreate abilityname:" + JSON.stringify(abilityname)); + console.log(TAG + " " + abilityname + " onAbilityCreate"); + listKey8.push(abilityname + " onAbilityCreate"); + }, + onAbilityWindowStageCreate(ability) { + console.log(TAG + " onAbilityWindowStageCreate ability:" + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log(TAG + " onAbilityWindowStageCreate abilityname:" + JSON.stringify(abilityname)); + console.log(TAG + " " + abilityname + " onAbilityWindowStageCreate"); + listKey8.push(abilityname + " onAbilityWindowStageCreate"); + }, + onAbilityWindowStageDestroy(ability) { + console.log(TAG + " AbilityLifecycleCallback1 onAbilityWindowStageDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log(TAG + " AbilityLifecycleCallback1 onAbilityWindowStageDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log(TAG + " " + abilityname + " onAbilityWindowStageDestroy"); + listKey8.push(abilityname + " onAbilityWindowStageDestroy"); + }, + onAbilityDestroy(ability) { + console.log(TAG + " AbilityLifecycleCallback1 onAbilityDestroy ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log(TAG + " AbilityLifecycleCallback1 onAbilityDestroy abilityname:" + + JSON.stringify(abilityname)); + console.log(TAG + " " + abilityname + " onAbilityDestroy"); + listKey8.push(abilityname + " onAbilityDestroy"); + }, + onAbilityForeground(ability) { + console.log(TAG + " AbilityLifecycleCallback1 onAbilityForeground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log(TAG + " AbilityLifecycleCallback1 onAbilityForeground abilityname:" + + JSON.stringify(abilityname)); + console.log(TAG + " " + abilityname + " onAbilityForeground"); + listKey8.push(abilityname + " onAbilityForeground"); + }, + onAbilityBackground(ability) { + console.log(TAG + " AbilityLifecycleCallback1 onAbilityBackground ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log(TAG + " AbilityLifecycleCallback1 onAbilityBackground abilityname:" + + JSON.stringify(abilityname)); + console.log(TAG + " " + abilityname + " onAbilityBackground"); + listKey8.push(abilityname + " onAbilityBackground"); + }, + onAbilityContinue(ability) { + console.log(TAG + " AbilityLifecycleCallback1 onAbilityContinue ability:" + + JSON.stringify(ability)); + let abilityname = ability.context.abilityInfo.name; + console.log(TAG + " AbilityLifecycleCallback1 onAbilityContinue abilityname:" + + JSON.stringify(abilityname)); + console.log(TAG + " " + abilityname + " onAbilityContinue"); + listKey8.push(abilityname + " onAbilityContinue"); + } + } + let applicationContext = globalThis.abilityContext.getApplicationContext(); + id1 = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log(TAG + " registerAbilityLifecycleCallback1 number: " + JSON.stringify(id1)); + applicationContext.unregisterAbilityLifecycleCallback(id1, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback1 success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code1 = error.code; + }) + setTimeout(function () { + id2 = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log(TAG + " registerAbilityLifecycleCallback2 number: " + JSON.stringify(id2)); + applicationContext.unregisterAbilityLifecycleCallback(id2, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback2 success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code2 = error.code; + }) + }, 1000); + setTimeout(function () { + id3 = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log(TAG + " registerAbilityLifecycleCallback3 number: " + JSON.stringify(id3)); + applicationContext.unregisterAbilityLifecycleCallback(id3, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback3 success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code3 = error.code; + expect(id1 > 0).assertTrue(); + expect(id2).assertEqual(id1 + 1); + expect(id3).assertEqual(id2 + 1); + expect(code1).assertEqual(0); + expect(code2).assertEqual(0); + expect(code3).assertEqual(0); + console.log("------------Singlehap_LifeCycleTest_0700 END-------------"); + done(); + }) + }, 3000); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_0800 + * @tc.name Maninability1 Register listening, Repeat starting and termination Ability2 + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0800", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0800 START-------------"); + TAG = "Singlehap_LifeCycleTest_0800"; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility1", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 3000); + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 4500); + setTimeout(function () { + console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); + console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list1.length; i++) { + strtemp = globalThis.list1[i].substring(0, 12); + if (strtemp === "MainAbility1" || strtemp === "MainAbility2") { + listtemp.push(globalThis.list1[i]); + } + } + console.log(TAG + " listtemp is :" + listtemp); + let exlist = listtemp; + expect(exlist[0]).assertEqual("MainAbility1 onAbilityWindowStageCreate"); + expect(exlist[1]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[5]).assertEqual("MainAbility1 onAbilityBackground"); + expect(exlist[6]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(exlist[10]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[11]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[12]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[13]).assertEqual("MainAbility1 onAbilityBackground"); + expect(exlist[14]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[15]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[16]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[17]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(exlist[18]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[19]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[20]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[21]).assertEqual("MainAbility1 onAbilityBackground"); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_0800 END-------------"); + done(); + }); + }, 4950); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_0900 + * @tc.name Repeat switching Ability1 between front and back + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_0900", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_0900 START-------------"); + TAG = "Singlehap_LifeCycleTest_0900"; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility1", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 2000); + setTimeout(function () { + console.log(TAG + " registerAbilityLifecycleCallback listKey : " + JSON.stringify(globalThis.list1)); + console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list1.length; i++) { + strtemp = globalThis.list1[i].substring(0, 12); + if (strtemp === "MainAbility1" || strtemp === "MainAbility2") { + listtemp.push(globalThis.list1[i]); + } + } + console.log(TAG + " listtemp is :" + listtemp); + let exlist = listtemp; + expect(exlist[0]).assertEqual("MainAbility1 onAbilityWindowStageCreate"); + expect(exlist[1]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[2]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[5]).assertEqual("MainAbility1 onAbilityBackground"); + expect(exlist[6]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[7]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[8]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[9]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(exlist[10]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[11]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[12]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[13]).assertEqual("MainAbility1 onAbilityBackground"); + expect(exlist[14]).assertEqual("MainAbility1 onAbilityForeground"); + expect(exlist[15]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[16]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[17]).assertEqual("MainAbility2 onAbilityDestroy"); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_0900 END-------------"); + done(); + }); + }, 4000); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_1000 + * @tc.name Register listening in abilityA foreground,repeat the registration + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_1000", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1000 START-------------"); + TAG = "Singlehap_LifeCycleTest_1000"; + var id1; + var id2; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility6", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list6)); + console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid6)); + id1 = globalThis.callbackid6; + console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 2000); + setTimeout(function () { + console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list6)); + console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid6)); + id2 = globalThis.callbackid6; + console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); + expect(id1 + 1).assertEqual(id2); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid6, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_1000 END-------------"); + done(); + }); + }, 4500); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_1100 + * @tc.name Register listening in abilityA foreground,repeat the registration (singleton) + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_1100", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1100 START-------------"); + TAG = "Singlehap_LifeCycleTest_1100"; + var id1; + var id2; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility7", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list7)); + console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid7)); + id1 = globalThis.callbackid7; + console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility7", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 2000); + setTimeout(function () { + console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list7)); + console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid7)); + id2 = globalThis.callbackid7; + console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); + expect(id1).assertEqual(id2); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid7, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + var para = { + resultCode: 1, + want: { + "abilityName": "MainAbility1", + "bundleName": "com.example.lifecycle_xts" + } + } + console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); + globalThis.ability7.terminateSelfWithResult(para, (error, data) => { + console.log(TAG + " terminateSelfwithresult success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_1100 END-------------"); + done(); + }); + }, 4000); + }); + /* + * @tc.number Singlehap_LifeCycleTest_1200 + * @tc.name Register listening in abilityA foreground,repeat the registration (standard) + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_1200", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1200 START-------------"); + TAG = "Singlehap_LifeCycleTest_1200"; + var id1; + var id2; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility8", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list8)); + console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid8)); + id1 = globalThis.callbackid8; + console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility8", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 2000); + setTimeout(function () { + console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list8)); + console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid8)); + id2 = globalThis.callbackid8; + console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); + expect(id1 + 1).assertEqual(id2); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid8, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + var para = { + resultCode: 1, + want: { + "abilityName": "MainAbility8", + "bundleName": "com.example.lifecycle_xts" + } + } + console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); + globalThis.ability8.terminateSelfWithResult(para, (error, data) => { + console.log(TAG + " terminateSelfwithresult success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_1200 END-------------"); + done(); + }); + }, 4000); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_1300 + * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B (singleton) + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_1300", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1300 start-------------"); + TAG = "Singlehap_LifeCycleTest_1300"; + listKeyTemp = []; + abilityContext.startAbility({ + bundleName: "com.example.lifecycle_xts", + abilityName: "MainAbility9" + }, (error, data) => { + console.log(TAG + ": MainAbility9 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + await sleep(500); + abilityContext.startAbility({ + bundleName: "com.example.lifecycle_xts", + abilityName: "Hap1MainAbility1" + }, (error, data) => { + console.log(TAG + ":first Hap1MainAbility1 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + await sleep(500); + abilityContext.startAbility({ + bundleName: "com.example.lifecycle_xts", + abilityName: "Hap1MainAbility1" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": second Hap1MainAbility1 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + for (var i = 0; i < globalThis.mainAbility9ListKey.length; i++) { + if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility1") { + listKeyTemp.push(globalThis.mainAbility9ListKey[i]); + } + } + console.log(TAG + "listKeyTemp is :" + listKeyTemp); + console.log(TAG + "globalThis.mainAbility9CallBackId is :" + globalThis.mainAbility9CallBackId); + expect(listKeyTemp[0]).assertEqual("Hap1MainAbility1 onAbilityCreate"); + expect(listKeyTemp[1]).assertEqual("Hap1MainAbility1 onAbilityWindowStageCreate"); + expect(listKeyTemp[2]).assertEqual("Hap1MainAbility1 onAbilityForeground"); + expect(listKeyTemp[3]).assertEqual("Hap1MainAbility1 onAbilityBackground"); + expect(listKeyTemp[4]).assertEqual("Hap1MainAbility1 onAbilityWindowStageDestroy"); + expect(listKeyTemp[5]).assertEqual("Hap1MainAbility1 onAbilityDestroy"); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.mainAbility9CallBackId, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + done(); + }); + }, 3000) + }); + console.log("------------Singlehap_LifeCycleTest_1300 end-------------"); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_1400 + * @tc.name The ability of HAP A listens to the ability lifecycle callback of HAP B (standard) + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_1400", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1400 start-------------"); + TAG = "Singlehap_LifeCycleTest_1400"; + listKeyTemp = []; + abilityContext.startAbility({ + bundleName: "com.example.lifecycle_xts", + abilityName: "MainAbility9" + }, (error, data) => { + console.log(TAG + ": MainAbility9 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + await sleep(500); + abilityContext.startAbility({ + bundleName: "com.example.lifecycle_xts", + abilityName: "Hap1MainAbility2" + }, (error, data) => { + console.log(TAG + ":first Hap1MainAbility2 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + await sleep(500); + abilityContext.startAbility({ + bundleName: "com.example.lifecycle_xts", + abilityName: "Hap1MainAbility2" + }, (error, data) => { + setTimeout(() => { + console.log(TAG + ": second Hap1MainAbility2 startAbility success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + for (var i = 0;i < globalThis.mainAbility9ListKey.length; i++) { + if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility2") { + listKeyTemp.push(globalThis.mainAbility9ListKey[i]); + } + } + console.log(TAG + "listKeyTemp is :" + listKeyTemp); + console.log(TAG + "globalThis.mainAbility9CallBackId is :" + globalThis.mainAbility9CallBackId); + expect(listKeyTemp[0]).assertEqual("Hap1MainAbility2 onAbilityCreate"); + expect(listKeyTemp[1]).assertEqual("Hap1MainAbility2 onAbilityWindowStageCreate"); + expect(listKeyTemp[2]).assertEqual("Hap1MainAbility2 onAbilityForeground"); + expect(listKeyTemp[3]).assertEqual("Hap1MainAbility2 onAbilityCreate"); + expect(listKeyTemp[4]).assertEqual("Hap1MainAbility2 onAbilityWindowStageCreate"); + expect(listKeyTemp[5]).assertEqual("Hap1MainAbility2 onAbilityForeground"); + expect(listKeyTemp[6]).assertEqual("Hap1MainAbility2 onAbilityBackground"); + expect(listKeyTemp[7]).assertEqual("Hap1MainAbility2 onAbilityWindowStageDestroy"); + expect(listKeyTemp[8]).assertEqual("Hap1MainAbility2 onAbilityDestroy"); + expect(listKeyTemp[9]).assertEqual("Hap1MainAbility2 onAbilityBackground"); + expect(listKeyTemp[10]).assertEqual("Hap1MainAbility2 onAbilityWindowStageDestroy"); + expect(listKeyTemp[11]).assertEqual("Hap1MainAbility2 onAbilityDestroy"); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.mainAbility9CallBackId, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + done(); + }); + }, 3000) + }); + console.log("------------Singlehap_LifeCycleTest_1400 end-------------"); + }); + /* + * @tc.number Singlehap_LifeCycleTest_1500 + * @tc.name Register in abilityA , starting and termination AbilityB,Repeat previous steps (standard) + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_1500", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1500 START-------------"); + TAG = "Singlehap_LifeCycleTest_1500"; + var id1; + var id2; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility11", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list11)); + console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid11)); + id1 = globalThis.callbackid11; + console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility11", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 1000); + }, 3000); + setTimeout(function () { + console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list11)); + console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid11)); + id2 = globalThis.callbackid11; + console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list11.length; i++) { + strtemp = globalThis.list11[i].substring(0, 12); + if (strtemp == "MainAbility2") { + listtemp.push(globalThis.list11[i]); + } + } + console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); + let exlist = listtemp; + expect(exlist[0]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[1]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(id1 + 1).assertEqual(id2); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid11, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_1500 END-------------"); + done(); + }); + }, 6000); + }); + + var callbackid_NA = 100 + var callbackid_errorNum = -1 + var callbackid_errorType = "test" + /* + * @tc.number Singlehap_LifeCycleTest_1600 + * @tc.name input Nonexistent callbackid for unregisterAbilityLifecycleCallback parameter + * @tc.desc Function test + * @tc.level 1 + */ + it("Singlehap_LifeCycleTest_1600", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1600 START-------------"); + TAG = "Singlehap_LifeCycleTest_1600"; + let code; + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(callbackid_NA, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code = error.code; + sleep(1000); + expect(code).assertEqual(1); + done(); + }); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_1700 + * @tc.name input error callbackid for unregisterAbilityLifecycleCallback parameter + * @tc.desc Function test + * @tc.level 1 + */ + it("Singlehap_LifeCycleTest_1700", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1700 START-------------"); + TAG = "Singlehap_LifeCycleTest_1700"; + let code; + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(callbackid_errorNum, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code = error.code; + sleep(1000); + expect(code).assertEqual(1); + done(); + }); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_1800 + * @tc.name input error type callbackid for unregisterAbilityLifecycleCallback parameter + * @tc.desc Function test + * @tc.level 1 + */ + it("Singlehap_LifeCycleTest_1800", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1800 START-------------"); + TAG = "Singlehap_LifeCycleTest_1800"; + let code; + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(callbackid_errorType, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code = error.code; + sleep(1000); + expect(code).assertEqual(1); + done(); + }); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_1900 + * @tc.name input null callbackid for unregisterAbilityLifecycleCallback parameter + * @tc.desc Function test + * @tc.level 1 + */ + it("Singlehap_LifeCycleTest_1900", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_1900 START-------------"); + TAG = "Singlehap_LifeCycleTest_1900"; + let code; + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(null, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + code = error.code; + sleep(1000); + expect(code).assertEqual(1); + done(); + }); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_2000 + * @tc.name Register in abilityA, starting and termination AbilityB, terminate abilityA, Re-register in abilityA + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_2000", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_2000 START-------------"); + TAG = "Singlehap_LifeCycleTest_2000"; + var id1; + var id2; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility12", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + setTimeout(function () { + console.log(TAG + " firstCallback listKey : " + JSON.stringify(globalThis.list12)); + console.log(TAG + " firstCallback callbackid : " + JSON.stringify(globalThis.callbackid12)); + id1 = globalThis.callbackid12; + console.log(TAG + " firstCallback id : " + JSON.stringify(id1)); + var para = { + resultCode: 2000, + want: { + "abilityName": "MainAbility12", + "bundleName": "com.example.lifecycle_xts" + } + } + console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); + globalThis.ability12.terminateSelfWithResult(para) + .then((data) => { + console.log(TAG + " terminateSelfwithresult successful data: " + JSON.stringify(data)); + }).catch((error) => { + console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); + }); + }, 2500); + setTimeout(function () { + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility12", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + }, 4000); + setTimeout(function () { + console.log(TAG + " secondCallback listKey : " + JSON.stringify(globalThis.list12)); + console.log(TAG + " secondCallback callbackid : " + JSON.stringify(globalThis.callbackid12)); + id2 = globalThis.callbackid12; + console.log(TAG + " secondCallback id : " + JSON.stringify(id2)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < globalThis.list12.length; i++) { + strtemp = globalThis.list12[i].substring(0, 12); + if (strtemp == "MainAbility2") { + listtemp.push(globalThis.list12[i]); + } + } + console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); + let exlist = listtemp; + expect(exlist[0]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[1]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(id1 + 1).assertEqual(id2); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid6, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_2000 END-------------"); + done(); + }); + }, 6200); + }); + + /* + * @tc.number Singlehap_LifeCycleTest_2100 + * @tc.name Register in abilityA,register in abilityB, starting and termination abilityC, + termination abilityB、abilityA, Re-register in abilityA、abilityB + * @tc.desc Function test + * @tc.level 0 + */ + it("Singlehap_LifeCycleTest_2100", 0, async function (done) { + console.log("------------Singlehap_LifeCycleTest_2100 START-------------"); + TAG = "Singlehap_LifeCycleTest_2100"; + var id1; + var id2; + var id3; + var id4; + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility1", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility12", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str2 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str2) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + }, 500); + setTimeout(function () { + console.log(TAG + " firstCallback listKey1 : " + JSON.stringify(globalThis.list1)); + console.log(TAG + " firstCallback callbackid1 : " + JSON.stringify(globalThis.callbackid1)); + console.log(TAG + " firstCallback listKey12 : " + JSON.stringify(globalThis.list12)); + console.log(TAG + " firstCallback callbackid12 : " + JSON.stringify(globalThis.callbackid12)); + id1 = globalThis.callbackid1; + console.log(TAG + " firstCallback id1 : " + JSON.stringify(id1)); + id2 = globalThis.callbackid12; + console.log(TAG + " firstCallback id12 : " + JSON.stringify(id2)); + var para = { + resultCode: 2100, + want: { + "abilityName": "MainAbility12", + "bundleName": "com.example.lifecycle_xts" + } + } + console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); + globalThis.ability12.terminateSelfWithResult(para) + .then((data) => { + console.log(TAG + " terminateSelfwithresult successful data: " + JSON.stringify(data)); + }).catch((error) => { + console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); + }); + setTimeout(function () { + var para = { + resultCode: 2100, + want: { + "abilityName": "MainAbility1", + "bundleName": "com.example.lifecycle_xts" + } + } + console.log(TAG + " terminateSelfwithresult para: " + JSON.stringify(para)); + globalThis.ability1context.terminateSelfWithResult(para) + .then((data) => { + console.log(TAG + " terminateSelfwithresult successful data: " + JSON.stringify(data)); + }).catch((error) => { + console.log(TAG + " terminateSelfwithresult error: " + JSON.stringify(error)); + }); + }, 500); + }, 3000); + setTimeout(function () { + var str = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility1", + } + globalThis.abilityContext.startAbility(str) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str1 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility12", + } + globalThis.abilityContext.startAbility(str1) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + setTimeout(function () { + var str2 = { + "bundleName": "com.example.lifecycle_xts", + "abilityName": "MainAbility2", + } + globalThis.abilityContext.startAbility(str2) + .then((data) => { + console.info(TAG + ' start successful. Data: ' + data); + }).catch((error) => { + console.error(TAG + ' start failed. Cause: ' + JSON.stringify(error)); + }) + }, 500); + }, 500); + }, 4000); + setTimeout(function () { + console.log(TAG + " secondCallback listKey1 : " + JSON.stringify(globalThis.list1)); + let templist1 = globalThis.list1; + console.log(TAG + " secondCallback templist1 : " + JSON.stringify(templist1)); + console.log(TAG + " secondCallback callbackid1 : " + JSON.stringify(globalThis.callbackid1)); + console.log(TAG + " secondCallback listKey12 : " + JSON.stringify(globalThis.list12)); + let templist2 = globalThis.list12; + console.log(TAG + " secondCallback templist2 : " + JSON.stringify(templist2)); + console.log(TAG + " secondCallback callbackid12 : " + JSON.stringify(globalThis.callbackid12)); + id3 = globalThis.callbackid1; + console.log(TAG + " secondCallback id1 : " + JSON.stringify(id3)); + id4 = globalThis.callbackid12; + console.log(TAG + " secondCallback id12 : " + JSON.stringify(id4)); + var strtemp = ""; + var listtemp = []; + for (var i = 0; i < templist1.length; i++) { + strtemp = templist1[i].substring(0, 13); + if (strtemp === "MainAbility2 " || strtemp === "MainAbility12") { + listtemp.push(templist1[i]); + } + } + console.log(TAG + " listtemp is :" + JSON.stringify(listtemp)); + setTimeout(function () { + var strtemp1 = ""; + var listtemp1 = []; + for (var j = 0; j < templist2.length; j++) { + strtemp1 = templist2[j].substring(0, 12); + if (strtemp1 === "MainAbility2") { + listtemp1.push(templist2[j]); + } + } + console.log(TAG + " listtemp1 is :" + JSON.stringify(listtemp1)); + let exlist = listtemp; + let exlist1 = listtemp1; + expect(exlist[0]).assertEqual("MainAbility12 onAbilityCreate"); + expect(exlist[1]).assertEqual("MainAbility12 onAbilityWindowStageCreate"); + expect(exlist[2]).assertEqual("MainAbility12 onAbilityForeground"); + expect(exlist[3]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist[4]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist[5]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist[6]).assertEqual("MainAbility12 onAbilityBackground"); + expect(exlist[7]).assertEqual("MainAbility12 onAbilityForeground"); + expect(exlist[8]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist[9]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist[10]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(exlist1[0]).assertEqual("MainAbility2 onAbilityCreate"); + expect(exlist1[1]).assertEqual("MainAbility2 onAbilityWindowStageCreate"); + expect(exlist1[2]).assertEqual("MainAbility2 onAbilityForeground"); + expect(exlist1[3]).assertEqual("MainAbility2 onAbilityBackground"); + expect(exlist1[4]).assertEqual("MainAbility2 onAbilityWindowStageDestroy"); + expect(exlist1[5]).assertEqual("MainAbility2 onAbilityDestroy"); + expect(id1 + 1).assertEqual(id2); + expect(id3 + 1).assertEqual(id4); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid12, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + }); + abilityContext.getApplicationContext() + .unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => { + console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) + + ",data: " + JSON.stringify(data)); + console.log("------------Singlehap_LifeCycleTest_2100 END-------------"); + done(); + }); + }, 100); + }, 7000); + }); + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/ListTest.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/ListTest.ets new file mode 100644 index 000000000..becdd6d36 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/ListTest.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import LifeCycleTest from './LifeCycleTest' + +export default function List(context) { + LifeCycleTest(context) +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/module.json b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/module.json new file mode 100644 index 000000000..2dc9bfeff --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/module.json @@ -0,0 +1,136 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [{ + "name": "com.example.lifecycle_xts.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [{ + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + }] + }, + { + "name": "MainAbility1", + "srcEntrance": "./ets/MainAbility1/MainAbility1.ts", + "description": "$string:MainAbility1_desc", + "icon": "$media:icon", + "label": "$string:MainAbility1_label" + }, + { + "name": "MainAbility2", + "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", + "description": "$string:MainAbility2_desc", + "icon": "$media:icon", + "label": "$string:MainAbility2_label" + }, + { + "name": "MainAbility3", + "srcEntrance": "./ets/MainAbility3/MainAbility3.ts", + "description": "$string:MainAbility3_desc", + "icon": "$media:icon", + "label": "$string:MainAbility3_label" + }, + { + "name": "MainAbility4", + "srcEntrance": "./ets/MainAbility4/MainAbility4.ts", + "description": "$string:MainAbility4_desc", + "icon": "$media:icon", + "label": "$string:MainAbility4_label" + }, + { + "name": "MainAbility5", + "srcEntrance": "./ets/MainAbility5/MainAbility5.ts", + "description": "$string:MainAbility5_desc", + "icon": "$media:icon", + "label": "$string:MainAbility5_label" + }, + { + "name": "MainAbility6", + "srcEntrance": "./ets/MainAbility6/MainAbility6.ts", + "description": "$string:MainAbility6_desc", + "icon": "$media:icon", + "label": "$string:MainAbility6_label" + }, + { + "name": "MainAbility7", + "srcEntrance": "./ets/MainAbility7/MainAbility7.ts", + "description": "$string:MainAbility7_desc", + "launchType": "singleton", + "icon": "$media:icon", + "label": "$string:MainAbility7_label" + }, + { + "name": "MainAbility8", + "srcEntrance": "./ets/MainAbility8/MainAbility8.ts", + "description": "$string:MainAbility8_desc", + "launchType": "standard", + "icon": "$media:icon", + "label": "$string:MainAbility8_label" + }, + { + "name": "MainAbility9", + "srcEntrance": "./ets/MainAbility9/MainAbility9.ts", + "description": "$string:MainAbility9_desc", + "icon": "$media:icon", + "label": "$string:MainAbility9_label" + }, + { + "name": "Hap1MainAbility1", + "srcEntrance": "./ets/Hap1MainAbility1/Hap1MainAbility1.ts", + "description": "$string:Hap1MainAbility1_desc", + "icon": "$media:icon", + "label": "$string:Hap1MainAbility1_label", + "launchType": "singleton" + }, + { + "name": "Hap1MainAbility2", + "srcEntrance": "./ets/Hap1MainAbility2/Hap1MainAbility2.ts", + "description": "$string:Hap1MainAbility2_desc", + "icon": "$media:icon", + "label": "$string:Hap1MainAbility2_label", + "launchType": "standard" + }, + { + "name": "MainAbility10", + "srcEntrance": "./ets/MainAbility10/MainAbility10.ts", + "description": "$string:MainAbility10_desc", + "icon": "$media:icon", + "label": "$string:MainAbility10_label" + }, + { + "name": "MainAbility11", + "srcEntrance": "./ets/MainAbility11/MainAbility11.ts", + "description": "$string:MainAbility11_desc", + "icon": "$media:icon", + "label": "$string:MainAbility11_label", + "launchType": "standard" + }, + { + "name": "MainAbility12", + "srcEntrance": "./ets/MainAbility12/MainAbility12.ts", + "description": "$string:MainAbility12_desc", + "icon": "$media:icon", + "label": "$string:MainAbility12_label" + }] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..76d7bab09 --- /dev/null +++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,160 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "MainAbility1_desc", + "value": "description" + }, + { + "name": "MainAbility1_label", + "value": "label" + }, + { + "name": "MainAbility2_desc", + "value": "description" + }, + { + "name": "MainAbility2_label", + "value": "label" + }, + { + "name": "MainAbility3_desc", + "value": "description" + }, + { + "name": "MainAbility3_label", + "value": "label" + }, + { + "name": "MainAbility4_desc", + "value": "description" + }, + { + "name": "MainAbility4_label", + "value": "label" + }, + { + "name": "MainAbility5_desc", + "value": "description" + }, + { + "name": "MainAbility5_label", + "value": "label" + }, + { + "name": "MainAbility6_desc", + "value": "description" + }, + { + "name": "MainAbility6_label", + "value": "label" + }, + { + "name": "MainAbility7_desc", + "value": "description" + }, + { + "name": "MainAbility7_label", + "value": "label" + }, + { + "name": "MainAbility8_desc", + "value": "description" + }, + { + "name": "MainAbility8_label", + "value": "label" + }, + { + "name": "MainAbility9_desc", + "value": "description" + }, + { + "name": "MainAbility9_label", + "value": "label" + }, + { + "name": "Hap1MainAbility1_desc", + "value": "description" + }, + { + "name": "Hap1MainAbility1_label", + "value": "label" + }, + { + "name": "Hap1MainAbility2_desc", + "value": "description" + }, + { + "name": "Hap1MainAbility2_label", + "value": "label" + }, + { + "name": "MainAbility10_desc", + "value": "description" + }, + { + "name": "MainAbility10_label", + "value": "label" + }, + { + "name": "MainAbility11_desc", + "value": "description" + }, + { + "name": "MainAbility11_label", + "value": "label" + }, + { + "name": "MainAbility12_desc", + "value": "description" + }, + { + "name": "MainAbility12_label", + "value": "label" + }, + { + "name": "MainAbility13_desc", + "value": "description" + }, + { + "name": "MainAbility13_label", + "value": "label" + } + ] +} diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/profile/main_pages.json rename to ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/resources/base/profile/main_pages.json diff --git a/aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/signature/openharmony_sx.p7b b/ability/ability_runtime/stage/actslifecyclesinglehaptest/signature/openharmony_sx.p7b similarity index 100% rename from aafwk/aafwk_standard/stage/actslifecyclesinglehaptest/signature/openharmony_sx.p7b rename to ability/ability_runtime/stage/actslifecyclesinglehaptest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/want/BUILD.gn b/ability/ability_runtime/want/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/want/BUILD.gn rename to ability/ability_runtime/want/BUILD.gn diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/BUILD.gn b/ability/ability_runtime/want/actsgetwantalltest/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/BUILD.gn rename to ability/ability_runtime/want/actsgetwantalltest/BUILD.gn diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/Test.json b/ability/ability_runtime/want/actsgetwantalltest/Test.json similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/Test.json rename to ability/ability_runtime/want/actsgetwantalltest/Test.json diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/config.json b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/config.json rename to ability/ability_runtime/want/actsgetwantalltest/entry/src/main/config.json diff --git a/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/app.js b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/app.js new file mode 100644 index 000000000..8e47afff1 --- /dev/null +++ b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.css b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/resources/base/element/string.json b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..2f9470d82 --- /dev/null +++ b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js rename to ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js diff --git a/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/test/List.test.js b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/test/List.test.js new file mode 100644 index 000000000..b09ec7c7b --- /dev/null +++ b/ability/ability_runtime/want/actsgetwantalltest/entry/src/main/js/test/List.test.js @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +require('./ActsGetWantAllTest.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/signature/openharmony_sx.p7b b/ability/ability_runtime/want/actsgetwantalltest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/want/actsgetwantalltest/signature/openharmony_sx.p7b rename to ability/ability_runtime/want/actsgetwantalltest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/BUILD.gn b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/BUILD.gn similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/BUILD.gn rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/BUILD.gn diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/signature/openharmony_sx.p7b b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/signature/openharmony_sx.p7b rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/config.json b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/config.json similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/config.json rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/config.json diff --git a/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/app.js b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/app.js new file mode 100644 index 000000000..8e47afff1 --- /dev/null +++ b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/en-US.json similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/en-US.json rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/zh-CN.json similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/zh-CN.json rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.css b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.css similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.css rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.hml b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.hml similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.hml rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.js b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.js old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.js rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/default/pages/index/index.js diff --git a/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/element/string.json b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/element/string.json new file mode 100644 index 000000000..2f9470d82 --- /dev/null +++ b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/media/icon.png similarity index 100% rename from aafwk/aafwk_standard/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/media/icon.png rename to ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/js/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/zidltest/BUILD.gn b/ability/ability_runtime/zidltest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/BUILD.gn rename to ability/ability_runtime/zidltest/BUILD.gn diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/AppScope/app.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/app.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/AppScope/app.json rename to ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/app.json diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/AppScope/resources/base/element/string.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/AppScope/resources/base/element/string.json rename to ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/BUILD.gn b/ability/ability_runtime/zidltest/actsamszidlclienttest/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/BUILD.gn rename to ability/ability_runtime/zidltest/actsamszidlclienttest/BUILD.gn diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/Test.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/Test.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/Test.json rename to ability/ability_runtime/zidltest/actsamszidlclienttest/Test.json diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/Application/AbilityStage.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/Application/AbilityStage.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/Application/AbilityStage.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/MainAbility/MainAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/MainAbility/MainAbility.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/MainAbility/MainAbility.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts new file mode 100644 index 000000000..a9469ce4d --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default interface IInterfaceDeclare { + testInterface(data: number, callback: testInterfaceCallback): void; +} +export type testInterfaceCallback = (errCode: number) => void; + diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts new file mode 100644 index 000000000..9f9cc9c43 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {testInterfaceCallback} from "./i_interface_declare"; +import IInterfaceDeclare from "./i_interface_declare"; +import rpc from "@ohos.rpc"; + +export default class InterfaceDeclareProxy implements IInterfaceDeclare { + constructor(proxy) { + this.proxy = proxy; + } + + testInterface(data: number, callback: testInterfaceCallback): void + { + let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); + let _data = new rpc.MessageParcel(); + let _reply = new rpc.MessageParcel(); + _data.writeInt(data); + this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { + if (result.errCode === 0) { + let _errCode = result.reply.readInt(); + callback(_errCode); + } else { + console.log("sendRequest failed, errCode: " + result.errCode); + } + }) + } + + static readonly COMMAND_TEST_INTERFACE = 1; + private proxy +} + diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts new file mode 100644 index 000000000..1606f77b4 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {testInterfaceCallback} from "./i_interface_declare"; +import IInterfaceDeclare from "./i_interface_declare"; +import rpc from "@ohos.rpc"; + +export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { + constructor(des: string) { + super(des); + } + + onRemoteRequest(code: number, data, reply, option): boolean { + console.log("onRemoteRequest called, code = " + code); + switch(code) { + case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { + let _data = data.readInt(); + this.testInterface(_data, (errCode) => { + reply.writeInt(errCode); + }); + return true; + } + default: { + console.log("invalid request code" + code); + break; + } + } + return false; + } + + testInterface(data: number, callback: testInterfaceCallback): void{} + + static readonly COMMAND_TEST_INTERFACE = 1; +} + diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts new file mode 100644 index 000000000..bef9dcbe2 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts @@ -0,0 +1,28 @@ +export default class MySequenceable { + constructor() { + this.num = 14; + this.str = "hello"; + } + getNum() : number { + return this.num; + } + + getString() : string { + return this.str; + } + + marshalling(messageParcel) { + console.info('marshalling++++'); + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + return true; + } + unmarshalling(messageParcel) { + console.info('unmarshalling++++'); + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + return true; + } + private num; + private str; +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts new file mode 100644 index 000000000..a17db0f5d --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default interface IInterfaceAttributeDeclaratoinOneway { + voidVoidFirst(callback: voidVoidFirstCallback): void; + voidVoidSecond(callback: voidVoidSecondCallback): void; + voidVoidThird(callback: voidVoidThirdCallback): void; +} +export type voidVoidFirstCallback = (errCode: number) => void; +export type voidVoidSecondCallback = (errCode: number) => void; +export type voidVoidThirdCallback = (errCode: number) => void; + diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts new file mode 100644 index 000000000..016f352bd --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {voidVoidFirstCallback} from "./i_interface_attribute_declaratoin_oneway"; +import {voidVoidSecondCallback} from "./i_interface_attribute_declaratoin_oneway"; +import {voidVoidThirdCallback} from "./i_interface_attribute_declaratoin_oneway"; +import IInterfaceAttributeDeclaratoinOneway from "./i_interface_attribute_declaratoin_oneway"; +import rpc from "@ohos.rpc"; + +export default class InterfaceAttributeDeclaratoinOnewayStub extends rpc.RemoteObject implements IInterfaceAttributeDeclaratoinOneway { + constructor(des: string) { + super(des); + } + + onRemoteRequest(code: number, data, reply, option): boolean { + console.log("onRemoteRequest called, code = " + code); + switch(code) { + case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_FIRST: { + this.voidVoidFirst((errCode) => { + reply.writeInt(errCode); + }); + return true; + } + case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_SECOND: { + this.voidVoidSecond((errCode) => { + reply.writeInt(errCode); + }); + return true; + } + case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_THIRD: { + this.voidVoidThird((errCode) => { + reply.writeInt(errCode); + }); + return true; + } + default: { + console.log("invalid request code" + code); + break; + } + } + return false; + } + + voidVoidFirst(callback: voidVoidFirstCallback): void{} + voidVoidSecond(callback: voidVoidSecondCallback): void{} + voidVoidThird(callback: voidVoidThirdCallback): void{} + + static readonly COMMAND_VOID_VOID_FIRST = 1; + static readonly COMMAND_VOID_VOID_SECOND = 2; + static readonly COMMAND_VOID_VOID_THIRD = 3; +} + diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts new file mode 100644 index 000000000..a9469ce4d --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default interface IInterfaceDeclare { + testInterface(data: number, callback: testInterfaceCallback): void; +} +export type testInterfaceCallback = (errCode: number) => void; + diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts new file mode 100644 index 000000000..9f9cc9c43 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {testInterfaceCallback} from "./i_interface_declare"; +import IInterfaceDeclare from "./i_interface_declare"; +import rpc from "@ohos.rpc"; + +export default class InterfaceDeclareProxy implements IInterfaceDeclare { + constructor(proxy) { + this.proxy = proxy; + } + + testInterface(data: number, callback: testInterfaceCallback): void + { + let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); + let _data = new rpc.MessageParcel(); + let _reply = new rpc.MessageParcel(); + _data.writeInt(data); + this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { + if (result.errCode === 0) { + let _errCode = result.reply.readInt(); + callback(_errCode); + } else { + console.log("sendRequest failed, errCode: " + result.errCode); + } + }) + } + + static readonly COMMAND_TEST_INTERFACE = 1; + private proxy +} + diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts new file mode 100644 index 000000000..1606f77b4 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {testInterfaceCallback} from "./i_interface_declare"; +import IInterfaceDeclare from "./i_interface_declare"; +import rpc from "@ohos.rpc"; + +export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { + constructor(des: string) { + super(des); + } + + onRemoteRequest(code: number, data, reply, option): boolean { + console.log("onRemoteRequest called, code = " + code); + switch(code) { + case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { + let _data = data.readInt(); + this.testInterface(_data, (errCode) => { + reply.writeInt(errCode); + }); + return true; + } + default: { + console.log("invalid request code" + code); + break; + } + } + return false; + } + + testInterface(data: number, callback: testInterfaceCallback): void{} + + static readonly COMMAND_TEST_INTERFACE = 1; +} + diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index.ets rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index.ets diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second.ets rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second.ets diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second/second.ets diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/Ability.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/test/Ability.test.ets rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/Ability.test.ets diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/List.test.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/test/List.test.ets rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/List.test.ets diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/i_zidl_tool_test.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/i_zidl_tool_test.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/i_zidl_tool_test.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/i_zidl_tool_test.ts diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts new file mode 100644 index 000000000..742b78e6a --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts @@ -0,0 +1,28 @@ +export default class MySequenceable { + constructor() { + this.num = 32; + this.str = "nihao"; + } + getNum() : number { + return this.num; + } + + getString() : string { + return this.str; + } + + marshalling(messageParcel) { + console.info('marshalling++++'); + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + return true; + } + unmarshalling(messageParcel) { + console.info('unmarshalling++++'); + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + return true; + } + private num; + private str; +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/zidl_tool_test_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/zidl_tool_test_proxy.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/zidl_tool_test_proxy.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/zidl_tool_test_proxy.ts diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts new file mode 100644 index 000000000..a17db0f5d --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default interface IInterfaceAttributeDeclaratoinOneway { + voidVoidFirst(callback: voidVoidFirstCallback): void; + voidVoidSecond(callback: voidVoidSecondCallback): void; + voidVoidThird(callback: voidVoidThirdCallback): void; +} +export type voidVoidFirstCallback = (errCode: number) => void; +export type voidVoidSecondCallback = (errCode: number) => void; +export type voidVoidThirdCallback = (errCode: number) => void; + diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy.ts rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/module.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/module.json rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/element/string.json old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/resources/base/element/string.json rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/element/string.json diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/signature/openharmony_sx.p7b b/ability/ability_runtime/zidltest/actsamszidlclienttest/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlclienttest/signature/openharmony_sx.p7b rename to ability/ability_runtime/zidltest/actsamszidlclienttest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/app.json b/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/app.json new file mode 100644 index 000000000..89dc01d02 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.example.zidlservice", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 8, + "targetAPIVersion": 8, + "car": { + "apiCompatibleVersion": 8, + "singleUser": false + } + } +} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json b/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..be09cccde --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohosProject" + } + ] +} diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/media/app_icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/AppScope/resources/base/media/app_icon.png rename to ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/media/app_icon.png diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/BUILD.gn b/ability/ability_runtime/zidltest/actsamszidlservice/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/BUILD.gn rename to ability/ability_runtime/zidltest/actsamszidlservice/BUILD.gn diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/Test.json b/ability/ability_runtime/zidltest/actsamszidlservice/Test.json new file mode 100644 index 000000000..4300a64be --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/Test.json @@ -0,0 +1,3 @@ +{ + "description": "Configuration for hjunit demo Tests" +} diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 000000000..98eb012db --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..3b14eab61 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("ACTS_ProcessManage VendorAppService MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("ACTS_ProcessManage VendorAppService MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageCreate") + globalThis.abilityContext = this.context + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageDestroy") + } + + async onForeground() { + // Ability has brought to foreground + console.log("ACTS_ProcessManage VendorAppService MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("ACTS_ProcessManage VendorAppService MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts new file mode 100644 index 000000000..a9469ce4d --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default interface IInterfaceDeclare { + testInterface(data: number, callback: testInterfaceCallback): void; +} +export type testInterfaceCallback = (errCode: number) => void; + diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts new file mode 100644 index 000000000..9f9cc9c43 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {testInterfaceCallback} from "./i_interface_declare"; +import IInterfaceDeclare from "./i_interface_declare"; +import rpc from "@ohos.rpc"; + +export default class InterfaceDeclareProxy implements IInterfaceDeclare { + constructor(proxy) { + this.proxy = proxy; + } + + testInterface(data: number, callback: testInterfaceCallback): void + { + let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); + let _data = new rpc.MessageParcel(); + let _reply = new rpc.MessageParcel(); + _data.writeInt(data); + this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { + if (result.errCode === 0) { + let _errCode = result.reply.readInt(); + callback(_errCode); + } else { + console.log("sendRequest failed, errCode: " + result.errCode); + } + }) + } + + static readonly COMMAND_TEST_INTERFACE = 1; + private proxy +} + diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts new file mode 100644 index 000000000..1606f77b4 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {testInterfaceCallback} from "./i_interface_declare"; +import IInterfaceDeclare from "./i_interface_declare"; +import rpc from "@ohos.rpc"; + +export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { + constructor(des: string) { + super(des); + } + + onRemoteRequest(code: number, data, reply, option): boolean { + console.log("onRemoteRequest called, code = " + code); + switch(code) { + case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { + let _data = data.readInt(); + this.testInterface(_data, (errCode) => { + reply.writeInt(errCode); + }); + return true; + } + default: { + console.log("invalid request code" + code); + break; + } + } + return false; + } + + testInterface(data: number, callback: testInterfaceCallback): void{} + + static readonly COMMAND_TEST_INTERFACE = 1; +} + diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/service.ts rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/service.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts new file mode 100644 index 000000000..bef9dcbe2 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts @@ -0,0 +1,28 @@ +export default class MySequenceable { + constructor() { + this.num = 14; + this.str = "hello"; + } + getNum() : number { + return this.num; + } + + getString() : string { + return this.str; + } + + marshalling(messageParcel) { + console.info('marshalling++++'); + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + return true; + } + unmarshalling(messageParcel) { + console.info('unmarshalling++++'); + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + return true; + } + private num; + private str; +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/service.ts old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/service.ts rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/service.ts diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts new file mode 100644 index 000000000..a17db0f5d --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +export default interface IInterfaceAttributeDeclaratoinOneway { + voidVoidFirst(callback: voidVoidFirstCallback): void; + voidVoidSecond(callback: voidVoidSecondCallback): void; + voidVoidThird(callback: voidVoidThirdCallback): void; +} +export type voidVoidFirstCallback = (errCode: number) => void; +export type voidVoidSecondCallback = (errCode: number) => void; +export type voidVoidThirdCallback = (errCode: number) => void; + diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts new file mode 100644 index 000000000..016f352bd --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {voidVoidFirstCallback} from "./i_interface_attribute_declaratoin_oneway"; +import {voidVoidSecondCallback} from "./i_interface_attribute_declaratoin_oneway"; +import {voidVoidThirdCallback} from "./i_interface_attribute_declaratoin_oneway"; +import IInterfaceAttributeDeclaratoinOneway from "./i_interface_attribute_declaratoin_oneway"; +import rpc from "@ohos.rpc"; + +export default class InterfaceAttributeDeclaratoinOnewayStub extends rpc.RemoteObject implements IInterfaceAttributeDeclaratoinOneway { + constructor(des: string) { + super(des); + } + + onRemoteRequest(code: number, data, reply, option): boolean { + console.log("onRemoteRequest called, code = " + code); + switch(code) { + case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_FIRST: { + this.voidVoidFirst((errCode) => { + reply.writeInt(errCode); + }); + return true; + } + case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_SECOND: { + this.voidVoidSecond((errCode) => { + reply.writeInt(errCode); + }); + return true; + } + case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_THIRD: { + this.voidVoidThird((errCode) => { + reply.writeInt(errCode); + }); + return true; + } + default: { + console.log("invalid request code" + code); + break; + } + } + return false; + } + + voidVoidFirst(callback: voidVoidFirstCallback): void{} + voidVoidSecond(callback: voidVoidSecondCallback): void{} + voidVoidThird(callback: voidVoidThirdCallback): void{} + + static readonly COMMAND_VOID_VOID_FIRST = 1; + static readonly COMMAND_VOID_VOID_SECOND = 2; + static readonly COMMAND_VOID_VOID_THIRD = 3; +} + diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/index/index.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/pages/index/index.ets rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/index/index.ets diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/second/second.ets old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/ets/pages/second/second.ets rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/second/second.ets diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json new file mode 100644 index 000000000..a30b03748 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json @@ -0,0 +1,99 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:phone_entry_dsc", + "mainElement": "MainAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "uiSyntax": "ets", + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "com.example.zidlservice.MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:phone_entry_main", + "icon": "$media:icon", + "label": "$string:entry_label", + "visible": true, + "orientation": "portrait", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", + "name": "com.example.zidlservice.ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + }, + { + "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", + "name": "com.example.zidlservice.ServiceAbility2", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:phone_entry_main", + "type": "service", + "visible": true + } + ], + "requestPermissions": [ + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name":"ohos.permission.REMOVE_CACHE_FILES", + "reason":"need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" + }, + { + "name":"ohos.permission.INSTALL_BUNDLE", + "reason":"need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name":"ohos.permission.MANAGE_MISSIONS", + "reason":"need use ohos.permission.MANAGE_MISSIONS" + }, + { + "name":"ohos.permission.GET_RUNNING_INFO", + "reason":"need use ohos.permission.GET_RUNNING_INFO" + }, + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.CLEAN_APPLICATION_DATA", + "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" + } + ] + } +} diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..d75325f3c --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "phone_entry_dsc", + "value": "i am an entry for phone" + }, + { + "name": "phone_entry_main", + "value": "the phone entry ability" + }, + { + "name": "entry_label", + "value": "ActsContextTest" + }, + { + "name": "form_description", + "value": "my form" + }, + { + "name": "serviceability_description", + "value": "my whether" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "app_name", + "value": "Demo" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/media/icon.png old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/entry/src/main/resources/base/media/icon.png rename to ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/media/icon.png diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 000000000..6898b31d2 --- /dev/null +++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index/index", + "pages/second/second" + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlservice/signature/openharmony_sx.p7b b/ability/ability_runtime/zidltest/actsamszidlservice/signature/openharmony_sx.p7b old mode 100755 new mode 100644 similarity index 100% rename from aafwk/aafwk_standard/zidltest/actsamszidlservice/signature/openharmony_sx.p7b rename to ability/ability_runtime/zidltest/actsamszidlservice/signature/openharmony_sx.p7b diff --git a/test_packages.gni b/test_packages.gni index 4e5b51586..83d23ad33 100644 --- a/test_packages.gni +++ b/test_packages.gni @@ -22,7 +22,7 @@ _all_test_packages = [ "${ACTS_ROOT}/account:account", "${ACTS_ROOT}/communication:communication", "${ACTS_ROOT}/notification:notification", - "${ACTS_ROOT}/aafwk:aafwk", + "${ACTS_ROOT}/ability:ability", "${ACTS_ROOT}/miscservices:miscservices", "${ACTS_ROOT}/powermgr:powermgr", "${ACTS_ROOT}/startup:startup", -- GitLab