diff --git a/ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets index 37cbf1f99eb45f18ed24e7e79b360cbb2872bbdd..9b3273043183ca68cf2b29f66291b87c1aaa532e 100644 --- a/ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets @@ -109,7 +109,10 @@ export default function abilityTest() { data.addAbilityMonitor( { abilityName: 'MainAbility2', - onAbilityForeground: onAbilityForeground + onAbilityForeground: onAbilityForeground, + onWindowStageRestore:(Ability)=>{ + console.info("===>onWindowStageRestore"); + } }, (async (err) => { console.debug("====>ACTS_AddAbilityMonitor_0200 success====>" + err.code); await globalThis.abilitydelegator.startAbility( diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets index aefa1ec9ebfb4b3d81b78eb6f761643b1756899a..06b6e8e828e96db63bf44351a92c8bba1120c3f4 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/ets/test/Ability.test.ets @@ -97,6 +97,8 @@ export default function abilityTest() { var state = abilityDelegator.getAbilityState(ability); console.debug("====>ACTS_GetAbilityState_0300 state:" + state); expect(state).assertEqual(AbilityDelegatorRegistry.AbilityLifecycleState.FOREGROUND); + expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.CREATE).assertTrue() + expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.DESTROY).assertTrue() abilityDelegator.doAbilityBackground(ability, (err, isBackground)=>{ console.debug("====>doAbilityBackground_0300 data:" + JSON.stringify(isBackground)); expect(isBackground).assertTrue(); diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts index 9aaa52cb2e281213b40912f6a5d157d36d52f444..9817979907de1adda9ef8802aba894e092a50367 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts @@ -21,11 +21,13 @@ export default class ServiceAbility extends ServiceExtension { onCreate(want:Want) { globalThis.abilityWant = want; let direction = this.context.config.direction + let pointerDervice = this.context.config.hasPointerDevice let AbilityInfo = this.context.extensionAbilityInfo.bundleName console.log('ServiceAbility onCreate, want: ' + want.abilityName); var CommonEventPublishData = { parameters: { "config": direction, + "poniterDevices": pointerDervice, "AbilityInfo":AbilityInfo } } diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets index 340d0427221ea9c75dd9b12ecf6b02cbbaf1a7e0..53b0fca613500d939be760f3beff0f1b313c5875 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets +++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets @@ -418,6 +418,35 @@ export default function ApiCoverTest() { }) }); + /* + * @tc.number SUB_AA_Test_ProcessRunningInformation_0200 + * @tc.name Test getProcessRunningInformation by callback in appManager. + * @tc.desc Function test + * @tc.level 3 + */ + it('SUB_AA_Test_ProcessRunningInformation_0200', 0, async function (done) { + let process; + appManager.getProcessRunningInformation((error, processRunningInformations)=>{ + if(error.code == 0){ + console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations)); + for(let i = 0; i < processRunningInformations.length; i++){ + console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations[i])); + expect(processRunningInformations[i].pid).assertLarger(0) + expect(processRunningInformations[i].uid).assertLarger(0) + if(processRunningInformations[i].processName == "com.example.apicoverhaptest"){ + process = processRunningInformations[i] + } + } + expect(process.bundleNames[0]).assertEqual("com.example.apicoverhaptest") + done() + }else{ + console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(error)); + expect().assertFail() + done() + } + }) + }); + /* * @tc.number SUB_AA_FMS_AbilityStage_0100 * @tc.name Start AbilityStage and get config. @@ -476,6 +505,7 @@ export default function ApiCoverTest() { function SubscribeInfoCallback(err, data) { console.info("SUB_AA_FMS_AbilityStage_0200===SubscribeInfoCallback===" + JSON.stringify(data)) expect(data.parameters["config"]).assertEqual(0) + expect(data.parameters["poniterDevices"]).assertFalse() expect(data.parameters["AbilityInfo"]).assertEqual("com.example.apicoverhaptest") commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback) done() @@ -508,6 +538,7 @@ export default function ApiCoverTest() { */ it('SUB_AA_FMS_AcquireForm_0100', 0, async function (done) { let subscriber = null + let formExtensionContext:appContext.FormExtensionContext let subscribeInfo = { events: ["Form_StartAbility"] }