From e7c956bbc30a9fd6a8af91e2f6081f818776b035 Mon Sep 17 00:00:00 2001 From: xuchenghua09 Date: Fri, 15 Jul 2022 18:14:59 +0800 Subject: [PATCH] fix Signed-off-by: xuchenghua09 --- .../entry/src/main/ets/test/Ability.test.ets | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets index bc0f7cc06..f77bfa4f0 100644 --- a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets @@ -298,33 +298,16 @@ export default function abilityTest(abilityContext) { it('ACTS_CommonComponent_Call_1500', 0, async function (done) { console.log('ACTS_CommonComponent_Call_1500 begin'); var caller; - - function releaseCallback(data) { - expect(data).assertEqual('release'); - console.log('ACTS_CommonComponent_Call_1500 releaseCallBack' + data); + try{ + caller = await globalThis.abilityContext.startAbilityByCall({ + bundleName: systemAppCalleeABundleName, + abilityName: systemAppCalleeAMainAbilityName, + }); + }catch(error){ + console.log('ACTS_CommonComponent_Call_1500 start err'+error); + expect(error=="Error: function request remote error").assertTrue(); done(); } - - caller = await globalThis.abilityContext.startAbilityByCall({ - bundleName: systemAppCalleeABundleName, - abilityName: systemAppCalleeAMainAbilityName, - }); - - caller.onRelease(releaseCallback); - let param = new MySequenceable(1500, "ACTS_CommonComponent_Call_1500", 'default'); - caller.callWithResult('testCallWithResult', param).then((data) => { - console.log('ACTS_CommonComponent_Call_1500 call success'); - var result = new MySequenceable(0, '', ''); - data.readSequenceable(result); - expect(result.num).assertEqual(1500); - expect(result.str).assertEqual('ACTS_CommonComponent_Call_1500'); - expect(result.result).assertEqual('ACTS_CommonComponent_Call_1500processed'); - caller.release(); - }).catch(err => { - console.log('ACTS_CommonComponent_Call_1500 call exception' + err); - expect().assertFail(); - caller.release(); - }) }) /** -- GitLab