diff --git a/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/test/StageAppContext.test.ets b/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/test/StageAppContext.test.ets index f449067dd20e3b3323e8dbaefaf436c95759b081..8ae50880b8130fd840e737a8976f3aefe8f68bd4 100644 --- a/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/test/StageAppContext.test.ets +++ b/ability/ability_runtime/context/actsstageappcontext/actsstageappcontexttest/entry/src/main/ets/test/StageAppContext.test.ets @@ -204,5 +204,41 @@ export default function stageAppContextTest(abilityContext) { expect(result.bundleCodeDir).assertEqual("/data/storage/el1/bundle"); done(); }); + + /** + * @tc.number: SUB_AA_OpenHarmony_ApplicationContext_1600 + * @tc.name: getProcessRunningInformation test 1 + * getProcessRunningInformation test + * @tc.desc: Function test + * @tc.level 3 + */ + it('SUB_AA_OpenHarmony_ApplicationContext_1600', 0, async function (done) { + let TAG = "SUB_AA_OpenHarmony_ApplicationContext_1600"; + console.log(TAG + " --- start"); + let context = globalThis.abilityStageContext.getApplicationContext(); + context.getProcessRunningInformation().then((data) => { + console.log(TAG + " result = " + JSON.stringify(data)); + expect(data[0].processName).assertEqual("com.example.stageappcontexttest"); + }) + done(); + }); + + /** + * @tc.number: SUB_AA_OpenHarmony_ApplicationContext_1700 + * @tc.name: getProcessRunningInformation test 2 + * getProcessRunningInformation test + * @tc.desc: Function test + * @tc.level 3 + */ + it('SUB_AA_OpenHarmony_ApplicationContext_1700', 0, async function (done) { + let TAG = "SUB_AA_OpenHarmony_ApplicationContext_1700"; + console.log(TAG + " --- start"); + let context = globalThis.abilityStageContext.getApplicationContext(); + context.getProcessRunningInformation((err, data) => { + console.log(TAG + " result = " + JSON.stringify(data)); + expect(data[0].processName).assertEqual("com.example.stageappcontexttest"); + }) + done(); + }); }) } \ No newline at end of file