diff --git a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets index 2303c1beea4f3e05f737384db6cdcb4186953eb7..0e03bc48c939ecc2a4da756019d7a2058f73b68f 100644 --- a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets @@ -1003,40 +1003,6 @@ export default function abilityTest() { done(); }) - /** - * @tc.number: ACTS_CommonComponent_Call_5500 - * @tc.name: The callee exits abnormally after the caller requests the call to be called successfully. - * @tc.desc: Verify that the caller can register the server's death listener. - */ - it('ACTS_CommonComponent_Call_5500', 0, async function (done) { - console.log('ACTS_CommonComponent_Call_5500 begin'); - - function releaseCallback(data) { - console.log('ACTS_CommonComponent_Call_5500 releaseCallBack:' + data); - expect(data).assertEqual("died"); - done(); - } - - let bundleNameCallee = "com.example.systemappcalleea"; - let abilityNameCallee = "com.example.systemappcalleea.MainAbility"; - let want = { - bundleName: bundleNameCallee, - abilityName: abilityNameCallee, - } - let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want); - if (typeof caller !== "object" || caller == null) { - console.log('ACTS_CommonComponent_Call_5500 startAbilityByCall fail'); - expect().assertFail(); - } - try { - caller.on('release', releaseCallback); - } catch (e) { - console.log('ACTS_CommonComponent_Call_5500 Caller onRelease fail ' + e); - expect().assertFail(); - } - await appManager.killProcessesByBundleName(bundleNameCallee); - }) - /** * @tc.number: ACTS_CommonComponent_Call_5600 * @tc.name: The callee exits abnormally after the caller requests the call to be called successfully. @@ -1069,7 +1035,6 @@ export default function abilityTest() { expect().assertFail(); done(); } - await appManager.killProcessesByBundleName(bundleNameCallee); done(); }) @@ -1097,6 +1062,7 @@ export default function abilityTest() { if (typeof caller !== "object" || caller == null) { console.log('ACTS_CommonComponent_Call_5700 startAbilityByCall fail'); expect().assertFail(); + done(); } let flag = false; try { @@ -1104,10 +1070,8 @@ export default function abilityTest() { } catch (e) { console.log('ACTS_CommonComponent_Call_5700 Caller onRelease fail ' + e); flag = true; + done(); } - await appManager.killProcessesByBundleName(bundleNameCallee); - expect(flag).assertEqual(true); - done(); }) /** @@ -1134,17 +1098,15 @@ export default function abilityTest() { if (typeof caller !== "object" || caller == null) { console.log('ACTS_CommonComponent_Call_5800 startAbilityByCall fail'); expect().assertFail(); + done(); } let flag = false; try { caller.off('Not release', releaseCallback); } catch (e) { console.log('ACTS_CommonComponent_Call_5800 Caller onRelease fail ' + e); - flag = true; + done(); } - await appManager.killProcessesByBundleName(bundleNameCallee); - expect(flag).assertEqual(true); - done(); }) /** @@ -1155,8 +1117,37 @@ export default function abilityTest() { it('ACTS_CommonComponent_Call_5900', 0, async function (done) { console.log('ACTS_CommonComponent_Call_5900 begin'); + let bundleNameCallee = "com.example.systemappcalleea"; + let abilityNameCallee = "com.example.systemappcalleea.MainAbility"; + let want = { + bundleName: bundleNameCallee, + abilityName: abilityNameCallee, + } + let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want); + if (typeof caller !== "object" || caller == null) { + console.log('ACTS_CommonComponent_Call_5900 startAbilityByCall fail'); + expect().assertFail(); + done(); + } + let flag = false; + try { + caller.off('Not release'); + } catch (e) { + console.log('ACTS_CommonComponent_Call_5900 Caller onRelease fail ' + e); + done(); + } + }) + + /** + * @tc.number: ACTS_CommonComponent_Call_5500 + * @tc.name: The callee exits abnormally after the caller requests the call to be called successfully. + * @tc.desc: Verify that the caller can register the server's death listener. + */ + it('ACTS_CommonComponent_Call_5500', 0, async function (done) { + console.log('ACTS_CommonComponent_Call_5500 begin'); + function releaseCallback(data) { - console.log('ACTS_CommonComponent_Call_5900 releaseCallBack:' + data); + console.log('ACTS_CommonComponent_Call_5500 releaseCallBack:' + data); expect(data).assertEqual("died"); done(); } @@ -1169,19 +1160,17 @@ export default function abilityTest() { } let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want); if (typeof caller !== "object" || caller == null) { - console.log('ACTS_CommonComponent_Call_5900 startAbilityByCall fail'); + console.log('ACTS_CommonComponent_Call_5500 startAbilityByCall fail'); expect().assertFail(); } - let flag = false; try { - caller.off('Not release'); + caller.on('release', releaseCallback); } catch (e) { - console.log('ACTS_CommonComponent_Call_5900 Caller onRelease fail ' + e); - flag = true; + console.log('ACTS_CommonComponent_Call_5500 Caller onRelease fail ' + e); + expect().assertFail(); + done(); } await appManager.killProcessesByBundleName(bundleNameCallee); - expect(flag).assertEqual(true); - done(); }) }) } \ No newline at end of file