提交 101afa72 编写于 作者: H HuangXW

fixed 39a9de7c from https://gitee.com/H-xinwei/xts_acts/pulls/8460

CallTest modify
Signed-off-by: NHuangXW <huangxinwei4@huawei.com>
Change-Id: I6c70d9cb93f7dbc8a2a41dbb2760731809827ea7
上级 9387c62b
......@@ -927,12 +927,6 @@ export default function abilityTest() {
it('ACTS_CommonComponent_Call_5700', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5700 begin');
function releaseCallback(data) {
console.log('ACTS_CommonComponent_Call_5700 releaseCallBack:' + data);
expect(data).assertEqual("died");
done();
}
let bundleNameCallee = "com.example.systemappcalleea";
let abilityNameCallee = "com.example.systemappcalleea.MainAbility";
let want = {
......@@ -945,12 +939,11 @@ export default function abilityTest() {
expect().assertFail();
done();
}
let flag = false;
let releaseCallback = "NotFunction";
try {
caller.off('release');
caller.off('release', releaseCallback);
} catch (e) {
console.log('ACTS_CommonComponent_Call_5700 Caller onRelease fail ' + e);
flag = true;
done();
}
})
......@@ -1018,5 +1011,35 @@ export default function abilityTest() {
done();
}
})
/**
* @tc.number: ACTS_CommonComponent_Call_6000
* @tc.name: The callee exits abnormally after the caller requests the call to be called successfully.
* @tc.desc: Verify that the caller can unregister the server's death listener.
*/
it('ACTS_CommonComponent_Call_6000', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_6000 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_6000 startAbilityByCall fail');
expect().assertFail();
done();
}
try {
caller.off('release');
done();
} catch (e) {
console.log('ACTS_CommonComponent_Call_6000 Caller onRelease fail ' + e);
expect().assertFail();
done();
}
})
})
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册