From ba16019c6260b64a43bf6da52717c177813fdcf4 Mon Sep 17 00:00:00 2001 From: lihao Date: Wed, 31 Aug 2022 09:13:57 +0800 Subject: [PATCH] add new case Signed-off-by: lihao --- .../src/main/config.json | 4 +++ .../src/main/js/test/CallManagerTest.test.js | 4 +-- .../PdpProfileDataStorageFunction.test.js | 26 +++++++++---------- 3 files changed, 19 insertions(+), 15 deletions(-) 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 51e031a98..778323549 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 @@ -108,6 +108,10 @@ { "name":"ohos.permission.INTERNET", "reason":"need use ohos.permission.INTERNET" + }, + { + "name":"ohos.permission.GRANT_SENSITIVE_PERMISSIONS", + "reason":"need use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" } ], "js": [ diff --git a/telephony/telephonyjstest/telephony_base/call_manager/src/main/js/test/CallManagerTest.test.js b/telephony/telephonyjstest/telephony_base/call_manager/src/main/js/test/CallManagerTest.test.js index c837c4d2c..51c7119e5 100644 --- a/telephony/telephonyjstest/telephony_base/call_manager/src/main/js/test/CallManagerTest.test.js +++ b/telephony/telephonyjstest/telephony_base/call_manager/src/main/js/test/CallManagerTest.test.js @@ -12,13 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import net_connection from '@ohos.net.connection'; +import netConnection from '@ohos.net.connection'; import call from '@ohos.telephony.call'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; export default function ActsBaseCallManagerTest() { - let net = net_connection.createNetConnection() + let net = netConnection.createNetConnection() class RejectMessageOptions { constructor(str) { diff --git a/telephony/telephonyjstest/telephony_base/cellular_data/src/main/js/test/PdpProfileDataStorageFunction.test.js b/telephony/telephonyjstest/telephony_base/cellular_data/src/main/js/test/PdpProfileDataStorageFunction.test.js index b5a1de9a0..09e9af85f 100644 --- a/telephony/telephonyjstest/telephony_base/cellular_data/src/main/js/test/PdpProfileDataStorageFunction.test.js +++ b/telephony/telephonyjstest/telephony_base/cellular_data/src/main/js/test/PdpProfileDataStorageFunction.test.js @@ -37,7 +37,7 @@ export default function ActsBaseCellularDataTest() { beforeAll(function () { let stringValue = { - profile_name: "test_profile_name", + profile_Name: "test_profile_name", mcc: "460", mnc: "91" }; @@ -47,7 +47,7 @@ export default function ActsBaseCellularDataTest() { }).catch(error => { expect().assertFail(); console.log("Telephony_DataStorage_beforeAll failed"); - return; + done(); }); }) @@ -63,7 +63,7 @@ export default function ActsBaseCellularDataTest() { }).catch(error => { expect().assertFail(); console.log("Telephony_DataStorage_PdpProfile_afterAll failed"); - return; + done(); }); }) @@ -74,7 +74,7 @@ export default function ActsBaseCellularDataTest() { */ it("Telephony_DataStorage_PdpProfile_Insert_Async_0100", 0, async function (done) { let stringValue = { - profile_name: "test_profile_name", + profile_Name: "test_profile_name", mcc: "460", mnc: "91" }; @@ -86,7 +86,6 @@ export default function ActsBaseCellularDataTest() { expect().assertFail(); console.log("Telephony_DataStorage_InsetIntoPdpProfile_Async_0100 failed"); done(); - return; }); }) @@ -105,22 +104,23 @@ export default function ActsBaseCellularDataTest() { condition.equalTo("profile_name", "test_profile_name"); dataAbilityHelper.query(pdpProfileFullUri, resultColumns, condition).then(resultSet => { let pdpProfiles = []; - console.log("Telephony_DataStorage_PdpProfile_Query_Async_0100 resultSet: " + JSON.stringify(resultSet)); + console.log("Telephony_DataStorage_PdpProfile_Query_Async_0100 resultSet: " + + JSON.stringify(resultSet)); while (resultSet.goToNextRow()) { let pdpProfile = {}; - pdpProfile.profile_name = resultSet.getString(0); + pdpProfile.profile_Name = resultSet.getString(0); pdpProfile.mcc = resultSet.getString(1); pdpProfile.mnc = resultSet.getString(2); pdpProfiles.push(pdpProfile); } - console.log("Telephony_DataStorage_PdpProfile_Query_Async_0100 pdpProfiles: " + JSON.stringify(pdpProfiles)); + console.log("Telephony_DataStorage_PdpProfile_Query_Async_0100 pdpProfiles: " + + JSON.stringify(pdpProfiles)); expect(pdpProfiles.length >= 1).assertTrue(); done(); }).catch(error => { expect().assertFail(); console.log("Telephony_DataStorage_PdpProfile_Query_Async_0100 failed"); done(); - return; }); }) @@ -137,14 +137,14 @@ export default function ActsBaseCellularDataTest() { 'mnc': "92", }; dataAbilityHelper.update(pdpProfileFullUri, stringValue, condition).then(data => { - console.log("Telephony_DataStorage_PdpProfile_Update_Async_0100: update success data: " + JSON.stringify(data)); + console.log("Telephony_DataStorage_PdpProfile_Update_Async_0100: update success data: " + + JSON.stringify(data)); expect(data === 0).assertTrue(); done(); }).catch(error => { expect().assertFail(); console.log("Telephony_DataStorage_PdpProfile_Update_Async_0100 failed"); done(); - return; }); }) @@ -157,14 +157,14 @@ export default function ActsBaseCellularDataTest() { var condition = new ohosDataAbility.DataAbilityPredicates(); condition.equalTo("profile_name", "test_profile_name"); dataAbilityHelper.delete(pdpProfileFullUri, condition).then(data => { - console.log("Telephony_DataStorage_PdpProfile_Delete_Async_0100: delete success data: " + JSON.stringify(data)); + console.log("Telephony_DataStorage_PdpProfile_Delete_Async_0100: delete success data: " + + JSON.stringify(data)); expect(data === 0).assertTrue(); done(); }).catch(error => { expect().assertFail(); console.log("Telephony_DataStorage_PdpProfile_Update_Async_0100 failed"); done(); - return; }); }) }) -- GitLab