未验证 提交 07959b42 编写于 作者: O openharmony_ci 提交者: Gitee

!8460 【元能力】CallTest 适配d.ts

Merge pull request !8460 from HuangXW/CallTest
......@@ -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.
先完成此消息的编辑!
想要评论请 注册