未验证 提交 0d9f482e 编写于 作者: O openharmony_ci 提交者: Gitee

!6837 电话用例整改.p7b

Merge pull request !6837 from zhangfuzhi/monthly_20221018
...@@ -15,6 +15,15 @@ ...@@ -15,6 +15,15 @@
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"power-shell wakeup",
"power-shell setmode 602",
"uinput -T -m 200 1000 200 200 200",
"param set persist.ace.testmode.enabled 1"
]
} }
] ]
} }
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -67,53 +67,13 @@ ...@@ -67,53 +67,13 @@
} }
], ],
"reqPermissions": [ "reqPermissions": [
{
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{ {
"name":"ohos.permission.WRITE_CONTACTS", "name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS" "reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO"
},
{
"name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET"
}, },
{ {
"name":"ohos.permission.GRANT_SENSITIVE_PERMISSIONS", "name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" "reason":"need use ohos.permission.READ_CONTACTS"
} }
], ],
"js": [ "js": [
......
...@@ -19,74 +19,27 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from ...@@ -19,74 +19,27 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import { import {
AUTO_ACCEPT_NUMBER, AUTO_ACCEPT_NUMBER,
AUTO_ACCEPT_NUMBER2,
PHONE_NUMBER_LENGTH_11,
CALL_STATUS_DIALING, CALL_STATUS_DIALING,
CALL_ID_NOT_EXIST,
CALL_STATE_UNKNOWN, CALL_STATE_UNKNOWN,
CALL_STATE_IDLE, CALL_STATE_IDLE,
DEFAULT_SLOT_ID, DEFAULT_SLOT_ID,
CALL_MODE_IMS,
SLOT_ID_INVALID,
PHONE_LIST2,
RTT_MSG,
CALL_MODE_SEND_RECEIVE,
POS_700,
POS_10,
POS_LENGTH_300,
POS_LENGTH_600,
DEVICE_EARPIECE,
BOUNDARY_NUMBER_INT,
SENT_STRING_C,
MINUS_VALUE,
PHONE_NUMBER_LONG,
NULL_PHONE_NUMBER,
DIAL_CARRIER_TYPE,
DIAL_SCENCE_CALL_PRIVILEGED,
MEDIA_TYPE_VOICE, MEDIA_TYPE_VOICE,
ROTATION_MINUS_1,
IMAGE_LOCAL_ERROR_PATH,
POS_Z_ERROR,
RESTRICTION_TYPE_ROAMING_INCOMING,
RESTRICTION_MODE_ACTIVATION,
RIGHT_PASSWORD,
RESTRICTION_TYPE_ALL_INCOMING,
TRANSFER_TYPE_NOT_REACHABLE,
TRANSFER_TYPE_UNCONDITIONAL,
PHONE_NUMBER_AREA_LAND,
CALL_TRANSFER_DISABLE,
TRANSFER_TYPE_NO_REPLY,
COMMAND_CALL_ERROR4,
COMMAND_CALL_ERROR,
CARMER_ID_NOT_EXIT,
ZOOM_RATIO_MINUS_1_0,
DIAL_SCENCE_CALL_NORMAL,
DIAL_TYPE_OTT, DIAL_TYPE_OTT,
EVENT_OTT_FUNCTION_UNSUPPORTED,
TEL_CONFERENCE_IDLE TEL_CONFERENCE_IDLE
} from './lib/Const.js'; } from './lib/Const.js';
import {toString} from './lib/ApiToPromise.js'; import {toString} from './lib/ApiToPromise.js';
import { import {
scenceInCalling,
hangupCall2,
hangupCall, hangupCall,
callDetailsChangeOn,
callId as gloabCallId, callId as gloabCallId,
reachState, callDetailsChangeOff
callDetailsChangeOff,
reachCallEventState
} from './lib/ScenceInCalling.js'; } from './lib/ScenceInCalling.js';
const GETMAIN_CALLID_ERRO = -1;
const REJECT_MESSAGE_STR = 'Hi,hello?';
const REJECT_MESSAGE_NUM = 1234567890123456789012345678901234567890;
const ERR_SLOT_ID = -1;
const SLOTID = 0;
const THE_THREE_NUMBER = '112';
const DIAL_TYPE_ERR_CALL = 3;
const TIME_OUT = 20000;
const WAITING_TIME = 200;
const ERR_SLOT_ID = -1;
var callState = -1;
var timing = 0;
var endTime = 0;
let callId = null; let callId = null;
class RejectMessageOptions { class RejectMessageOptions {
constructor (str) { constructor (str) {
this.messageContent = str; this.messageContent = str;
...@@ -126,9 +79,7 @@ const sleep = (time) => { ...@@ -126,9 +79,7 @@ const sleep = (time) => {
}); });
}; };
var callState = -1;
var timing = 0;
var endTime = 0;
export default function CallManageImsCall() { export default function CallManageImsCall() {
describe('CallManageImsCall', function () { describe('CallManageImsCall', function () {
......
...@@ -16,6 +16,6 @@ import CallManageImsCall from './CallManageAll.test.js' ...@@ -16,6 +16,6 @@ import CallManageImsCall from './CallManageAll.test.js'
import ObjectInterfaceTest from './ObjectInterface_test.js' import ObjectInterfaceTest from './ObjectInterface_test.js'
export default function testsuite() { export default function testsuite() {
CallManageImsCall() ObjectInterfaceTest();
ObjectInterfaceTest() CallManageImsCall();
} }
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -15,25 +15,46 @@ ...@@ -15,25 +15,46 @@
import contactsapi from "@ohos.contact"; import contactsapi from "@ohos.contact";
import sms from '@ohos.telephony.sms'; import sms from '@ohos.telephony.sms';
import bundle from '@ohos.bundle' import featureAbility from "@ohos.ability.featureAbility";
import abilityAccessCtrl from '@ohos.abilityAccessCtrl' import {afterAll, afterEach, beforeAll, describe, expect, it} from '@ohos/hypium';
import account from '@ohos.account.osAccount'; import {UiComponent,UiDriver,Component,Driver,UiWindow,ON,BY} from '@ohos.uitest'
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium'
export default function ObjectInterfaceTest() { export default function ObjectInterfaceTest() {
describe('ObjectInterfaceTest', function () { describe('ObjectInterfaceTest', function () {
function sleep(numberMillis) { function sleep(numberMillis) {
var now = new Date(); var now = new Date();
var exitTime = now.getTime() + numberMillis; var exitTime = now.getTime() + numberMillis;
while (true) { while (true) {
now = new Date(); now = new Date();
if (now.getTime() > exitTime) if (now.getTime() > exitTime);
return; return;
} }
} }
async function driveFn() {
console.info("come in driveFn");
let driver = await UiDriver.create();
console.info("driver is " + JSON.stringify(driver));
sleep(2000);
let button = await driver.findComponent(BY.text('允许'));
console.info("button is " + JSON.stringify(button));
await button.click();
sleep(5000);
}
beforeAll(async function () {
var permissions = ["ohos.permission.WRITE_CONTACTS","ohos.permission.READ_CONTACTS"];
featureAbility.getContext().requestPermissionsFromUser(permissions, 0, () => {
console.info("start requestPermissionsFromUser");
});
for(let i=0; i<2; i++){
await driveFn();
console.log("get user_grant permission");
}
});
var contactData = { var contactData = {
id: 0, id: 0,
key: "0", key: "0",
...@@ -323,11 +344,6 @@ export default function ObjectInterfaceTest() { ...@@ -323,11 +344,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_insert_test_100", 0, async function (done) { it("contactsApi_insert_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
try { try {
var rawContactId = await contactsapi.addContact(contactData); var rawContactId = await contactsapi.addContact(contactData);
console.info("contactsApi_insert_test_100 : rawContactId = " + rawContactId); console.info("contactsApi_insert_test_100 : rawContactId = " + rawContactId);
...@@ -338,7 +354,7 @@ export default function ObjectInterfaceTest() { ...@@ -338,7 +354,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_insert_test_100 : raw_contact insert error = " + error); console.info("contactsApi_insert_test_100 : raw_contact insert error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -347,11 +363,6 @@ export default function ObjectInterfaceTest() { ...@@ -347,11 +363,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_delete_test_200", 0, async function (done) { it("contactsApi_delete_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var deleteId = gRawContactId; var deleteId = gRawContactId;
try { try {
var deleteCode = await contactsapi.deleteContact(deleteId); var deleteCode = await contactsapi.deleteContact(deleteId);
...@@ -363,7 +374,7 @@ export default function ObjectInterfaceTest() { ...@@ -363,7 +374,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_delete_test_200 : delete error = " + error); console.info("contactsApi_delete_test_200 : delete error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -372,11 +383,6 @@ export default function ObjectInterfaceTest() { ...@@ -372,11 +383,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_update_test_300", 0, async function (done) { it("contactsApi_update_test_300", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var rawContactId = await contactsapi.addContact(contactData); var rawContactId = await contactsapi.addContact(contactData);
console.info("contactsApi_insert_test_300 : rawContactId = " + rawContactId); console.info("contactsApi_insert_test_300 : rawContactId = " + rawContactId);
gRawContactId = rawContactId; gRawContactId = rawContactId;
...@@ -399,7 +405,7 @@ export default function ObjectInterfaceTest() { ...@@ -399,7 +405,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_update_test_300 : update error = " + error); console.info("contactsApi_update_test_300 : update error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -408,22 +414,21 @@ export default function ObjectInterfaceTest() { ...@@ -408,22 +414,21 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_contact_test_400", 0, async function (done) { it("contactsApi_query_contact_test_400", 0, async function (done) {
checkContactPermission(); var queryId = await contactsapi.addContact(contactData);
if (!contactPermission) { console.info("contactsApi_query_contact_test_400 : queryId = " + queryId);
done(); expect(queryId > 0).assertTrue();
return;
}
var queryId = gRawContactId;
try { try {
var resultSet = await contactsapi.queryContact(queryId); var resultSet = await contactsapi.queryContact(queryId);
console.info("contactsApi_query_contact_test_400 : query resultSet = " + JSON.stringify(resultSet)); console.info("contactsApi_query_contact_test_400 : query resultSet = " + JSON.stringify(resultSet));
expect(resultSet == undefined).assertTrue(); expect(resultSet != null).assertTrue();
done(); done();
} catch (error) { } catch (error) {
console.info("contactsApi_query_contact_test_400 query error = " + error); console.info("contactsApi_query_contact_test_400 query error = " + error);
expect().assertFalse();
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -432,11 +437,6 @@ export default function ObjectInterfaceTest() { ...@@ -432,11 +437,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_contact_test_500", 0, async function (done) { it("contactsApi_query_contact_test_500", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var queryId = gRawContactId; var queryId = gRawContactId;
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
...@@ -454,7 +454,7 @@ export default function ObjectInterfaceTest() { ...@@ -454,7 +454,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_contact_test_500 query error = " + error); console.info("contactsApi_query_contact_test_500 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -463,11 +463,6 @@ export default function ObjectInterfaceTest() { ...@@ -463,11 +463,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_contact_test_600", 0, async function (done) { it("contactsApi_query_contact_test_600", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var queryId = gRawContactId; var queryId = gRawContactId;
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
...@@ -485,7 +480,7 @@ export default function ObjectInterfaceTest() { ...@@ -485,7 +480,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_contact_test_600 query error = " + error); console.info("contactsApi_query_contact_test_600 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -494,11 +489,6 @@ export default function ObjectInterfaceTest() { ...@@ -494,11 +489,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_contacts_test_700", 0, async function (done) { it("contactsApi_query_contacts_test_700", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
try { try {
var resultSet = await contactsapi.queryContacts(); var resultSet = await contactsapi.queryContacts();
console.info("contactsApi_query_contacts_test_700 : query resultSet = " + JSON.stringify(resultSet)); console.info("contactsApi_query_contacts_test_700 : query resultSet = " + JSON.stringify(resultSet));
...@@ -508,7 +498,7 @@ export default function ObjectInterfaceTest() { ...@@ -508,7 +498,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_contacts_test_700 query error = " + error); console.info("contactsApi_query_contacts_test_700 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -517,11 +507,6 @@ export default function ObjectInterfaceTest() { ...@@ -517,11 +507,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_contacts_test_800", 0, async function (done) { it("contactsApi_query_contacts_test_800", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
} }
...@@ -534,7 +519,7 @@ export default function ObjectInterfaceTest() { ...@@ -534,7 +519,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_contacts_test_800 query error = " + error); console.info("contactsApi_query_contacts_test_800 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -543,11 +528,6 @@ export default function ObjectInterfaceTest() { ...@@ -543,11 +528,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_contacts_test_900", 0, async function (done) { it("contactsApi_query_contacts_test_900", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var ContactAttributes = { var ContactAttributes = {
attributes: [1, 5, 6] attributes: [1, 5, 6]
} }
...@@ -560,7 +540,7 @@ export default function ObjectInterfaceTest() { ...@@ -560,7 +540,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_contacts_test_900 query error = " + error); console.info("contactsApi_query_contacts_test_900 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -569,11 +549,6 @@ export default function ObjectInterfaceTest() { ...@@ -569,11 +549,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_contacts_test_1000", 0, async function (done) { it("contactsApi_query_contacts_test_1000", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
}; };
...@@ -589,7 +564,7 @@ export default function ObjectInterfaceTest() { ...@@ -589,7 +564,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_contacts_test_1000 query error = " + error); console.info("contactsApi_query_contacts_test_1000 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -598,11 +573,6 @@ export default function ObjectInterfaceTest() { ...@@ -598,11 +573,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_email_test_1100", 0, async function (done) { it("contactsApi_query_email_test_1100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var email = "email"; var email = "email";
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
...@@ -616,7 +586,7 @@ export default function ObjectInterfaceTest() { ...@@ -616,7 +586,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_email_test_1100 query error = " + error); console.info("contactsApi_query_email_test_1100 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -625,11 +595,6 @@ export default function ObjectInterfaceTest() { ...@@ -625,11 +595,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_email_test_1200", 0, async function (done) { it("contactsApi_query_email_test_1200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var email = "email"; var email = "email";
try { try {
var resultSet = await contactsapi.queryContactsByEmail(email); var resultSet = await contactsapi.queryContactsByEmail(email);
...@@ -640,7 +605,7 @@ export default function ObjectInterfaceTest() { ...@@ -640,7 +605,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_email_test_1200 query error = " + error); console.info("contactsApi_query_email_test_1200 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -649,11 +614,6 @@ export default function ObjectInterfaceTest() { ...@@ -649,11 +614,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_email_test_1300", 0, async function (done) { it("contactsApi_query_email_test_1300", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var email = "email"; var email = "email";
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
...@@ -670,7 +630,7 @@ export default function ObjectInterfaceTest() { ...@@ -670,7 +630,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_email_test_1300 query error = " + error); console.info("contactsApi_query_email_test_1300 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -679,11 +639,6 @@ export default function ObjectInterfaceTest() { ...@@ -679,11 +639,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_email_test_1400", 0, async function (done) { it("contactsApi_query_email_test_1400", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var email = "email"; var email = "email";
var ContactAttributes = { var ContactAttributes = {
attributes: [1, 5, 6] attributes: [1, 5, 6]
...@@ -697,7 +652,7 @@ export default function ObjectInterfaceTest() { ...@@ -697,7 +652,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_email_test_1400 query error = " + error); console.info("contactsApi_query_email_test_1400 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -706,11 +661,6 @@ export default function ObjectInterfaceTest() { ...@@ -706,11 +661,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_phoneNumber_test_1500", 0, async function (done) { it("contactsApi_query_phoneNumber_test_1500", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var phoneNumber = "183"; var phoneNumber = "183";
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
...@@ -724,7 +674,7 @@ export default function ObjectInterfaceTest() { ...@@ -724,7 +674,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_phoneNumber_test_1500 query error = " + error); console.info("contactsApi_query_phoneNumber_test_1500 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -733,11 +683,6 @@ export default function ObjectInterfaceTest() { ...@@ -733,11 +683,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_phoneNumber_test_1600", 0, async function (done) { it("contactsApi_query_phoneNumber_test_1600", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var phoneNumber = "183"; var phoneNumber = "183";
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
...@@ -754,7 +699,7 @@ export default function ObjectInterfaceTest() { ...@@ -754,7 +699,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_phoneNumber_test_1600 query error = " + error); console.info("contactsApi_query_phoneNumber_test_1600 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -763,11 +708,6 @@ export default function ObjectInterfaceTest() { ...@@ -763,11 +708,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_phoneNumber_test_1700", 0, async function (done) { it("contactsApi_query_phoneNumber_test_1700", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var phoneNumber = "183"; var phoneNumber = "183";
try { try {
var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber); var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber);
...@@ -778,7 +718,7 @@ export default function ObjectInterfaceTest() { ...@@ -778,7 +718,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_phoneNumber_test_1700 query error = " + error); console.info("contactsApi_query_phoneNumber_test_1700 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -787,11 +727,6 @@ export default function ObjectInterfaceTest() { ...@@ -787,11 +727,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_phoneNumber_test_1800", 0, async function (done) { it("contactsApi_query_phoneNumber_test_1800", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var phoneNumber = "183"; var phoneNumber = "183";
var ContactAttributes = { var ContactAttributes = {
attributes: [1, 5, 6] attributes: [1, 5, 6]
...@@ -805,7 +740,7 @@ export default function ObjectInterfaceTest() { ...@@ -805,7 +740,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_phoneNumber_test_1800 query error = " + error); console.info("contactsApi_query_phoneNumber_test_1800 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -814,11 +749,6 @@ export default function ObjectInterfaceTest() { ...@@ -814,11 +749,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_group_test_1900", 0, async function (done) { it("contactsApi_query_group_test_1900", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
try { try {
var resultSet = await contactsapi.queryGroups(); var resultSet = await contactsapi.queryGroups();
console.info("contactsApi_query_group_test_1900 : query resultSet = " + JSON.stringify(resultSet)); console.info("contactsApi_query_group_test_1900 : query resultSet = " + JSON.stringify(resultSet));
...@@ -828,7 +758,7 @@ export default function ObjectInterfaceTest() { ...@@ -828,7 +758,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_group_test_1900 query error = " + error); console.info("contactsApi_query_group_test_1900 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -837,11 +767,6 @@ export default function ObjectInterfaceTest() { ...@@ -837,11 +767,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_group_test_2000", 0, async function (done) { it("contactsApi_query_group_test_2000", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
} }
...@@ -854,7 +779,7 @@ export default function ObjectInterfaceTest() { ...@@ -854,7 +779,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_group_test_2000 query error = " + error); console.info("contactsApi_query_group_test_2000 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -863,11 +788,6 @@ export default function ObjectInterfaceTest() { ...@@ -863,11 +788,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_holders_test_2200", 0, async function (done) { it("contactsApi_query_holders_test_2200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
try { try {
var resultSet = await contactsapi.queryHolders(); var resultSet = await contactsapi.queryHolders();
console.info("contactsApi_query_holders_test_2200 : query resultSet = " + JSON.stringify(resultSet)); console.info("contactsApi_query_holders_test_2200 : query resultSet = " + JSON.stringify(resultSet));
...@@ -877,7 +797,7 @@ export default function ObjectInterfaceTest() { ...@@ -877,7 +797,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_holders_test_2200 query error = " + error); console.info("contactsApi_query_holders_test_2200 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -886,11 +806,6 @@ export default function ObjectInterfaceTest() { ...@@ -886,11 +806,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_key_test_2300", 0, async function (done) { it("contactsApi_query_key_test_2300", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var idtest = gRawContactId; var idtest = gRawContactId;
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
...@@ -904,7 +819,7 @@ export default function ObjectInterfaceTest() { ...@@ -904,7 +819,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_key_test_2300 query error = " + error); console.info("contactsApi_query_key_test_2300 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -913,11 +828,6 @@ export default function ObjectInterfaceTest() { ...@@ -913,11 +828,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_key_test_2400", 0, async function (done) { it("contactsApi_query_key_test_2400", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var idtest = gRawContactId; var idtest = gRawContactId;
console.info("contactsApi_query_key_test_2400 : query gRawContactId = " + idtest); console.info("contactsApi_query_key_test_2400 : query gRawContactId = " + idtest);
try { try {
...@@ -929,7 +839,7 @@ export default function ObjectInterfaceTest() { ...@@ -929,7 +839,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_key_test_2400 query error = " + error); console.info("contactsApi_query_key_test_2400 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -938,11 +848,6 @@ export default function ObjectInterfaceTest() { ...@@ -938,11 +848,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_query_mycard_test_2500", 0, async function (done) { it("contactsApi_query_mycard_test_2500", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
} }
...@@ -955,7 +860,7 @@ export default function ObjectInterfaceTest() { ...@@ -955,7 +860,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_mycard_test_2500 query error = " + error); console.info("contactsApi_query_mycard_test_2500 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -964,11 +869,6 @@ export default function ObjectInterfaceTest() { ...@@ -964,11 +869,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_isMyCard_test_2600", 0, async function (done) { it("contactsApi_isMyCard_test_2600", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var id = 1; var id = 1;
try { try {
var isExist = await contactsapi.isMyCard(id); var isExist = await contactsapi.isMyCard(id);
...@@ -979,7 +879,7 @@ export default function ObjectInterfaceTest() { ...@@ -979,7 +879,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_isMyCard_test_2600 query error = " + error); console.info("contactsApi_isMyCard_test_2600 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -988,11 +888,6 @@ export default function ObjectInterfaceTest() { ...@@ -988,11 +888,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("contactsApi_isLocalContact_test_2700", 0, async function (done) { it("contactsApi_isLocalContact_test_2700", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var id = gRawContactId; var id = gRawContactId;
try { try {
var isExist = await contactsapi.isLocalContact(id); var isExist = await contactsapi.isLocalContact(id);
...@@ -1003,7 +898,7 @@ export default function ObjectInterfaceTest() { ...@@ -1003,7 +898,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_isLocalContact_test_2700 query error = " + error); console.info("contactsApi_isLocalContact_test_2700 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1012,11 +907,6 @@ export default function ObjectInterfaceTest() { ...@@ -1012,11 +907,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_insert_test_2800", 0, async function (done) { it("abnormal_contactsApi_insert_test_2800", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var contactDataError = {}; var contactDataError = {};
try { try {
var rawContactId = await contactsapi.addContact(contactDataError); var rawContactId = await contactsapi.addContact(contactDataError);
...@@ -1027,7 +917,7 @@ export default function ObjectInterfaceTest() { ...@@ -1027,7 +917,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_insert_test_100 : raw_contact insert error = " + error); console.info("contactsApi_insert_test_100 : raw_contact insert error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1036,11 +926,6 @@ export default function ObjectInterfaceTest() { ...@@ -1036,11 +926,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_update_test_3000", 0, async function (done) { it("abnormal_contactsApi_update_test_3000", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var rawContactId = -1; var rawContactId = -1;
var updateValues = { var updateValues = {
id: rawContactId, name: { id: rawContactId, name: {
...@@ -1053,13 +938,13 @@ export default function ObjectInterfaceTest() { ...@@ -1053,13 +938,13 @@ export default function ObjectInterfaceTest() {
try { try {
var updateCode = await contactsapi.updateContact(updateValues, condition); var updateCode = await contactsapi.updateContact(updateValues, condition);
console.info("abnormal_contactsApi_update_test_3000 : updateCode = " + updateCode); console.info("abnormal_contactsApi_update_test_3000 : updateCode = " + updateCode);
expect(updateCode === -1).assertTrue(); expect(updateCode === 0).assertTrue();
done(); done();
} catch (error) { } catch (error) {
console.info("abnormal_contactsApi_update_test_3000 : update error = " + error); console.info("abnormal_contactsApi_update_test_3000 : update error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1068,11 +953,6 @@ export default function ObjectInterfaceTest() { ...@@ -1068,11 +953,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_query_contact_test_3100", 0, async function (done) { it("abnormal_contactsApi_query_contact_test_3100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var queryId = "-1"; var queryId = "-1";
try { try {
var resultSet = await contactsapi.queryContact(queryId); var resultSet = await contactsapi.queryContact(queryId);
...@@ -1089,7 +969,7 @@ export default function ObjectInterfaceTest() { ...@@ -1089,7 +969,7 @@ export default function ObjectInterfaceTest() {
console.info("abnormal_contactsApi_query_contact_test_3100 query error = " + error); console.info("abnormal_contactsApi_query_contact_test_3100 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1098,11 +978,6 @@ export default function ObjectInterfaceTest() { ...@@ -1098,11 +978,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_query_contacts_test_3200", 0, async function (done) { it("abnormal_contactsApi_query_contacts_test_3200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var ContactAttributes = { var ContactAttributes = {
attributes: [100] attributes: [100]
} }
...@@ -1122,7 +997,7 @@ export default function ObjectInterfaceTest() { ...@@ -1122,7 +997,7 @@ export default function ObjectInterfaceTest() {
console.info("abnormal_contactsApi_query_contacts_test_3200 query error = " + error); console.info("abnormal_contactsApi_query_contacts_test_3200 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1131,11 +1006,6 @@ export default function ObjectInterfaceTest() { ...@@ -1131,11 +1006,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_query_email_test_3300", 0, async function (done) { it("abnormal_contactsApi_query_email_test_3300", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var email = "email2222"; var email = "email2222";
try { try {
var resultSet = await contactsapi.queryContactsByEmail(email); var resultSet = await contactsapi.queryContactsByEmail(email);
...@@ -1146,7 +1016,7 @@ export default function ObjectInterfaceTest() { ...@@ -1146,7 +1016,7 @@ export default function ObjectInterfaceTest() {
console.info("abnormal_contactsApi_query_email_test_3300 query error = " + error); console.info("abnormal_contactsApi_query_email_test_3300 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1155,11 +1025,6 @@ export default function ObjectInterfaceTest() { ...@@ -1155,11 +1025,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_query_phoneNumber_test_3400", 0, async function (done) { it("abnormal_contactsApi_query_phoneNumber_test_3400", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var phoneNumber = "19999999"; var phoneNumber = "19999999";
try { try {
var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber); var resultSet = await contactsapi.queryContactsByPhoneNumber(phoneNumber);
...@@ -1171,7 +1036,7 @@ export default function ObjectInterfaceTest() { ...@@ -1171,7 +1036,7 @@ export default function ObjectInterfaceTest() {
console.info("abnormal_contactsApi_query_phoneNumber_test_3400 query error = " + error); console.info("abnormal_contactsApi_query_phoneNumber_test_3400 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1180,11 +1045,6 @@ export default function ObjectInterfaceTest() { ...@@ -1180,11 +1045,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_query_group_test_3500", 0, async function (done) { it("abnormal_contactsApi_query_group_test_3500", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var holder = { var holder = {
bundleName: "com.ohos.contacts2", displayName: "phone2", holderId: 2 bundleName: "com.ohos.contacts2", displayName: "phone2", holderId: 2
} }
...@@ -1197,7 +1057,7 @@ export default function ObjectInterfaceTest() { ...@@ -1197,7 +1057,7 @@ export default function ObjectInterfaceTest() {
console.info("contactsApi_query_group_test_2000 query error = " + error); console.info("contactsApi_query_group_test_2000 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1206,11 +1066,6 @@ export default function ObjectInterfaceTest() { ...@@ -1206,11 +1066,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_query_key_test_3600", 0, async function (done) { it("abnormal_contactsApi_query_key_test_3600", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var idtest = -1; var idtest = -1;
try { try {
var resultSet = await contactsapi.queryKey(idtest); var resultSet = await contactsapi.queryKey(idtest);
...@@ -1221,7 +1076,7 @@ export default function ObjectInterfaceTest() { ...@@ -1221,7 +1076,7 @@ export default function ObjectInterfaceTest() {
console.info("abnormal_contactsApi_query_key_test_3600 query error = " + error); console.info("abnormal_contactsApi_query_key_test_3600 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1230,11 +1085,6 @@ export default function ObjectInterfaceTest() { ...@@ -1230,11 +1085,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_query_mycard_test_3700", 0, async function (done) { it("abnormal_contactsApi_query_mycard_test_3700", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var ContactAttributes = { var ContactAttributes = {
attributes: [100] attributes: [100]
}; };
...@@ -1248,7 +1098,7 @@ export default function ObjectInterfaceTest() { ...@@ -1248,7 +1098,7 @@ export default function ObjectInterfaceTest() {
console.info("abnormal_contactsApi_query_mycard_test_3700 query error = " + error); console.info("abnormal_contactsApi_query_mycard_test_3700 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1257,11 +1107,6 @@ export default function ObjectInterfaceTest() { ...@@ -1257,11 +1107,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_isMyCard_test_3800", 0, async function (done) { it("abnormal_contactsApi_isMyCard_test_3800", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var id = 999; var id = 999;
try { try {
var isExist = await contactsapi.isMyCard(id); var isExist = await contactsapi.isMyCard(id);
...@@ -1272,7 +1117,7 @@ export default function ObjectInterfaceTest() { ...@@ -1272,7 +1117,7 @@ export default function ObjectInterfaceTest() {
console.info("abnormal_contactsApi_isMyCard_test_3800 query error = " + error); console.info("abnormal_contactsApi_isMyCard_test_3800 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
/** /**
...@@ -1281,11 +1126,6 @@ export default function ObjectInterfaceTest() { ...@@ -1281,11 +1126,6 @@ export default function ObjectInterfaceTest() {
* @tc.desc Function test * @tc.desc Function test
*/ */
it("abnormal_contactsApi_isLocalContact_test_3900", 0, async function (done) { it("abnormal_contactsApi_isLocalContact_test_3900", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
var id = 999; var id = 999;
try { try {
var isExist = await contactsapi.isLocalContact(id); var isExist = await contactsapi.isLocalContact(id);
...@@ -1296,15 +1136,10 @@ export default function ObjectInterfaceTest() { ...@@ -1296,15 +1136,10 @@ export default function ObjectInterfaceTest() {
console.info("abnormal_contactsApi_isLocalContact_test_3900 query error = " + error); console.info("abnormal_contactsApi_isLocalContact_test_3900 query error = " + error);
done(); done();
} }
sleep(500) sleep(500);
}); });
it("contactsApi_addContact_test_100", 0, async function (done) { it("contactsApi_addContact_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.addContact(contactData, (err, data) => { contactsapi.addContact(contactData, (err, data) => {
if (err) { if (err) {
done(); done();
...@@ -1313,15 +1148,10 @@ export default function ObjectInterfaceTest() { ...@@ -1313,15 +1148,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) != -1).assertTrue(); expect(JSON.stringify(data) != -1).assertTrue();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_deleteContact_test_100", 0, async function (done) { it("contactsApi_deleteContact_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.deleteContact('xxx', (err) => { contactsapi.deleteContact('xxx', (err) => {
if (err) { if (err) {
expect(JSON.stringify(err) == -1).assertTrue(); expect(JSON.stringify(err) == -1).assertTrue();
...@@ -1332,16 +1162,11 @@ export default function ObjectInterfaceTest() { ...@@ -1332,16 +1162,11 @@ export default function ObjectInterfaceTest() {
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContact_test_100", 0, async function (done) { it("contactsApi_queryContact_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContact('xxx', (err, data) => { contactsapi.queryContact('xxx', (err, data) => {
if (err) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -1351,15 +1176,10 @@ export default function ObjectInterfaceTest() { ...@@ -1351,15 +1176,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) == undefined).assertTrue(); expect(JSON.stringify(data) == undefined).assertTrue();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContact_test_200", 0, async function (done) { it("contactsApi_queryContact_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContact('xxx', { contactsapi.queryContact('xxx', {
holderId: 0 holderId: 0
}, (err, data) => { }, (err, data) => {
...@@ -1371,15 +1191,10 @@ export default function ObjectInterfaceTest() { ...@@ -1371,15 +1191,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) == undefined).assertTrue(); expect(JSON.stringify(data) == undefined).assertTrue();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContact_test_300", 0, async function (done) { it("contactsApi_queryContact_test_300", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContact('xxx', { contactsapi.queryContact('xxx', {
attributes: ["ATTR_EMAIL", "ATTR_NAME"] attributes: ["ATTR_EMAIL", "ATTR_NAME"]
}, (err, data) => { }, (err, data) => {
...@@ -1391,15 +1206,10 @@ export default function ObjectInterfaceTest() { ...@@ -1391,15 +1206,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) == undefined).assertTrue(); expect(JSON.stringify(data) == undefined).assertTrue();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContact_test_400", 0, async function (done) { it("contactsApi_queryContact_test_400", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContact('xxx', { contactsapi.queryContact('xxx', {
holderId: 0 holderId: 0
}, { }, {
...@@ -1413,15 +1223,10 @@ export default function ObjectInterfaceTest() { ...@@ -1413,15 +1223,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) == undefined).assertTrue(); expect(JSON.stringify(data) == undefined).assertTrue();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContact_test_500", 0, async function (done) { it("contactsApi_queryContact_test_500", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
let promise = contactsapi.queryContact('xxx', { let promise = contactsapi.queryContact('xxx', {
holderId: 0 holderId: 0
}, { }, {
...@@ -1434,15 +1239,10 @@ export default function ObjectInterfaceTest() { ...@@ -1434,15 +1239,10 @@ export default function ObjectInterfaceTest() {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContacts_test_100", 0, async function (done) { it("contactsApi_queryContacts_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContacts((err, data) => { contactsapi.queryContacts((err, data) => {
if (err) { if (err) {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
...@@ -1452,15 +1252,10 @@ export default function ObjectInterfaceTest() { ...@@ -1452,15 +1252,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContacts_test_200", 0, async function (done) { it("contactsApi_queryContacts_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContacts({ contactsapi.queryContacts({
holderId: 0 holderId: 0
}, (err, data) => { }, (err, data) => {
...@@ -1472,15 +1267,10 @@ export default function ObjectInterfaceTest() { ...@@ -1472,15 +1267,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContacts_test_300", 0, async function (done) { it("contactsApi_queryContacts_test_300", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContacts({ contactsapi.queryContacts({
attributes: ["ATTR_EMAIL", "ATTR_NAME"] attributes: ["ATTR_EMAIL", "ATTR_NAME"]
}, (err, data) => { }, (err, data) => {
...@@ -1492,16 +1282,11 @@ export default function ObjectInterfaceTest() { ...@@ -1492,16 +1282,11 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContacts_test_400", 0, async function (done) { it("contactsApi_queryContacts_test_400", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContacts({ contactsapi.queryContacts({
holderId: 0 holderId: 0
}, { }, {
...@@ -1515,16 +1300,11 @@ export default function ObjectInterfaceTest() { ...@@ -1515,16 +1300,11 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContacts_test_500", 0, async function (done) { it("contactsApi_queryContacts_test_500", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
let promise = contactsapi.queryContacts({ let promise = contactsapi.queryContacts({
holderId: 0 holderId: 0
}, { }, {
...@@ -1537,15 +1317,10 @@ export default function ObjectInterfaceTest() { ...@@ -1537,15 +1317,10 @@ export default function ObjectInterfaceTest() {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContactsByPhoneNumber_test_000", 0, async function (done) { it("contactsApi_queryContactsByPhoneNumber_test_000", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContactsByPhoneNumber('138xxxxxxxx', (err, data) => { contactsapi.queryContactsByPhoneNumber('138xxxxxxxx', (err, data) => {
if (err) { if (err) {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
...@@ -1555,15 +1330,10 @@ export default function ObjectInterfaceTest() { ...@@ -1555,15 +1330,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContactsByPhoneNumber_test_100", 0, async function (done) { it("contactsApi_queryContactsByPhoneNumber_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContactsByPhoneNumber('138xxxxxxxx', { contactsapi.queryContactsByPhoneNumber('138xxxxxxxx', {
holderId: 0 holderId: 0
}, (err, data) => { }, (err, data) => {
...@@ -1575,15 +1345,10 @@ export default function ObjectInterfaceTest() { ...@@ -1575,15 +1345,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContactsByPhoneNumber_test_200", 0, async function (done) { it("contactsApi_queryContactsByPhoneNumber_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContactsByPhoneNumber('138xxxxxxxx', { contactsapi.queryContactsByPhoneNumber('138xxxxxxxx', {
attributes: ["ATTR_EMAIL", "ATTR_NAME"] attributes: ["ATTR_EMAIL", "ATTR_NAME"]
}, (err, data) => { }, (err, data) => {
...@@ -1595,15 +1360,10 @@ export default function ObjectInterfaceTest() { ...@@ -1595,15 +1360,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContactsByPhoneNumber_test_300", 0, async function (done) { it("contactsApi_queryContactsByPhoneNumber_test_300", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContactsByPhoneNumber('138xxxxxxxx', { contactsapi.queryContactsByPhoneNumber('138xxxxxxxx', {
holderId: 0 holderId: 0
}, { }, {
...@@ -1617,16 +1377,11 @@ export default function ObjectInterfaceTest() { ...@@ -1617,16 +1377,11 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContactsByEmail_test_100", 0, async function (done) { it("contactsApi_queryContactsByEmail_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContactsByEmail('xxx@email.com', (err, data) => { contactsapi.queryContactsByEmail('xxx@email.com', (err, data) => {
if (err) { if (err) {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
...@@ -1636,15 +1391,10 @@ export default function ObjectInterfaceTest() { ...@@ -1636,15 +1391,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContactsByEmail_test_200", 0, async function (done) { it("contactsApi_queryContactsByEmail_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContactsByEmail('xxx@email.com', { contactsapi.queryContactsByEmail('xxx@email.com', {
holderId: 0 holderId: 0
}, (err, data) => { }, (err, data) => {
...@@ -1656,16 +1406,11 @@ export default function ObjectInterfaceTest() { ...@@ -1656,16 +1406,11 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContactsByEmail_test_300", 0, async function (done) { it("contactsApi_queryContactsByEmail_test_300", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContactsByEmail('xxx@email.com', { contactsapi.queryContactsByEmail('xxx@email.com', {
attributes: ["ATTR_EMAIL", "ATTR_NAME"] attributes: ["ATTR_EMAIL", "ATTR_NAME"]
}, (err, data) => { }, (err, data) => {
...@@ -1677,16 +1422,11 @@ export default function ObjectInterfaceTest() { ...@@ -1677,16 +1422,11 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryContactsByEmail_test_400", 0, async function (done) { it("contactsApi_queryContactsByEmail_test_400", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryContactsByEmail('xxx@email.com', { contactsapi.queryContactsByEmail('xxx@email.com', {
holderId: 0 holderId: 0
}, { }, {
...@@ -1700,15 +1440,10 @@ export default function ObjectInterfaceTest() { ...@@ -1700,15 +1440,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryGroups_test_100", 0, async function (done) { it("contactsApi_queryGroups_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryGroups((err, data) => { contactsapi.queryGroups((err, data) => {
if (err) { if (err) {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
...@@ -1718,15 +1453,10 @@ export default function ObjectInterfaceTest() { ...@@ -1718,15 +1453,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryGroups_test_200", 0, async function (done) { it("contactsApi_queryGroups_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryGroups({ contactsapi.queryGroups({
holderId: 0 holderId: 0
}, (err, data) => { }, (err, data) => {
...@@ -1738,16 +1468,11 @@ export default function ObjectInterfaceTest() { ...@@ -1738,16 +1468,11 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryHolders_test_100", 0, async function (done) { it("contactsApi_queryHolders_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryHolders((err, data) => { contactsapi.queryHolders((err, data) => {
if (err) { if (err) {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
...@@ -1757,15 +1482,10 @@ export default function ObjectInterfaceTest() { ...@@ -1757,15 +1482,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryKey_test_100", 0, async function (done) { it("contactsApi_queryKey_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryKey( /*id*/ contactsapi.queryKey( /*id*/
1, (err, data) => { 1, (err, data) => {
if (err) { if (err) {
...@@ -1776,15 +1496,10 @@ export default function ObjectInterfaceTest() { ...@@ -1776,15 +1496,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryKey_test_200", 0, async function (done) { it("contactsApi_queryKey_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryKey( /*id*/ contactsapi.queryKey( /*id*/
1, { 1, {
holderId: 1 holderId: 1
...@@ -1797,16 +1512,11 @@ export default function ObjectInterfaceTest() { ...@@ -1797,16 +1512,11 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryMyCard_test_100", 0, async function (done) { it("contactsApi_queryMyCard_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryMyCard((err, data) => { contactsapi.queryMyCard((err, data) => {
if (err) { if (err) {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
...@@ -1816,16 +1526,11 @@ export default function ObjectInterfaceTest() { ...@@ -1816,16 +1526,11 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_queryMyCard_test_200", 0, async function (done) { it("contactsApi_queryMyCard_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.queryMyCard({ contactsapi.queryMyCard({
attributes: ['ATTR_EMAIL', 'ATTR_NAME'] attributes: ['ATTR_EMAIL', 'ATTR_NAME']
}, (err, data) => { }, (err, data) => {
...@@ -1837,15 +1542,10 @@ export default function ObjectInterfaceTest() { ...@@ -1837,15 +1542,10 @@ export default function ObjectInterfaceTest() {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_updateContact_test_100", 0, async function (done) { it("contactsApi_updateContact_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.updateContact({ contactsapi.updateContact({
name: { name: {
fullName: 'xxx' fullName: 'xxx'
...@@ -1862,15 +1562,10 @@ export default function ObjectInterfaceTest() { ...@@ -1862,15 +1562,10 @@ export default function ObjectInterfaceTest() {
console.info('updateContact success'); console.info('updateContact success');
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_updateContact_test_200", 0, async function (done) { it("contactsApi_updateContact_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.updateContact({ contactsapi.updateContact({
fullName: { fullName: {
fullName: 'xxx' fullName: 'xxx'
...@@ -1889,15 +1584,10 @@ export default function ObjectInterfaceTest() { ...@@ -1889,15 +1584,10 @@ export default function ObjectInterfaceTest() {
console.info('updateContact success'); console.info('updateContact success');
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_isLocalContact_test_100", 0, async function (done) { it("contactsApi_isLocalContact_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.isLocalContact( /*id*/ contactsapi.isLocalContact( /*id*/
1, (err, data) => { 1, (err, data) => {
if (err) { if (err) {
...@@ -1907,15 +1597,10 @@ export default function ObjectInterfaceTest() { ...@@ -1907,15 +1597,10 @@ export default function ObjectInterfaceTest() {
} }
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_isMyCard_test_100", 0, async function (done) { it("contactsApi_isMyCard_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.isMyCard( /*id*/ contactsapi.isMyCard( /*id*/
1, (err, data) => { 1, (err, data) => {
if (err) { if (err) {
...@@ -1925,15 +1610,10 @@ export default function ObjectInterfaceTest() { ...@@ -1925,15 +1610,10 @@ export default function ObjectInterfaceTest() {
} }
done(); done();
}); });
sleep(500) sleep(500);
}); });
it("contactsApi_sendMessage_test_100", 0, async function (done) { it("contactsApi_sendMessage_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
let sendCallback = function (err, data) { let sendCallback = function (err, data) {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
...@@ -1958,65 +1638,26 @@ export default function ObjectInterfaceTest() { ...@@ -1958,65 +1638,26 @@ export default function ObjectInterfaceTest() {
}; };
sms.sendMessage(options); sms.sendMessage(options);
done(); done();
sleep(500) sleep(500);
}); });
it("contactsApi_selectContact_test_100", 0, async function (done) { it("contactsApi_selectContact_test_100", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
contactsapi.selectContact((err, data) => { contactsapi.selectContact((err, data) => {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
sleep(500) sleep(500);
}); });
}); });
it("contactsApi_selectContact_test_200", 0, async function (done) { it("contactsApi_selectContact_test_200", 0, async function (done) {
checkContactPermission();
if (!contactPermission) {
done();
return;
}
let promise = contactsapi.selectContact(); let promise = contactsapi.selectContact();
promise.then((data) => { promise.then((data) => {
expect(JSON.stringify(data) === null).assertFalse(); expect(JSON.stringify(data) === null).assertFalse();
done(); done();
sleep(500) sleep(500);
}).catch((err) => { }).catch((err) => {
done(); done();
}); });
}); });
let contactPermission;
let userId;
async function getUserId() {
await account.getAccountManager().getOsAccountLocalIdFromProcess().then(account => {
console.info("getOsAccountLocalIdFromProcess userid ==========" + account);
userId = account;
}).catch(err => {
console.info("getOsAccountLocalIdFromProcess err ==========" + JSON.stringify(err));
})
}
async function checkContactPermission() {
await getUserId();
let appInfo = await bundle.getApplicationInfo('com.ohos.actscallmanagerims2calltest', 0, userId);
console.info("getOsAccountLocalIdFromProcess appInfo ==========" + JSON.stringify(appInfo) + "userId:" + userId);
let tokenID = appInfo.accessTokenId;
let atManager = abilityAccessCtrl.createAtManager();
let result1 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.READ_CONTACTS", 1);
let result2 = await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.WRITE_CONTACTS", 1);
console.info("checkContactPermission Log: Perm1:" + result1);
console.info("checkContactPermission Log: Perm2:" + result2);
if (result1 == -1 || result2 == -1) {
contactPermission = false;
done();
}
contactPermission = true;
done();
}
}); });
} }
\ No newline at end of file
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -67,47 +67,11 @@ ...@@ -67,47 +67,11 @@
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
}, },
{ {
"name":"ohos.permission.INTERNET", "name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET" "reason":"need use ohos.permission.INTERNET"
} }
......
...@@ -209,7 +209,5 @@ describe("ActsCellularDataAbnormalTest", function () { ...@@ -209,7 +209,5 @@ describe("ActsCellularDataAbnormalTest", function () {
expect(data == 0 || data == 1).assertTrue; expect(data == 0 || data == 1).assertTrue;
done(); done();
}); });
});
})
} }
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"bundle-name": "com.ohos.jshttp", "bundle-name": "com.ohos.jshttp",
"package-name": "com.ohos.jshttp", "package-name": "com.ohos.jshttp",
"shell-timeout": "900000", "shell-timeout": "900000",
"testcase-timeout":"100000" "testcase-timeout":"200000"
}, },
"kits": [ "kits": [
{ {
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import Telephony_NETSTACK_HTTPTest from './NetworkManagerHttp.test.js' import Telephony_NETSTACK_HTTPTest from './NetworkManagerHttp.test.js';
import Http2Test from './Http2Test.js' import Http2Test from './Http2Test.js';
import HttpCacheTest from './HttpCacheTest.js' import HttpCacheTest from './HttpCacheTest.js';
export default function testsuite() { export default function testsuite() {
Telephony_NETSTACK_HTTPTest() HttpCacheTest();
Http2Test() Telephony_NETSTACK_HTTPTest();
HttpCacheTest() Http2Test();
} }
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"module": { "module": {
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"abilities": [ "abilities": [
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"module": { "module": {
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"abilities": [ "abilities": [
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"module": { "module": {
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"abilities": [ "abilities": [
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -66,48 +66,12 @@ ...@@ -66,48 +66,12 @@
"launchType": "standard" "launchType": "standard"
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
}, },
{ {
"name":"ohos.permission.INTERNET", "name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET" "reason":"need use ohos.permission.INTERNET"
} }
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -66,48 +66,12 @@ ...@@ -66,48 +66,12 @@
"launchType": "standard" "launchType": "standard"
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
}, },
{ {
"name":"ohos.permission.INTERNET", "name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET" "reason":"need use ohos.permission.INTERNET"
} }
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone", "phone",
"tablet" "tablet"
], ],
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath": "", "srcPath": "",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -68,47 +68,11 @@ ...@@ -68,47 +68,11 @@
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
}, },
{ {
"name":"ohos.permission.INTERNET", "name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET" "reason":"need use ohos.permission.INTERNET"
} }
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath": "", "srcPath": "",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -72,43 +72,11 @@ ...@@ -72,43 +72,11 @@
"name": "ohos.permission.LOCATION", "name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION" "reason": "need use ohos.permission.LOCATION"
}, },
{ {
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
}, },
{ {
"name":"ohos.permission.INTERNET", "name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET" "reason":"need use ohos.permission.INTERNET"
} }
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -67,47 +67,11 @@ ...@@ -67,47 +67,11 @@
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
}, },
{ {
"name":"ohos.permission.INTERNET", "name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET" "reason":"need use ohos.permission.INTERNET"
} }
......
...@@ -22,7 +22,6 @@ describe('ActsNetworkSearchTest', function () { ...@@ -22,7 +22,6 @@ describe('ActsNetworkSearchTest', function () {
const SLOT_0 = 0; const SLOT_0 = 0;
const SLOT_2 = -1; const SLOT_2 = -1;
const PREFERRED_MODE_ERR2 = -1;
function sleep(timeout) { function sleep(timeout) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -87,10 +86,6 @@ describe('ActsNetworkSearchTest', function () { ...@@ -87,10 +86,6 @@ describe('ActsNetworkSearchTest', function () {
expect(radio.NsaState.NSA_STATE_DUAL_CONNECTED === 5).assertTrue(); expect(radio.NsaState.NSA_STATE_DUAL_CONNECTED === 5).assertTrue();
expect(radio.NsaState.NSA_STATE_SA_ATTACHED === 6).assertTrue(); expect(radio.NsaState.NSA_STATE_SA_ATTACHED === 6).assertTrue();
expect(radio.NetworkInformationState.NETWORK_UNKNOWN === 0).assertTrue();
expect(radio.NetworkInformationState.NETWORK_CURRENT === 2).assertTrue();
expect(radio.NetworkInformationState.NETWORK_FORBIDDEN === 3).assertTrue();
expect(radio.NetworkSelectionMode.NETWORK_SELECTION_UNKNOWN === 0).assertTrue(); expect(radio.NetworkSelectionMode.NETWORK_SELECTION_UNKNOWN === 0).assertTrue();
expect(radio.NetworkSelectionMode.NETWORK_SELECTION_MANUAL === 2).assertTrue(); expect(radio.NetworkSelectionMode.NETWORK_SELECTION_MANUAL === 2).assertTrue();
} catch (error) { } catch (error) {
...@@ -195,13 +190,13 @@ describe('ActsNetworkSearchTest', function () { ...@@ -195,13 +190,13 @@ describe('ActsNetworkSearchTest', function () {
console.info( console.info(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:${JSON.stringify(data)}`); `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:${JSON.stringify(data)}`);
expect(data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
done();
} catch (err) { } catch (err) {
console.info(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err: ${err}`); console.info(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err: ${err}`);
expect(err.code).assertEqual(202); expect(err.code).assertEqual(202);
done(); done();
return; return;
} }
done();
}); });
/** /**
...@@ -292,13 +287,13 @@ describe('ActsNetworkSearchTest', function () { ...@@ -292,13 +287,13 @@ describe('ActsNetworkSearchTest', function () {
console.info( console.info(
`Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data: ${JSON.stringify(data)}`); `Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data: ${JSON.stringify(data)}`);
expect(data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
done();
} catch (err) { } catch (err) {
console.info(`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ${err}`); console.info(`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ${err}`);
expect(err.code).assertEqual(202); expect(err.code).assertEqual(202);
done(); done();
return; return;
} }
done();
}); });
/** /**
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
} }
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath": "", "srcPath": "",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -68,49 +68,9 @@ ...@@ -68,49 +68,9 @@
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
},
{
"name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET"
} }
], ],
"js": [ "js": [
......
...@@ -21,8 +21,7 @@ export function toString(data) { ...@@ -21,8 +21,7 @@ export function toString(data) {
} else { } else {
return data; return data;
} }
} };
;
export default function callJsunit() { export default function callJsunit() {
describe('callTest', function () { describe('callTest', function () {
...@@ -46,118 +45,6 @@ export default function callJsunit() { ...@@ -46,118 +45,6 @@ export default function callJsunit() {
done(); done();
}); });
/**
* @tc.number Telephony_Call_CallTransferInfo_Type
* @tc.name Interface CallTransferInfo
* @tc.desc Interface value test
*/
it('Telephony_Call_CallTransferInfo_Type', 0, function (done) {
let caseName = 'Telephony_Call_CallTransferInfo_Type';
console.log(`==========> ${caseName} Test start ==========>`);
let callTransferInfo = {
transferNum: '10000000001', type: 2, settingType: 1
};
expect(callTransferInfo.type === 2).assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/**
* @tc.number Telephony_Call_CallTransferResult_Status
* @tc.name Interface CallTransferResult
* @tc.desc Interface value test
*/
it('Telephony_Call_CallTransferResult_Status', 0, function (done) {
let caseName = 'Telephony_Call_CallTransferResult_Status';
console.log(`==========> ${caseName} Test start ==========>`);
let callTransferResult = {
status: 0, number: '10000000001'
};
expect(callTransferResult.status === 0).assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/**
* @tc.number Telephony_Call_CallTransferResult_Number
* @tc.name Interface CallTransferResult
* @tc.desc Interface value test
*/
it('Telephony_Call_CallTransferResult_Number', 0, function (done) {
let caseName = 'Telephony_Call_CallTransferResult_Number';
console.log(`==========> ${caseName} Test start ==========>`);
let callTransferResult = {
status: 0, number: '10000000001'
};
expect(callTransferResult.number === '10000000001').assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/**
* @tc.number Telephony_Call_CallAttributeOptions_CallId
* @tc.name Interface CallAttributeOptions
* @tc.desc Interface value test
*/
it('Telephony_Call_CallAttributeOptions_CallId', 0, function (done) {
let caseName = 'Telephony_Call_CallAttributeOptions_CallId';
console.log(`==========> ${caseName} Test start ==========>`);
let callAttributeOptions = {
callId: 1
};
expect(callAttributeOptions.callId === 1).assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/**
* @tc.number Telephony_Call_CallRestrictionInfo_Type
* @tc.name Interface CallRestrictionInfo
* @tc.desc Interface value test
*/
it('Telephony_Call_CallRestrictionInfo_Type', 0, function (done) {
let caseName = 'Telephony_Call_CallRestrictionInfo_Type';
console.log(`==========> ${caseName} Test start ==========>`);
let callRestrictionInfo = {
type: 0, password: '123456', mode: 1
};
expect(callRestrictionInfo.type === 0).assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/**
* @tc.number Telephony_Call_CallRestrictionInfo_Mode
* @tc.name Interface CallRestrictionInfo
* @tc.desc Interface value test
*/
it('Telephony_Call_CallRestrictionInfo_Mode', 0, function (done) {
let caseName = 'Telephony_Call_CallRestrictionInfo_Mode';
console.log(`==========> ${caseName} Test start ==========>`);
let callRestrictionInfo = {
type: 0, password: '123456', mode: 1
};
expect(callRestrictionInfo.mode === 1).assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/**
* @tc.number Telephony_Call_CallEventOptions_EventId
* @tc.name Interface CallEventOptions
* @tc.desc Interface value test
*/
it('Telephony_Call_CallEventOptions_EventId', 0, function (done) {
let caseName = 'Telephony_Call_CallEventOptions_EventId';
console.log(`==========> ${caseName} Test start ==========>`);
let callEventOptions = {
eventId: 1
};
expect(callEventOptions.eventId === 1).assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/** /**
* @tc.number Telephony_Call_Call_MakeCall_0100 * @tc.number Telephony_Call_Call_MakeCall_0100
* @tc.name Make a call. * @tc.name Make a call.
......
...@@ -137,27 +137,6 @@ export default function radioSecondJsunit() { ...@@ -137,27 +137,6 @@ export default function radioSecondJsunit() {
} }
}) })
/**
* @tc.number Telephony_Radio_CdmaCellInformation_sid_0100
* @tc.name sid
* @tc.desc sid test
*/
it('Telephony_Radio_CdmaCellInformation_sid_0100', 0, async function (done) {
console.log("-----------------------Telephony_Radio_CdmaCellInformation_sid_0100 start-----------------------");
let cdmaCellInformation = {
baseId: 1,
latitude: 39,
longitude: 116,
nid: 101,
sid: 102
};
expect(101).assertEqual(cdmaCellInformation.nid);
expect(102).assertEqual(cdmaCellInformation.sid);
done();
console.log("-----------------------Telephony_Radio_CdmaCellInformation_sid_0100 end-----------------------");
})
/** /**
* @tc.number Telephony_NetworkSearch_getRadioTech_Async_0500 * @tc.number Telephony_NetworkSearch_getRadioTech_Async_0500
* @tc.name TestGetRadioTech_0500 * @tc.name TestGetRadioTech_0500
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -66,52 +66,6 @@ ...@@ -66,52 +66,6 @@
"launchType": "standard" "launchType": "standard"
} }
], ],
"reqPermissions": [
{
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO"
},
{
"name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET"
}
],
"js": [ "js": [
{ {
"pages": [ "pages": [
......
...@@ -83,12 +83,6 @@ describe('SimManagerTest', function () { ...@@ -83,12 +83,6 @@ describe('SimManagerTest', function () {
expect(sim.SimState.SIM_STATE_NOT_READY !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_NOT_READY !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_READY !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_READY !== env.INVALID_VALUE).assertTrue();
expect(sim.SimState.SIM_STATE_LOADED !== env.INVALID_VALUE).assertTrue(); expect(sim.SimState.SIM_STATE_LOADED !== env.INVALID_VALUE).assertTrue();
expect(sim.ContactType.GENERAL_CONTACT !== env.INVALID_VALUE).assertTrue();
expect(sim.ContactType.FIXED_DIALING !== env.INVALID_VALUE).assertTrue();
expect(sim.LockState.LOCK_OFF !== env.INVALID_VALUE).assertTrue();
expect(sim.LockState.LOCK_ON !== env.INVALID_VALUE).assertTrue();
expect(sim.PIN_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.FDN_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.UNKNOWN_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.UNKNOWN_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.SINGLE_MODE_SIM_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.SINGLE_MODE_SIM_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.SINGLE_MODE_USIM_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.SINGLE_MODE_USIM_CARD !== env.INVALID_VALUE).assertTrue();
...@@ -99,16 +93,6 @@ describe('SimManagerTest', function () { ...@@ -99,16 +93,6 @@ describe('SimManagerTest', function () {
expect(sim.DUAL_MODE_TELECOM_LTE_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.DUAL_MODE_TELECOM_LTE_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.DUAL_MODE_UG_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.DUAL_MODE_UG_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.SINGLE_MODE_ISIM_CARD !== env.INVALID_VALUE).assertTrue(); expect(sim.SINGLE_MODE_ISIM_CARD !== env.INVALID_VALUE).assertTrue();
expect(sim.PN_PIN_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.PN_PUK_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.PU_PIN_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.PU_PUK_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.PP_PIN_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.PP_PUK_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.PC_PIN_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.PC_PUK_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.SIM_PIN_LOCK !== env.INVALID_VALUE).assertTrue();
expect(sim.SIM_PUK_LOCK !== env.INVALID_VALUE).assertTrue();
console.info(`Telephony_Sim_constantValidate_0100 finish`); console.info(`Telephony_Sim_constantValidate_0100 finish`);
done(); done();
}); });
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath":"", "srcPath":"",
"deviceType": [ "deviceType": [
"tablet", "tablet",
"default", "default",
"phone" "phone"
], ],
"distro": { "distro": {
...@@ -66,52 +66,6 @@ ...@@ -66,52 +66,6 @@
"launchType": "standard" "launchType": "standard"
} }
], ],
"reqPermissions": [
{
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO"
},
{
"name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET"
}
],
"js": [ "js": [
{ {
"pages": [ "pages": [
......
...@@ -17,20 +17,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from ...@@ -17,20 +17,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
export default function SmsMmsErrorTest() { export default function SmsMmsErrorTest() {
describe('SmsMmsErrorTest', function () { describe('SmsMmsErrorTest', function () {
const FALSE_SLOT_ID = 9;
const CORRECT_SMS_PDU = '01000F9168683106019196F400080A00680065006C006C006F';
const ERROR_MESSAGE_PATH = '/data/telephony/deSrc/EorroMessagePath.mms';
const IDENTIFIER_MIN = 0;
const IDENTIFIER_MAX = 0xFFFF;
const RANTYPE_GSM = 1;
var rawArrayNull = [];
const SMS_SEND_DST_NUMBER = '';
const MAX_CHINESE_MESSAGE_LENTH = 63;
const MAX_MESSAGE_LENTH = 2401;
const TRUE_SLOT_ID = 0;
const RECEIVE_SMS_PDU = '240D91689141468496F600001270721142432302B319';
var rawArrayNull = [];
/* /*
* @tc.number Telephony_SmsMms_createMessage_Async_0200 * @tc.number Telephony_SmsMms_createMessage_Async_0200
......
...@@ -67,49 +67,9 @@ ...@@ -67,49 +67,9 @@
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{
"name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO", "name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO" "reason":"need use ohos.permission.GET_NETWORK_INFO"
},
{
"name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET"
} }
], ],
"js": [ "js": [
......
...@@ -117,25 +117,6 @@ export default function ActsBaseCallManagerTest() { ...@@ -117,25 +117,6 @@ export default function ActsBaseCallManagerTest() {
} }
}); });
/**
* @tc.number Telephony_CallManager_startDTMF_Async_1000
* @tc.name CallId is 999, character is C, startDTMF() is called as a callback to startDTMF and capture err
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_1000', 0, async function (done) {
call.startDTMF(ERROR_CALLID_999, 'C', (err) => {
if (err) {
console.log(`Telephony_CallManager_startDTMF_Async_1000 finish err = ${err.message}`);
done();
return;
}
expect().assertFail();
console.log('Telephony_CallManager_startDTMF_Async_1000 fail');
done();
});
});
/** /**
* @tc.number Telephony_CallManager_formatPhoneNumber_Async_0100 * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0100
* @tc.name PhoneNumber is 100000000000. Call formatPhoneNumber() to format the number. * @tc.name PhoneNumber is 100000000000. Call formatPhoneNumber() to format the number.
......
...@@ -66,11 +66,7 @@ ...@@ -66,11 +66,7 @@
"launchType": "standard" "launchType": "standard"
} }
], ],
"reqPermissions": [ "reqPermissions":[
{
"name": "ohos.permission.LOCATION",
"reason": "need use ohos.permission.LOCATION"
},
{ {
"name":"ohos.permission.SET_TELEPHONY_STATE", "name":"ohos.permission.SET_TELEPHONY_STATE",
"reason":"need use ohos.permission.SET_TELEPHONY_STATE" "reason":"need use ohos.permission.SET_TELEPHONY_STATE"
...@@ -78,38 +74,6 @@ ...@@ -78,38 +74,6 @@
{ {
"name":"ohos.permission.GET_TELEPHONY_STATE", "name":"ohos.permission.GET_TELEPHONY_STATE",
"reason":"need use ohos.permission.GET_TELEPHONY_STATE" "reason":"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name":"ohos.permission.PLACE_CALL",
"reason":"need use ohos.permission.PLACE_CALL"
},
{
"name":"ohos.permission.READ_CONTACTS",
"reason":"need use ohos.permission.READ_CONTACTS"
},
{
"name":"ohos.permission.WRITE_CONTACTS",
"reason":"need use ohos.permission.WRITE_CONTACTS"
},
{
"name":"ohos.permission.SEND_MESSAGES",
"reason":"need use ohos.permission.SEND_MESSAGES"
},
{
"name":"ohos.permission.RECEIVE_SMS",
"reason":"need use ohos.permission.RECEIVE_SMS"
},
{
"name":"ohos.permission.READ_CALL_LOG",
"reason":"need use ohos.permission.READ_CALL_LOG"
},
{
"name":"ohos.permission.GET_NETWORK_INFO",
"reason":"need use ohos.permission.GET_NETWORK_INFO"
},
{
"name":"ohos.permission.INTERNET",
"reason":"need use ohos.permission.INTERNET"
} }
], ],
"js": [ "js": [
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册