diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/signature/openharmony_sx.p7b b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/signature/openharmony_sx.p7b index 4169f099138777295cd378d316440c00e510f82d..f8e876505a6a7905c884f6830e9bb0c7b235c7b9 100644 Binary files a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/signature/openharmony_sx.p7b and b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/signature/openharmony_sx.p7b differ diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/config.json b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/config.json index 8a56d8878b92c420f3654643dd41aacbf0d1ad4b..3655be0649c803ab00800991c72b85e628603c41 100644 --- a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/config.json +++ b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/config.json @@ -74,6 +74,10 @@ { "name":"ohos.permission.READ_CONTACTS", "reason":"need use ohos.permission.READ_CONTACTS" + }, + { + "name":"ohos.permission.PLACE_CALL", + "reason":"need use ohos.permission.PLACE_CALL" } ], "js": [ diff --git a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/CallManageAll.test.js b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/CallManageAll.test.js index 188c84df99864e24de7b2d08afa1e0e15c969cb6..ddb7b821cf8c3a31d81d634701090a02bc62f2c1 100644 --- a/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/CallManageAll.test.js +++ b/telephony/telephonyjstest/call_manager/call_manager_ims2_call/src/main/js/test/CallManageAll.test.js @@ -1,5 +1,5 @@ /** - * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -22,7 +22,7 @@ const DIAL_TYPE_OTT = 2; const MEDIA_TYPE_VOICE = 0; const TEL_CONFERENCE_IDLE = 0; const ERR_SLOT_ID = -1; - +const CALL_NUMBER = '10086'; class EmergencyNumberOptions { slotId; @@ -368,5 +368,73 @@ export default function CallManageImsCall() { done(); } }); + + /** + * @tc.number Telephony_CallManager_Dial_Async_0100 + * @tc.name testDial—0100 + * @tc.desc PhoneNumber: 10086, no options. Call dial api by callback. + * The return value is true + */ + it('Telephony_CallManager_Dial_Async_0100', 0, async function (done) { + let CaseName = 'Telephony_CallManager_Dial_Async_0100'; + try { + call.dial(CALL_NUMBER, (err, data) => { + console.info(CaseName + " case success" + JSON.stringify(data)); + expect(data == true).assertTrue(); + done(); + return; + }); + } catch (err) { + console.info(CaseName + ' case error' + JSON.stringify(err)); + expect().assertFail(); + done(); + } + }); + + /** + * @tc.number Telephony_CallManager_Dial_Async_0200 + * @tc.name testDial—0200 + * @tc.desc PhoneNumber: 10086, has options. Call dial api by callback. + * The return value is true + */ + it('Telephony_CallManager_Dial_Async_0200', 0, async function (done) { + let CaseName = 'Telephony_CallManager_Dial_Async_0200'; + try { + call.dial(CALL_NUMBER, { + extras: false + }, (err, data) => { + console.info(CaseName + " case success" + JSON.stringify(data)); + expect(data == true).assertTrue(); + done(); + return; + }); + } catch (err) { + console.info(CaseName + ' case error' + JSON.stringify(err)); + expect().assertFail(); + done(); + } + }); + + /** + * @tc.number Telephony_CallManager_Dial_Promise_0100 + * @tc.name testIsEmergencyPhoneNumber_1400 + * @tc.desc PhoneNumber: 10086, has options. Call dila api by permise + * The return value is true + */ + it('Telephony_CallManager_Dial_Promise_0100', 0, async function (done) { + let CaseName = 'Telephony_CallManager_Dial_Promise_0100'; + call.dial(CALL_NUMBER, { + extras: false + }).then((data) => { + console.info(CaseName + " case success" + JSON.stringify(data)); + expect(data == true).assertTrue(); + done(); + return; + }).catch((err) => { + console.info(CaseName + ' case error' + JSON.stringify(err)); + expect().assertFail(); + done(); + }); + }); }); } \ No newline at end of file